This demonstrates how to test FastAPI endpoints reliant on a PostgreSQL database with Docker.
The following are must be installed to run the backend:
- Python 3.11
- pipenv (pip3 install pipenv)
- Install dependancies:
make install
- Activate Environment:
make activate
- To start the Uvicorn server in development mode:
make run
- Remove the database and start the Uvicorn server in development mode:
make clean-run
- Generate the requirements for the project:
make generate_requirements_txt
- Run local tests:
make test
- Get test coverage:
make test-coverage