中文文档请查看 README_zh.md
- Basic framework
- Switchable environment configurations
- Automatic code reloading
- SQLAlchemy-based ORM
- Swagger API documentation support
- Logging using the logure framework
- JWT authentication
- RUFF code standards
- One-line command to generate CRUD templates including model, schema, and router
- Complete CI/CD workflow and production environment Docker-compose automatic deployment template
- Using RUFF to standardize code
pip install poetrypoetry installpoetry run apppoetry run app env=dev # Development environment (default)
poetry run app env=prod # Production environmentIn dev environment, the development server will automatically reload the code
! Note: After automatic appending, if you need to undo it, please manually delete the appended code. Do not use Ctrl+Z in the IDE, as it may cause code formatting issues.
poetry run create_crud name={data_model_name} -a # Use `_` as a separator for multi-word names, case-insensitiveFor example:
poetry run create_crud name=example -apoetry run create_crud name={data_model_name} -a # Use `_` as a separator for multi-word names, case-insensitiveFor example:
poetry run create_crud name=exampleIn src/models/__init__.py, import your associated models under # $table_create$:
# $table_create$ 自动创建表追加锚 *请不要修改此行* (Anchor of the table creation line *Do not modify this line*)
from .{data_model_name} import DB{DataModelClassName}In src/app.py, under Mount the router tables, add the router:
from src.routers.{data_model_name} import router as {data_model_name}_router
app.include_router({data_model_name}_router, prefix="/{router_prefix}", tags=["{router_tag}"])Please replace {data_model_name}, {DataModelClassName}, {router_prefix}, and {router_tag} with the appropriate values as needed for your project.