Note
This repository as a template library open to any person or enterprise can be used for free!
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 |
- Global FastAPI PEP 593 Annotated parameter style
- Comprehensive async/await + asgiref asynchronous design
- Adheres to RESTful API specifications
- Uses SQLAlchemy 2.0 with new syntax
- Uses Pydantic v2 version
- Implements role-menu RBAC access control
- Integrates Casbin RBAC access control
- Supports Celery asynchronous tasks
- Custom-developed JWT authentication middleware
- Supports global custom time zones
- Supports Docker / Docker-compose deployment
- Integrates Pytest unit testing
- User Management: Assign roles and permissions
- Department Management: Configure organizational structure (company, department, team, etc.)
- Menu Management: Set up menus and button-level permissions
- Role Management: Configure roles, assign menus and permissions
- Dictionary Management: Maintain common parameters and configurations
- Parameter Management: Dynamically configure commonly used system parameters
- Notification Announcements: Publish and maintain system notification and announcement information
- Token Management: Detect online status, support forced logout
- Multi-device Login: Support one-click switching between multi-device login modes
- OAuth 2.0: Built-in custom-developed OAuth 2.0 authorization login
- Plugin System: Hot-swappable plugin design to reduce coupling
- Scheduled Tasks: Support scheduled, asynchronous tasks, and function calls
- Code Generation: Automatically generate code with preview, write, and download support
- Operation Logs: Record and query normal and abnormal operations
- Login Logs: Record and query normal and abnormal logins
- Cache Monitoring: Query system cache information and command statistics
- Service Monitoring: View server hardware information and status
- API Documentation: Automatically generate online interactive API documentation
For more details, please check the official documentation
If this program has helped you, you can sponsor us with some coffee beans: ☕ Sponsor ☕
This project is licensed by the terms of the MIT license