Note: It's recommend to use an Enterprise Linux distrubtion for the development of this application. Currently we are using Rocky Linux 9.
Ensure Docker, Python 3 and Nix package manager are installed.
Create .env and .env.test using env.example (Fill in blanks).
Generate OSRM data (for OSRM service to consume):
./generate_osrm
Spin up the backend service:
docker compose -f compose.dev.yaml build
docker compose -f compose.dev.yaml up [api] [db] [osrm] (can run individual components if needed)
Start the Frontend:
nix-shell
cd frontend/ && yarn install
npm run dev
Since we are using docker for development, there isn't an easy way to get local linting, so it's recommended to install venv in the root directory of the project and install all dependencies there.
Its really that easy! You can start developing right away.
To run the lint, ensure you have installed the virtual environment setup.
source venv/bin/activate
pylint --rcfile=.pylintrc flask-api/
Running the tests is very simple. A separate docker configuration is included for running them:
./tests [--build] --run
docker exec -it flask-api flask db migrate
docker exec -it flask-api flask db upgrade
docker exec -it flask-api flask db downgrade
# Drop into the DB container
docker exec -it otd-db bash
# Access the Postgres DB
psql -d otd-dev -U otd