Skip to main content

Interactive CLI to scaffold FastAPI projects with database, auth, admin, and more

Project description

fastapi-smith

PyPI version Python 3.10+ License: MIT CI Documentation

Interactive CLI to scaffold production-ready FastAPI projects with database, authentication, admin panel, and more.

๐Ÿ“š Full Documentation

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

fastapi_smith-0.2.2.tar.gz (37.3 kB view details)

Uploaded Source

Built Distribution

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

fastapi_smith-0.2.2-py3-none-any.whl (49.6 kB view details)

Uploaded Python 3

File details

Details for the file fastapi_smith-0.2.2.tar.gz.

File metadata

  • Download URL: fastapi_smith-0.2.2.tar.gz
  • Upload date:
  • Size: 37.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for fastapi_smith-0.2.2.tar.gz
Algorithm Hash digest
SHA256 b5915baf52877cc531e1b1f39e53d3361445bd4d2b04217aea3d116909b6d2e6
MD5 1cae75eb9a6d6cb8a89ca3e6cd0a896f
BLAKE2b-256 bad02856f0fc98032ca865483ff8b5c056a0e1234882a1395aa6f01a18ecfe4a

See more details on using hashes here.

Provenance

The following attestation bundles were made for fastapi_smith-0.2.2.tar.gz:

Publisher: release.yml on dhruvbhavsar0612/fastsql-project-setup

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file fastapi_smith-0.2.2-py3-none-any.whl.

File metadata

  • Download URL: fastapi_smith-0.2.2-py3-none-any.whl
  • Upload date:
  • Size: 49.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for fastapi_smith-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 e77234f04205155c7dc15ad720ebc720f7d44bea2928daa8a4cdb08e7fe1f14f
MD5 429c0666c1bbd05b42002f3bc99a5b88
BLAKE2b-256 b649edb0eafb44c49ab28d8ae745cc52be1c92e8780e03046f6830c29f64f718

See more details on using hashes here.

Provenance

The following attestation bundles were made for fastapi_smith-0.2.2-py3-none-any.whl:

Publisher: release.yml on dhruvbhavsar0612/fastsql-project-setup

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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