Skip to main content

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 sqlalchemy
      • integrated jwt\api-key
      • integrated celery
      • integrated docker deployment
      • ...
    • about structure:
      • standard
      • light
      • tiny
      • single
    • more documents: 请点击链接

Project structure

  • ASM: ASM mode

    • A api
    • S services(&schemas)
    • M models
  • Calling process: main.py(initializer) -> (middleware) - api - services(&schemas) - (models)

  • Structure: (The naming has been finalized after multiple revisions, making it concise and easy to understand)

    └── fastapi-scaff
        ├── app                         (应用)
        │   ├── api                     ├── (api)
        │   │   └── v1                  │   └── (v1)
        │   ├── initializer             ├── (初始化)
        │   │   ├── conf                │   ├── (配置)
        │   │   ├── db                  │   ├── (数据库)
        │   │   ├── log                 │   ├── (日志)
        │   │   └── ...                 │   └── (...)
        │   ├── middleware              ├── (中间件)
        │   ├── models                  ├── (数据模型)
        │   ├── schemas                 ├── (数据结构)
        │   ├── services                ├── (业务逻辑)
        │   ├── utils                   ├── (utils)
        │   └── main.py                 └── (main.py)
        ├── app_celery                  (应用-celery)
        ├── config                      (配置目录)
        ├── docs                        (文档目录)
        ├── logs                        (日志目录)
        ├── tests                       (测试目录)
        ├── .dockerignore
        ├── .gitignore
        ├── .python-version
        ├── build.sh
        ├── docker-compose.yaml
        ├── Dockerfile
        ├── LICENSE
        ├── README.md
        ├── requirements.txt
        └── runserver.py
    
  • 【Other structure】

    • light:Please create and view (with -e light)
    • tiny:Please create and view (with -e tiny)
    • single:Please create and view (with -e single)

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 structure: fastapi-scaff new <myproj> -e light
    • tiny structure: fastapi-scaff new <myproj> -e tiny
    • single structure: fastapi-scaff new <myproj> -e single
  • 3)add api
    • cd to project root dir
    • fastapi-scaff add <myapi>
  • 4)integrated celery
    • M1。new with --celery: fastapi-scaff new <myproj> --celery
    • M2。add with --celery: fastapi-scaff add <mycelery> --celery

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
  • 5)docker, please see:
    • project files:
      • build.sh
      • docker-compose.yaml | docker-compose.swarm.yaml[config/nginx.conf]
      • Dockerfile | Dockerfile.slim
    • more click here

License

This project is released under the MIT License (MIT). See LICENSE


☕ 请我喝咖啡

享受开源,也感谢支持。

如果本项目对您有用,可以考虑 Buy Me a Coffee :)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fastapi_scaff-0.5.7-py3-none-any.whl (70.5 kB view details)

Uploaded Python 3

File details

Details for the file fastapi_scaff-0.5.7-py3-none-any.whl.

File metadata

  • Download URL: fastapi_scaff-0.5.7-py3-none-any.whl
  • Upload date:
  • Size: 70.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.11

File hashes

Hashes for fastapi_scaff-0.5.7-py3-none-any.whl
Algorithm Hash digest
SHA256 b8cb376e5b00dd3fa8ac11ff65a3bf56ad5f8792a84c11767153d3e50e6e6353
MD5 208184082d47f9f9169d294d9f5fa7b9
BLAKE2b-256 b4d63560bee2447549012c2df4d6370f279e95d2c6a4c244217bbb7ee0f33f1f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page