This is a fastapi scaff.
Project description
fastapi-scaff
What is this?
- by: axiner
- fastapi-scaff
- This is a fastapi scaff.
- new project
- add api
- about project:
- auto init project (conf, db, log...)
- auto register router
- auto register middleware
- ...
- integrated api-key/jwt
- integrated sqlalchemy
- integrated migration
- integrated celery
- integrated docker deployment
- ...
- more documents: 请点击链接
Project template
-
Architecture: ASM
- A api
- S services
- M models
-
Flow: main.py(initializer) - (middleware) - api - services - models
-
Layout: (The naming has been finalized after multiple revisions, making it concise and easy to understand)
└── fastapi-scaff ├── app (应用) │ ├── api ├── (接口) │ │ └── v1 │ └── (版本1) │ ├── initializer ├── (初始化) │ │ ├── conf │ ├── (配置) │ │ ├── db │ ├── (数据库) │ │ ├── log │ ├── (日志) │ │ └── ... │ └── (...) │ ├── middleware ├── (中间件) │ ├── migrations ├── (数据库迁移) │ ├── models ├── (数据模型) │ ├── services ├── (业务逻辑) │ ├── utils ├── (工具集) │ └── main.py └── (主入口) ├── app_celery (应用-异步任务) ├── config (配置目录) ├── docs (文档目录) ├── logs (日志目录) ├── tests (测试目录) ├── .dockerignore ├── .gitignore ├── .python-version ├── build.sh ├── docker-compose.yaml ├── Dockerfile ├── LICENSE ├── README.md ├── requirements.txt └── runserver.py -
【Other】
- light:Please create and view (with
-t light) - tiny:Please create and view (with
-t tiny) - single:Please create and view (with
-t single)
- light:Please create and view (with
-
【Tips】Database, Redis, Snowflake and Celery can all be controlled through parameters to integrate or not, allowing you to flexibly customize the functional modules needed for your project.
Installation
This package can be installed using pip (Python>=3.11):
pip install fastapi-scaff
Scaff usage
- 1)help document
fastapi-scaff -h
- 2)new project
fastapi-scaff new <myproj>- light:
fastapi-scaff new <myproj> -t light - tiny:
fastapi-scaff new <myproj> -t tiny - single:
fastapi-scaff new <myproj> -t single
- 3)add api
cd to project root dirfastapi-scaff add <myapi>
- 4)integrated celery
- M1。
newwith--celery:fastapi-scaff new <myproj> --celery - M2。
addwith--celery:fastapi-scaff add <mycelery> --celery
- M1。
Project run
- 1)cd to project root dir
- 2)modify the configuration, such as for the database
- 3)
pip install -r requirements.txt - 4)
python runserver.py- more parameters see:
- about uvicorn: click here
- about gunicorn: click here
- more parameters see:
- x)migration
- eg (Can be executed before runserver):
- generate:
python runmigration.py generate init - upgrade:
python runmigration.py upgrade
- generate:
- about alembic: click here
- eg (Can be executed before runserver):
- x)docker, please see:
- project files:
- build.sh
- docker-compose.yaml | docker-compose.swarm.yaml[config/nginx.conf]
- Dockerfile | Dockerfile.slim
- about docker: click here
- project files:
License
This project is released under the MIT License (MIT). See LICENSE
☕ 请我喝咖啡
享受开源,也感谢支持。
如果本项目对您有用,可以考虑 Buy Me a Coffee :)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file fastapi_scaff-0.9.8-py3-none-any.whl.
File metadata
- Download URL: fastapi_scaff-0.9.8-py3-none-any.whl
- Upload date:
- Size: 76.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ab632ab9dd1622431ef42d57bc9deb815c368d6f9461a1df97941a8219ccd695
|
|
| MD5 |
c38b8a21c9eb94ee534c1844bff603e1
|
|
| BLAKE2b-256 |
862e67feb566601aaefd2c1c25270949b45e3f6d8bc7c64ef4e66c98794b7643
|