FastAPI project scaffolding tool
Project description
FastScaff
FastAPI project scaffolding tool - quickly create standardized FastAPI project structures.
Features
- One-click creation of standardized FastAPI project structure
- Multiple ORM support (Tortoise ORM / SQLAlchemy)
- Built-in JWT authentication
- Structured logging with structlog
- Unified exception handling
- Docker deployment support
- Testing framework integration
- SQLite by default (zero configuration)
Installation
# Install from source
cd FastScaff
pip install -e .
# Or install dependencies directly
pip install -r requirements.txt
Quick Start
Create a New Project
# Using SQLAlchemy (with SQLite by default)
fastscaff new myproject --orm sqlalchemy
# Using Tortoise ORM
fastscaff new myproject --orm tortoise
# Specify output directory
fastscaff new myproject --output /path/to/dir
Generated Project Structure
myproject/
├── app/
│ ├── main.py
│ ├── core/
│ │ ├── config.py
│ │ ├── database.py
│ │ ├── logger.py
│ │ ├── lifespan.py
│ │ ├── security.py
│ │ └── redis.py
│ ├── api/
│ │ └── v1/
│ │ ├── router.py
│ │ ├── deps.py
│ │ └── endpoints/
│ ├── models/
│ ├── schemas/
│ ├── repositories/
│ ├── services/
│ ├── middleware/
│ ├── exceptions/
│ └── utils/
├── tests/
├── .env.example
├── Dockerfile
├── docker-compose.yml
├── Makefile
└── requirements.txt
Run the Generated Project
cd myproject
pip install -r requirements.txt
make dev
The project runs out of the box with SQLite - no configuration needed.
CLI Reference
# Show help
fastscaff --help
# Create new project
fastscaff new <project_name>
--orm ORM choice: tortoise or sqlalchemy (default: tortoise)
--output Output directory (default: current directory)
--force Force overwrite existing directory
--with-rbac Enable RBAC with Casbin
# Show version
fastscaff version
Project Layers
| Layer | Directory | Responsibility |
|---|---|---|
| API | api/ |
HTTP request handling, parameter validation |
| Service | services/ |
Business logic, transaction management |
| Repository | repositories/ |
Data access, CRUD operations |
| Model | models/ |
Database table definitions |
| Schema | schemas/ |
Request/response data structures |
Development
# Install dev dependencies
pip install -e ".[dev]"
# Run tests
pytest
# Code formatting
ruff check --fix .
ruff format .
License
MIT
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
fastscaff-0.1.0.tar.gz
(39.7 kB
view details)
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
fastscaff-0.1.0-py3-none-any.whl
(60.2 kB
view details)
File details
Details for the file fastscaff-0.1.0.tar.gz.
File metadata
- Download URL: fastscaff-0.1.0.tar.gz
- Upload date:
- Size: 39.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4b3e80a581c69898200799a573b49a2e7efa87209db0267db5d4ec70584d412e
|
|
| MD5 |
48d9657dc2140aa42e0ce9a0e3d03cbe
|
|
| BLAKE2b-256 |
a53f7b10a56c5c707b37e949b33f5c2aff779be494c6c7b4aa731cf48eb0bd27
|
File details
Details for the file fastscaff-0.1.0-py3-none-any.whl.
File metadata
- Download URL: fastscaff-0.1.0-py3-none-any.whl
- Upload date:
- Size: 60.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
10703b4684a450ca81ff1d2cf9d29e37bd9607b396ad9aed7902efba4aef0049
|
|
| MD5 |
3da98132ebfbac95975db82d28aea496
|
|
| BLAKE2b-256 |
a2cf117c073156a5904f522f5753c489a850179d151c199196f19eead12e5713
|