https://github.com/whchi/yet-another-fastapi-rw-example
with sqlmodel and alembic for database-related usage
https://github.com/whchi/yet-another-fastapi-rw-example
alembic fastapi python sqlmodel
Last synced: 3 months ago
JSON representation
with sqlmodel and alembic for database-related usage
- Host: GitHub
- URL: https://github.com/whchi/yet-another-fastapi-rw-example
- Owner: whchi
- License: mit
- Created: 2022-12-12T14:41:34.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-03-10T04:04:07.000Z (over 1 year ago)
- Last Synced: 2025-01-14T11:14:27.332Z (5 months ago)
- Topics: alembic, fastapi, python, sqlmodel
- Language: Python
- Homepage:
- Size: 42 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# installation
```shell
# install poetry
poetry install --no-root# database
docker-compose up
```# main concept
```shell
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
* [https://github.com/Flaiers/fastapi-clean-architecture](https://github.com/Flaiers/fastapi-clean-architecture)
* [https://github.com/NEONKID/fastapi-ddd-example](https://github.com/NEONKID/fastapi-ddd-example)
* [https://github.com/iktakahiro/dddpy](https://github.com/iktakahiro/dddpy)
* [https://github.com/art049/fastapi-odmantic-realworld-example](https://github.com/art049/fastapi-odmantic-realworld-example)
* [https://github.com/nsidnev/fastapi-realworld-example-app](https://github.com/nsidnev/fastapi-realworld-example-app)