Interactive CLI to scaffold FastAPI projects with database, auth, admin, and more
Project description
fastapi-smith
Interactive CLI to scaffold production-ready FastAPI projects with database, authentication, admin panel, and more.
Features
- Interactive prompts - Answer questions to customize your project
- Production-ready - Best practices baked in from the start
- Highly configurable - Choose your database, ORM, auth, and more
- Modern tooling - Ruff, mypy, pre-commit, GitHub Actions
- Docker support - Multi-stage Dockerfile and docker-compose included
Installation
# Using uvx (recommended - no install needed)
uvx fastapi-smith
# Or install globally with uv
uv tool install fastapi-smith
# Or with pip
pip install fastapi-smith
Quick Start
Simply run:
fastapi-smith
Follow the interactive prompts to configure your project. A new directory will be created with your complete FastAPI application.
cd my-project
uv sync
uv run uvicorn app.main:app --reload
Configuration Options
Project Basics
- Project name, description, author
- Python version (3.10, 3.11, 3.12, 3.13)
Database & ORM
| Database | Drivers | ORMs |
|---|---|---|
| PostgreSQL | psycopg3 (async) | SQLAlchemy 2.0, SQLModel |
| MySQL | asyncmy | SQLAlchemy 2.0, SQLModel |
| SQLite | aiosqlite | SQLAlchemy 2.0, SQLModel |
| - | - | Tortoise-ORM (any DB) |
Migrations: Alembic (SQLAlchemy/SQLModel) or Aerich (Tortoise-ORM)
Authentication
- JWT - JSON Web Tokens with refresh tokens
- OAuth2 - Password flow with bearer tokens
- Session - Server-side sessions with cookies
- None - No authentication
Admin Panel
- SQLAdmin - Beautiful admin interface for SQLAlchemy/SQLModel
Caching
- Redis - Distributed caching
- Memcached - High-performance caching
- In-memory - Simple local caching
Message Queue & Background Tasks
| Broker | Task Queues |
|---|---|
| RabbitMQ | Celery, Taskiq |
| Redis | Celery, ARQ, Taskiq |
| - | Built-in BackgroundTasks |
Logging & Monitoring
- Loguru - Modern logging with rich formatting
- structlog - Structured logging for production
- Standard - Python's built-in logging
- Sentry - Error tracking integration
- Health checks - Kubernetes-ready endpoints
Development Tools
| Category | Options |
|---|---|
| Package Manager | uv, pip |
| Linting | Ruff, Black + isort |
| Type Checking | mypy (strict/standard), Pyrefly |
| Testing | Pytest with async support |
| Pre-commit | Automated code quality hooks |
Deployment
- Docker - Multi-stage build with non-root user
- docker-compose - Full stack with DB, Redis, etc.
- GitHub Actions - CI/CD workflows
AWS Integration
- S3 - Object storage with boto3
- SES - Email service
- ECR - Container registry
- ECS - Container orchestration deployment
Project Structure
my-fastapi-app/
├── app/
│ ├── __init__.py
│ ├── main.py # FastAPI application
│ ├── config.py # Settings with pydantic-settings
│ ├── database.py # Database connection & session
│ ├── models/ # SQLAlchemy/SQLModel models
│ ├── schemas/ # Pydantic schemas
│ ├── routes/ # API route handlers
│ ├── services/ # Business logic
│ ├── core/ # Security, logging, caching
│ └── admin/ # SQLAdmin views
├── migrations/ # Alembic migrations
├── tests/ # Pytest tests
├── .github/workflows/ # CI/CD pipelines
├── .env.example # Environment template
├── pyproject.toml # Dependencies & tool config
├── Dockerfile # Multi-stage build
├── docker-compose.yml # Local development stack
└── README.md # Project documentation
Development
# Clone the repo
git clone https://github.com/dhruvbhavsar0612/fastsql-project-setup.git
cd fastsql-project-setup
# Install dependencies
uv sync
# Run locally
uv run fastapi-smith
# Run tests
uv run pytest
# Type checking
uv run mypy src
# Linting
uv run ruff check src
Contributing
Contributions are welcome! Please read our Contributing Guide for details on our code of conduct and the process for submitting pull requests.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Links
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
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_smith-0.1.1.tar.gz.
File metadata
- Download URL: fastapi_smith-0.1.1.tar.gz
- Upload date:
- Size: 34.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f3a577fe0ecb6b32cd5739dced116a3292e8aafa928003c0dc351feecb232225
|
|
| MD5 |
aae1a8adc26368fd7cfcc21c84c05f1d
|
|
| BLAKE2b-256 |
cd044a9f9249cc9ccc53c34d705b4b19c25f57a9facd145405d789f76b08335d
|
Provenance
The following attestation bundles were made for fastapi_smith-0.1.1.tar.gz:
Publisher:
release.yml on dhruvbhavsar0612/fastsql-project-setup
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
fastapi_smith-0.1.1.tar.gz -
Subject digest:
f3a577fe0ecb6b32cd5739dced116a3292e8aafa928003c0dc351feecb232225 - Sigstore transparency entry: 729251269
- Sigstore integration time:
-
Permalink:
dhruvbhavsar0612/fastsql-project-setup@0d714bbc074ee6b4bcb9e571de106a5518687d33 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/dhruvbhavsar0612
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@0d714bbc074ee6b4bcb9e571de106a5518687d33 -
Trigger Event:
push
-
Statement type:
File details
Details for the file fastapi_smith-0.1.1-py3-none-any.whl.
File metadata
- Download URL: fastapi_smith-0.1.1-py3-none-any.whl
- Upload date:
- Size: 48.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d60770e965a96997f65e45889a59f87803545c4601fd725213a49376e9618b57
|
|
| MD5 |
130b777bb0c18a235ac736462e12e56c
|
|
| BLAKE2b-256 |
a24f542a99c2adae949fb02f69b4f754e6ec8dbca95c36c594b6bfbe9244e6cd
|
Provenance
The following attestation bundles were made for fastapi_smith-0.1.1-py3-none-any.whl:
Publisher:
release.yml on dhruvbhavsar0612/fastsql-project-setup
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
fastapi_smith-0.1.1-py3-none-any.whl -
Subject digest:
d60770e965a96997f65e45889a59f87803545c4601fd725213a49376e9618b57 - Sigstore transparency entry: 729251281
- Sigstore integration time:
-
Permalink:
dhruvbhavsar0612/fastsql-project-setup@0d714bbc074ee6b4bcb9e571de106a5518687d33 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/dhruvbhavsar0612
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@0d714bbc074ee6b4bcb9e571de106a5518687d33 -
Trigger Event:
push
-
Statement type: