To get a started working on this project you will need to do the following:
- Python 3.7+
- NodeJS/NPM
- A unix-like shell environment supporting Bash (standard on Mac and Linux). For Windows users, this likely means installing a tool like Git Bash or Cygwin.
- Create your SSH key pair, if you do not have one. If prompted to overwrite existing SSH key, I recommend answering no as your existing key pair can likely be reused (assuming it was properly generated with a supported algorithm, e.g. RSA)
ssh-keygen
- Copy your SSH key to the server, you will be prompted for your password:
ssh-copy-id [email protected]
- Fork this repo to your local repository
https://github.com/hackforla/shared-housing.git
- Pull your forked copy onto your local development environment
git clone <YOUR FORKED REPO URL>
- Navigate to the root of the project:
cd shared-housing
From the shared-housing
directory:
- Enter the client directory:
cd client
- Install all declared dependencies:
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 [email protected]:/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 [email protected]
# 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
- React
- TypeScript
- Material UI
- Formik
- Storybook
- Jest and Enzyme
- Eslint and Prettier
- Parcel
- Python
- Flask
- PostgresSQL
- Docker
- Kubernetes
- A Faster, More Cost-Effective Solution to Homelessness
- Tech tool for affordable housing
- Alternative housing review
- Can tech fix housing market?
Licensed Under: GNU General Public License v3.0