- Install python3
- Install a virtualenv
1. pip3 install -U setuptools 2. pip3 install virtualenv 2. python3 -m venv env 3a. source env/bin/activate 3b. .\env\Scripts\activate (Windows Only) 4. pip3 install --compile .[test]
- To stop virtualenv then run this command
deactivate
- To stop virtualenv then run this command
- Run backend application and database
docker-compose up
- Use database with two ways:
- Login
psql -d <database_name> -U <postgres username>
e.g. ` psql -d bar -U postgres - Using the postgreSQL client is easier and prefer
- Credentials for your local postgres, should be in database.env
- Login
- Stop application and database
docker-compose down
- Migrate and create tables
make upgrade-db
- If changes were made to model then follow these changes
- Migrate first
make migrate-db
- Verify model changes in migrations/versions
- Upgrade db
make upgrade-db
- Migrate first
docker build -t bay-area-relief .
docker run bay-area-relief
docker rmi bay-area-relief
(Optional)
pip install psycopg2-binary sqlalchemy pandas
python python bayarea_relief/ingest_raw_data.py -c data/raw_data.csv
- Run unittests
make unittest