# fastapi_best_architecture
**Repository Path**: fastapi-practices/fastapi_best_architecture
## Basic Information
- **Project Name**: fastapi_best_architecture
- **Description**: FastAPI 最佳架构是使用 FastAPI 构建的企业级后端架构解决方案
- **Primary Language**: Python
- **License**: MIT
- **Default Branch**: master
- **Homepage**: https://fastapi-practices.github.io/fastapi_best_architecture_docs/
- **GVP Project**: No
## Statistics
- **Stars**: 24
- **Forks**: 11
- **Created**: 2023-04-19
- **Last Updated**: 2025-06-16
## Categories & Tags
**Categories**: Uncategorized
**Tags**: FastAPI, sqlalchemy, pydantic, 后台管理系统
## README

# FastAPI Best Architecture
企业级后端架构解决方案
简体中文 | [English](./README.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)
## 伪三层架构
mvc 架构作为常规设计模式,在 python web 中也很常见,但是三层架构更令人着迷
在 python web 开发中,三层架构的概念并没有通用标准,所以这里我们称之为伪三层架构
但请注意,我们并没有传统的多应用程序结构(django、springBoot...),如果您不喜欢这种模式,可以使用模板对其进行随意改造!
| 工作流程 | java | fastapi_best_architecture |
|------|----------------|---------------------------|
| 视图 | controller | api |
| 数据传输 | dto | schema |
| 业务逻辑 | service + impl | service |
| 数据访问 | dao / mapper | crud |
| 模型 | model / entity | model |
## 帮助
更多详情请查看 [官方文档](https://fastapi-practices.github.io/fastapi_best_architecture_docs/)
## 贡献者
## 特别鸣谢
- [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/)
- ...
## 互动
[Discord](https://wu-clan.github.io/homepage/)
## 赞助我们
如果此项目能够帮助到你,你可以赞助作者一些咖啡豆表示鼓励:[:coffee: Sponsor :coffee:](https://wu-clan.github.io/sponsor/)
## 许可证
本项目由 [MIT](https://github.com/fastapi-practices/fastapi_best_architecture/blob/master/LICENSE) 许可证的条款进行许可
[](https://starchart.cc/fastapi-practices/fastapi_best_architecture)