An example of a API build with FastAPI.
Project Highlights:
- FastAPI
- Docker
- PostgreSQL
- Alembic
- Unit tests
- JWT Authentication
- Install dependencies inside the
backendfolder:
uv venv && uv sync- Create a .env file in the same directory as .env-example.
- Build and run the project with Docker (you may need to use
sudo):
docker compose build && docker compose up- To run tests inside a Docker container, use this (again, you may need
sudo):
bash scripts/test.sh- Run db migrations within a running Docker container with the backend:
alembic upgrade head- Use private endpoints to create users.
- To set up pre-commit hooks, use this:
pre-commit install