https://github.com/fastapi-practices/fastapi_best_architecture
FastAPI Best Architecture is an enterprise-grade backend architecture solution built with FastAPI. FastAPI 最佳架构是使用 FastAPI 构建的企业级后端架构解决方案
https://github.com/fastapi-practices/fastapi_best_architecture
fastapi fastapi-admin fastapi-rbac fastapi-sqlalchemy fastapi-template fba pydantic-v2
Last synced: 19 days ago
JSON representation
FastAPI Best Architecture is an enterprise-grade backend architecture solution built with FastAPI. FastAPI 最佳架构是使用 FastAPI 构建的企业级后端架构解决方案
- Host: GitHub
- URL: https://github.com/fastapi-practices/fastapi_best_architecture
- Owner: fastapi-practices
- License: mit
- Created: 2023-04-07T05:21:11.000Z (almost 3 years ago)
- Default Branch: master
- Last Pushed: 2025-05-13T05:16:06.000Z (9 months ago)
- Last Synced: 2025-05-13T06:24:11.355Z (9 months ago)
- Topics: fastapi, fastapi-admin, fastapi-rbac, fastapi-sqlalchemy, fastapi-template, fba, pydantic-v2
- Language: Python
- Homepage: https://fastapi-practices.github.io/fastapi_best_architecture_docs/
- Size: 5.72 MB
- Stars: 1,018
- Watchers: 15
- Forks: 167
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README

# FastAPI Best Architecture
Enterprise-level backend architecture solution
English | [简体中文](./README.zh-CN.md)
[](https://github.com/fastapi-practices/fastapi_best_architecture/blob/master/LICENSE)
[](https://www.python.org/downloads/)



[](https://pydantic.dev)
[](https://github.com/astral-sh/ruff)
[](https://github.com/astral-sh/uv)

[](https://discord.com/invite/yNN3wTbVAC)

[](https://deepwiki.com/fastapi-practices/fastapi_best_architecture)
## Pseudo 3-tier architecture
The mvc architecture is a common design pattern in python web, but the 3-tier architecture is even more fascinating
In python web development, there is no common standard for the concept of 3-tier architecture, so we'll call it a
pseudo 3-tier architecture here
But please note that we don't have a traditional multi-app structure (django, springBoot...) If you don't like this
pattern, use templates to transform it to your heart's content!
| workflow | java | fastapi_best_architecture |
|----------------|----------------|---------------------------|
| view | controller | api |
| data transmit | dto | schema |
| business logic | service + impl | service |
| data access | dao / mapper | crud |
| model | model / entity | model |
## Help
For more details, please check
the [official documentation](https://fastapi-practices.github.io/fastapi_best_architecture_docs/)
## Contributors
## Special thanks
- [FastAPI](https://fastapi.tiangolo.com/)
- [Pydantic](https://docs.pydantic.dev/latest/)
- [SQLAlchemy](https://docs.sqlalchemy.org/en/20/)
- [Casbin](https://casbin.org/zh/)
- [Ruff](https://beta.ruff.rs/docs/)
- ...
## Interactivity
[Discord](https://wu-clan.github.io/homepage/)
## Sponsor us
If this program has helped you, you can sponsor us with some coffee
beans: [:coffee: Sponsor :coffee:](https://wu-clan.github.io/sponsor/)
## License
This project is licensed by the terms of
the [MIT](https://github.com/fastapi-practices/fastapi_best_architecture/blob/master/LICENSE) license
[](https://starchart.cc/fastapi-practices/fastapi_best_architecture)