Skip to main content

fastapi-scaff

What is this?

  • by: axiner
  • fastapi-scaff
  • This is a fastapi scaff.
    • new project
    • add api
    • tpl template
    • about project:
      • auto init project (conf, db, log...)
      • auto register router
      • auto add middleware/exceptions
      • integrated api-key/jwt
      • integrated sqlalchemy
      • integrated migration
      • integrated celery
      • integrated docker
      • ...
    • more documents: 请点击链接

Project template

  • Architecture: ASM

    • A api
    • S services
    • M models
  • Flow: main.py(app) - core(middleware) - api - services - models

  • Layout:

    • The naming has been finalized after multiple revisions, making it concise and easy to understand.
    • Some modules are integrated via the following methods:
      • Flexibly enable modules (database, loguru, redis, etc.) through parameters when creating a project with new.
      • Easily integrate templates (celery, docker, swarm, etc.) into existing projects using the tpl command.
    └── fastapi-scaff
        ├── app                         (应用)
        │   ├── api                     ├── (接口)
        │   │   └── v1                  │   └── (版本1)
        │   ├── core                    ├── (基础)
        │   │   ├── conf                │   ├── (配置)
        │   │   ├── db                  │   ├── (数据库)
        │   │   ├── log                 │   ├── (日志)
        │   │   └── ...                 │   └── (...)
        │   ├── models                  ├── (数据模型)
        │   ├── services                ├── (业务逻辑)
        │   ├── utils                   ├── (工具集)
        │   └── main.py                 └── (主入口)
        ├── app_celery                  (应用-异步任务)
        ├── config                      (配置目录)
        ├── docs                        (文档目录)
        ├── tests                       (测试目录)
        ├── .dockerignore
        ├── .gitignore
        ├── .python-version
        ├── docker-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)

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 dir
    • fastapi-scaff add <myapi>
  • x)integrated celery
    • New project: fastapi-scaff new <myproj> --celery
    • Existing project: fastapi-scaff tpl celery -p <mycelery>

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
  • x)migration
    • create project with migration support: fastapi-scaff new <myproj> --migration
    • execution commands (run before server startup):
      • generate: python runmigration.py generate init
      • upgrade: python runmigration.py upgrade
    • about alembic: click here
  • x)docker
    • project files:
      • Dockerfile*
      • docker-build.sh (default Dockerfile)
      • docker-compose.yaml
    • about docker: click here

License

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


☕ 请我喝咖啡

享受开源,也感谢支持。

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

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.12.5-py3-none-any.whl (83.5 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for fastapi_scaff-0.12.5-py3-none-any.whl
Algorithm Hash digest
SHA256 fa64acf6e24f2f944b341cfd409d3bb9ecbdbd4a7c5289923fae3b4ad4789cdd
MD5 495962eec104f82ba45eeac3ad9cbbb4
BLAKE2b-256 78d6a80514fdb63b72f497991d9651731fb366f499d0783128c79ce18c1ea593

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.12.5 This release

1 file

0.12.4

1 file

0.12.3

1 file

0.12.2

1 file

0.12.1

1 file

0.12.0

1 file

0.11.3

1 file

0.11.2

1 file

0.11.1

1 file

0.11.0

1 file

0.10.5

1 file

0.10.4

1 file

0.10.3

1 file

0.10.2

1 file

0.10.1

1 file

0.10.0

1 file

0.9.9

1 file

0.9.8

1 file

0.9.7

1 file

0.9.6

1 file

0.9.5

1 file

0.9.4

1 file

0.9.3

1 file

0.9.2

1 file

0.9.1

1 file

0.9.0

1 file

0.8.3

1 file

0.8.2

1 file

0.8.1

1 file

0.8.0

1 file

0.7.2

1 file

0.7.1

1 file

0.7.0

1 file

0.6.4

1 file

0.6.3

1 file

0.6.2

1 file

0.6.1

1 file

0.6.0

1 file

0.5.8

1 file

0.5.7

1 file

0.5.6

1 file

0.5.5

1 file

0.5.4

1 file

0.5.3

1 file

0.5.2

1 file

0.5.1

1 file

0.5.0

1 file

0.4.4

1 file

0.4.3

1 file

0.4.2

1 file

0.4.1

1 file

0.4.0

1 file

0.3.4

1 file

0.3.3

1 file

0.3.2

1 file

0.3.1

1 file

0.3.0

1 file

0.2.6

1 file

0.2.5

1 file

0.2.4

1 file

0.2.3

1 file

0.2.2

1 file

0.2.1

1 file

0.2.0

1 file

0.1.5

1 file

0.1.4

1 file

0.1.3

1 file

0.1.2

1 file

0.1.1

1 file

0.1.0

1 file

0.0.5

1 file

0.0.4

1 file

0.0.3

1 file

0.0.2

1 file

0.0.1

1 file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page