Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/atpuxiner/fastapi-scaf
This is a fastapi scaf. (fastapi脚手架,一键生成项目或api,让开发变得更简单)
https://github.com/atpuxiner/fastapi-scaf
fastapi fastapi-scaf python
Last synced: 4 days ago
JSON representation
This is a fastapi scaf. (fastapi脚手架,一键生成项目或api,让开发变得更简单)
- Host: GitHub
- URL: https://github.com/atpuxiner/fastapi-scaf
- Owner: atpuxiner
- License: mit
- Created: 2024-07-30T05:45:20.000Z (6 months ago)
- Default Branch: main
- Last Pushed: 2025-01-24T14:35:11.000Z (12 days ago)
- Last Synced: 2025-01-25T10:04:28.740Z (11 days ago)
- Topics: fastapi, fastapi-scaf, python
- Language: Python
- Homepage:
- Size: 99.6 KB
- Stars: 139
- Watchers: 1
- Forks: 2
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# fastapi-scaf
## What is this?
- by: axiner
- fastapi-scaf
- This is a fastapi scaf.
- new project
- add api
- about project:
- auto init project (conf, db, logger...)
- auto register router
- auto register middleware
- ...
- more docs: [请点击链接](https://blog.csdn.net/atpuxiner/article/details/144291336?fromshare=blogdetail&sharetype=blogdetail&sharerId=144291336&sharerefer=PC&sharesource=atpuxiner&sharefrom=from_link)## Project Structure
- ABD: ABD模式
- A api
- B business
- D datatype
- 调用过程: main.py(initializer) - router(middleware) - api - business - (datatype)
- 结构如下: (命名经过多次修改敲定,简洁易懂,ABD目录贴合避免杂乱无章)
```
└── fastapi-scaf
├── app (应用)
│ ├── api ├── (api)
│ │ └── v1 │ └── (v1)
│ ├── business ├── (业务)
│ ├── datatype ├── (数据类型)
│ ├── initializer ├── (初始化)
│ │ ├── conf │ ├── (配置)
│ │ ├── db │ ├── (数据库)
│ │ ├── logger │ ├── (日志)
│ │ └── ... │ └── (...)
│ ├── middleware ├── (中间件)
│ ├── router ├── (路由)
│ ├── utils ├── (utils)
│ └── main.py └── (main.py)
├── config (配置目录)
├── deploy (部署目录)
├── docs (文档目录)
├── log (日志目录)
├── .gitignore
├── LICENSE
├── README.md
└── requirements.txt
```## Installation
This package can be installed using pip (Python>=3.11):
> pip install fastapi-scaf## Scaf Usage
- 1)help document
- `fastapi-scaf -h`
- 2)new project
- `fastapi-scaf new `
- 3)add api
- `cd to project root dir`
- `fastapi-scaf add `## 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 main_dev.py`
- production environment: `uvicorn app.main:app --host=0.0.0.0 --port=8000 --log-level=info --log-config=./config/uvicorn_logging.json --workers=5`
- about uvicorn: [www.uvicorn.org](https://www.uvicorn.org/)## LICENSE
This project is released under the MIT License (MIT). See [LICENSE](LICENSE)