# 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
Logo 包含了 FBA 三个字母抽象结合,形成了一个类似从地面扩散投影上来的闪电 # FastAPI Best Architecture 企业级后端架构解决方案 简体中文 | [English](./README.md) [![GitHub](https://img.shields.io/github/license/fastapi-practices/fastapi_best_architecture)](https://github.com/fastapi-practices/fastapi_best_architecture/blob/master/LICENSE) [![Python](https://img.shields.io/badge/python-3.10%2B-blue)](https://www.python.org/downloads/) ![MySQL](https://img.shields.io/badge/MySQL-8.0%2B-%2300758f) ![PostgreSQL](https://img.shields.io/badge/PostgreSQL-16.0%2B-%23336791) ![SQLAlchemy](https://img.shields.io/badge/SQLAlchemy-2.0-%23778877) [![Pydantic v2](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/pydantic/pydantic/main/docs/badge/v2.json)](https://pydantic.dev) [![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff) [![uv](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/uv/main/assets/badge/v0.json)](https://github.com/astral-sh/uv) ![Docker](https://img.shields.io/badge/Docker-%232496ED?logo=docker&logoColor=white) [![Discord](https://img.shields.io/badge/Discord-%235865F2.svg?logo=discord&logoColor=white)](https://discord.com/invite/yNN3wTbVAC) ![Discord](https://img.shields.io/discord/1185035164577972344) [![Ask DeepWiki](https://deepwiki.com/badge.svg)](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) 许可证的条款进行许可 [![Stargazers over time](https://starchart.cc/fastapi-practices/fastapi_best_architecture.svg?variant=adaptive)](https://starchart.cc/fastapi-practices/fastapi_best_architecture)