This repo is kind of a template I use when starting up new FastAPI projects:
ruff and ruff formatalembic
YYYY-MM-DD_slug)ruffMacOS:
brew install just
Debian/Ubuntu:
apt install just
Others: link
pip install poetry
Other ways: link
just up
cp .env.example .envpoetry installWith default settings:
just run
With extra configs (e.g. logging file)
just run --log-config logging.ini
Format the code with ruff --fix and ruff format
just lint
src/database.pyjust mm *migration_name*
just migrate
just downgrade -1 # or -2 or base or hash of the migration
Deployment is done with Docker and Gunicorn. The Dockerfile is optimized for small size and fast builds with a non-root user. The gunicorn configuration is set to use the number of workers based on the number of CPU cores.
Example of running the app with docker compose:
docker compose -f docker-compose.prod.yml up -d --build
396 followers · starred Sep 2023
44 followers · starred Mar 2023
152 followers · starred Jan 2024
26 followers · starred Jan 2023
This repo is kind of a template I use when starting up new FastAPI projects:
ruff and ruff formatalembic
YYYY-MM-DD_slug)ruffMacOS:
brew install just
Debian/Ubuntu:
apt install just
Others: link
pip install poetry
Other ways: link
just up
cp .env.example .envpoetry installWith default settings:
just run
With extra configs (e.g. logging file)
just run --log-config logging.ini
Format the code with ruff --fix and ruff format
just lint
src/database.pyjust mm *migration_name*
just migrate
just downgrade -1 # or -2 or base or hash of the migration
Deployment is done with Docker and Gunicorn. The Dockerfile is optimized for small size and fast builds with a non-root user. The gunicorn configuration is set to use the number of workers based on the number of CPU cores.
Example of running the app with docker compose:
docker compose -f docker-compose.prod.yml up -d --build
396 followers · starred Sep 2023
44 followers · starred Mar 2023
152 followers · starred Jan 2024
26 followers · starred Jan 2023