fastapi-practices/fastapi_best_architecture

✨ New backend architecture

wu-clan opened this issue · 1 comments

Original architecture

fba
 ├─ backend
 |     ├─ app
 |     |   ├─ alembic
 |     |   ├─ api
 |     |   ├─ common
 |     |   ├─ core
 |     |   ├─ crud
 |     |   ├─ database
 |     |   ├─ middleware
 |     |   ├─ models
 |     |   ├─ schemas
 |     |   ├─ services
 |     |   ├─ static
 |     |   ├─ tests
 |     |   ├─ utils
 |     |   └─ main.py
 |     └─ sql
 └─ ... 

New architecture

fba
 ├─ backend
 |     ├─ alembic
 |     ├─ app
 |     |   ├─ admin
 |     |   |    ├─ api
 |     |   |    ├─ crud
 |     |   |    ├─ model
 |     |   |    ├─ schema
 |     |   |    ├─ service
 |     |   |    ├─ tests
 |     |   |    └─ ...
 |     |   └─ ...
 |     ├─ common
 |     ├─ core
 |     ├─ database
 |     ├─ middleware
 |     ├─ static
 |     ├─ utils
 |     └─ sql
 └─ ... 

In order to adapt to the continuous expansion of the back-end service, the new architecture splits the service, and the original architecture will be sealed as a locked branch.

The architecture may still change before this PR can be reviewed, and this refactoring will be the final fixed version of this repository architecture, which in my opinion is more conducive to the implementation of automatic code generators (we have been waiting for too long)