This repository is to be used as a starter for FastAPI based Python applications.
- Python3.12+
- Poetry for project management
- Docker for image builds (use
--target runtime-image
)
.
├── app # Contains code base.
│ ├── apps # Contains python subpackages for each registered app
│ ├── `app_name`
│ │ ├── api # Contains API endpoints declaration
│ │ ├── dtos # Contains DTO declarations
│ │ └── use_cases # Contains this app's use cases
│ └── routes.py # Registers all routers from all applications
│ ├── core # Configs and settings, logging, etc
│ └── lib # Contains reusable base/abstract classes, helpers, etc
├── docker # Contains docker related files
├── tests # Tests
└── ...
poetry install
- creates virtualenv and installs project dependenciespoetry lock
- updatespoetry.lock
poetry update
- updates packages locally and updatespoetry.lock
ruff
- runs ruff on a project filestests
- runs testsmypy-lint
- run mypy lintruff-lint
- runs ruff check (to use in CI/CD)format-and-lint
- shortcut to run ruff and mypy