To run:
- In the
backenddirectory, create a file named.envwith values for the following environment variables:JWT_SECRET_KEY: Any random string.POSTGRES_PASSWORD: Any random string.POSTGRES_USER:postgres, assuming you're using the bundled docker-based database, or whatever user you need if you have a custom postgres set up.- Optionally,
POSTGRES_DB,POSTGRES_HOST, andPOSTGRES_PORTif you're not using default postgres values.
- Make a virtual environment:
python3 -m venv .venv - Activate the virtual environment:
. .venv/bin/activate - Install dependencies:
pip install -r requirements.txt - Run the database:
../db/run.sh(you must have Docker installed and running). - Create the database schema:
../db/create-schema.sh
You may want to run python3 populate.py to populate sample data.
If you ever need to wipe the database, just delete ../db/pg_data (and remember to set it up again after).
- In one terminal, run the database:
../db/run.sh(you must have Docker installed and running). - In another terminal, activate the virtual environment:
. .venv/bin/activate - With the virtual environment activated, run the backend:
python3 main.py