Skip to content

with sqlmodel and alembic for database-related usage

License

Notifications You must be signed in to change notification settings

whchi/yet-another-fastapi-RW-example

Repository files navigation

installation

# install poetry
poetry install --no-root

# database
docker-compose up

main concept

app/
├── api/                       - api related stuff
│   ├── contexts/              - bounded contexts, add your context here
│   │   └── example/           - domain name
│   │       ├── domain/        - domain models, include exceptions, interfaces and pydanic models
│   │       ├── gateway/       - interface adapter, includes presenter, repository, service...etc
│   │       ├── usecase/       - biz logic
│   │       └── router.py      - router of this domain
│   ├── dependencies/          - any dependencies of router
│   └── router.py              - router of whole app
├── middlewares/               - app middlewares
├── core/                      - core part of app
├── exceptions/                - global custom exception handlers and definitions
├── models/                    - orm models using sqlmodel
└── main.py                    - entrypoint

references