To get a started working on this project you will need to do the following:
ssh-keygen
ssh-copy-id YOUR_USERNAME@ivan-alpha.xyz
https://github.com/hackforla/shared-housing.git
git clone <YOUR FORKED REPO URL>
cd shared-housing
From the shared-housing
directory:
cd client
npm install
Before continuing to install the server dependencies, return to the project root:
cd ..
From the shared-housing
root, navigate to the server directory:
cd server
(Optional) Initialize your virtualenv or conda project. This guide assumes packages will be installed globally, as this is the way the Docker image is configured to build. If you are using a virtual environment, remember to adjust any pip
commands as needed, and activate/deactive your environment(s). This will be the only mention of the conda
or venv
commands in this guide.
# create conda environment
conda create -n sharedhousing python
conda activate
# OR: create virtualenv environment
venv sharedhousing_env
source sharedhousing_env/bin/activate
Install the Python packages
pip install -r requirements.txt
# OR
conda install --file requirements.txt
Before continuing to build the client application, return to the project root:
cd ..
Ensure the build script is executable
chmod +x build-deb.sh
From the project root, run the following command to execute the build script:
./build-deb.sh
Copy the files to the server.
scp -r server YOUR_USERNAME@ivan-alpha.xyz:/home/sharedhousing/app
If you made changes to the server-side code, you also need to log in and reboot
# Log in to server
ssh YOUR_USERNAME@ivan-alpha.xyz
# Reboot app service. You will be prompted for your password
sudo systemctl restart app
# Restart nginx, if necessary
sudo systemctl restart nginx
If you encounter runtime issues that appear to be server-related, check the app logs and nginx logs.
# View app logs, will contain errors that occurred at the application level
sudo journalctl -u app
# View nginx logs, will contain errors that occurred at the HTTP level
sudo journalctl -u nginx
Ensure the build script is executable
chmod +x build-deb.sh
From the project root, run the following command to execute the build script:
./build-deb.sh
Navigate to the server directory
cd server
Launch the Flask application. Leave your terminal open after running this command, your server logs will print here as you interact with the React application from the browser
python app.py
To get the React client running locally:
cd client/
npm run dev
The project also support storybook to allow for viewing components in isolation from the project
npm run storybook
Licensed Under: GNU General Public License v3.0