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
Metadata
Release files for fastapi-smith 0.2.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| fastapi_smith-0.2.2.tar.gz | 37.3 kB | With provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| fastapi_smith-0.2.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 86.9 kB
Release files / fastapi_smith-0.2.2.tar.gz
| Download URL | fastapi_smith-0.2.2.tar.gz |
|---|---|
| Size | 37.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b5915baf52877cc531e1b1f39e53d3361445bd4d2b04217aea3d116909b6d2e6
|
|
BLAKE2b-256 checksum How to use checksums |
bad02856f0fc98032ca865483ff8b5c056a0e1234882a1395aa6f01a18ecfe4a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Feb 27, 2026.
Transparency logRelease files / fastapi_smith-0.2.2-py3-none-any.whl
| Download URL | fastapi_smith-0.2.2-py3-none-any.whl |
|---|---|
| Size | 49.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e77234f04205155c7dc15ad720ebc720f7d44bea2928daa8a4cdb08e7fe1f14f
|
|
BLAKE2b-256 checksum How to use checksums |
b649edb0eafb44c49ab28d8ae745cc52be1c92e8780e03046f6830c29f64f718
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Feb 27, 2026.
Transparency logSecurity for fastapi-smith 0.2.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for fastapi_smith-0.2.2.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Feb 27, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.