Skip to main content

A modern FastAPI project scaffolding CLI tool

Project description

Forge Logo

PyPI version Python Versions Downloads License: MIT


Forge is a powerful command-line tool that helps you quickly bootstrap production-ready FastAPI projects with best practices, intelligent defaults, and a beautiful interactive interface.

โœจ Features

  • ๐ŸŽจ Beautiful Interactive UI - Stunning terminal interface with gradient colors
  • ๐Ÿ—„๏ธ Multiple Databases - PostgreSQL, MySQL, SQLite with SQLModel/SQLAlchemy
  • ๐Ÿ” Authentication Ready - Complete JWT auth with email verification & password reset
  • ๐Ÿ”ด Redis & Celery - Background tasks, caching, and message queues
  • ๐Ÿณ Docker Ready - Production-ready containerization with Docker Compose
  • ๐Ÿงช Testing Setup - pytest with async support and coverage
  • ๐Ÿ“š Auto Documentation - Swagger UI and ReDoc
  • ๐Ÿ› ๏ธ Dev Tools - Black, Ruff, and development utilities
  • โšก Async First - Optimized for FastAPI's async capabilities

๐Ÿš€ Quick Start

Installation

pip install ningfastforge

Create Your First Project

forge init forge-project

Follow the interactive prompts to configure your project with:

  • Database choice (PostgreSQL/MySQL/SQLite)
  • Authentication system (Complete/Basic JWT)
  • Redis & Celery for background tasks
  • CORS, testing, Docker setup

Run Your Project

cd forge-project
uv sync  # or pip install -e .
uv run uvicorn app.main:app --reload

Visit http://127.0.0.1:8000/docs for your API documentation!

๐ŸŽฏ Configuration Options

Database Support

  • PostgreSQL (Recommended) - Production-ready with full features
  • MySQL - Popular choice with excellent performance
  • SQLite - Perfect for development and small projects

Authentication & Security

  • Complete JWT Auth - Email verification, password reset, refresh tokens
  • Basic JWT Auth - Simple login/register system
  • Security Features - CORS, rate limiting, input validation, password hashing

Background Tasks & Caching

  • Redis - Caching, sessions, and message broker
  • Celery - Background task processing with automatic database backups
  • Scheduled Tasks - Cron-based scheduling for production

Development & Deployment

  • Testing - pytest with async support and coverage reporting
  • Code Quality - Black formatter and Ruff linter
  • Docker - Complete containerization with docker-compose
  • API Documentation - Auto-generated Swagger UI and ReDoc for your APIs

๐Ÿ“ Generated Project Structure

forge-project/
โ”œโ”€โ”€ app/
โ”‚   โ”œโ”€โ”€ __init__.py
โ”‚   โ”œโ”€โ”€ main.py              # FastAPI application entry point
โ”‚   โ”œโ”€โ”€ core/                # Core configurations
โ”‚   โ”‚   โ”œโ”€โ”€ config/          # Settings management modules
โ”‚   โ”‚   โ”œโ”€โ”€ database/        # Database connection managers
โ”‚   โ”‚   โ”œโ”€โ”€ celery.py        # Celery configuration (if enabled)
โ”‚   โ”‚   โ”œโ”€โ”€ redis.py         # Redis client (if enabled)
โ”‚   โ”‚   โ”œโ”€โ”€ deps.py          # Dependency injection
โ”‚   โ”‚   โ”œโ”€โ”€ logger.py        # Logging configuration
โ”‚   โ”‚   โ””โ”€โ”€ security.py      # Authentication & security
โ”‚   โ”œโ”€โ”€ models/              # Database models (SQLModel/SQLAlchemy)
โ”‚   โ”œโ”€โ”€ schemas/             # Pydantic schemas for API validation
โ”‚   โ”œโ”€โ”€ crud/                # Database CRUD operations
โ”‚   โ”œโ”€โ”€ routers/             # API route definitions
โ”‚   โ”‚   โ””โ”€โ”€ v1/              # API version 1 endpoints
โ”‚   โ”œโ”€โ”€ services/            # Business logic layer
โ”‚   โ”œโ”€โ”€ tasks/               # Celery background tasks (if enabled)
โ”‚   โ”œโ”€โ”€ utils/               # Utility functions
โ”‚   โ””โ”€โ”€ decorators/          # Custom decorators (rate limiting, etc.)
โ”œโ”€โ”€ tests/                   # Test suite
โ”‚   โ”œโ”€โ”€ conftest.py          # Pytest configuration
โ”‚   โ”œโ”€โ”€ test_main.py         # Main application tests
โ”‚   โ”œโ”€โ”€ api/                 # API endpoint tests
โ”‚   โ””โ”€โ”€ unit/                # Unit tests
โ”œโ”€โ”€ alembic/                 # Database migrations (if enabled)
โ”‚   โ”œโ”€โ”€ versions/            # Migration files
โ”‚   โ”œโ”€โ”€ env.py               # Alembic environment
โ”‚   โ””โ”€โ”€ alembic.ini          # Alembic configuration
โ”œโ”€โ”€ static/                  # Static files
โ”‚   โ””โ”€โ”€ email_template/      # Email templates (if auth enabled)
โ”œโ”€โ”€ script/                  # Custom scripts
โ”œโ”€โ”€ secret/                  # Environment configuration
โ”‚   โ”œโ”€โ”€ .env.example         # Environment template
โ”‚   โ”œโ”€โ”€ .env.development     # Development settings
โ”‚   โ””โ”€โ”€ .env.production      # Production settings
โ”œโ”€โ”€ docker-compose.yml       # Multi-service deployment
โ”œโ”€โ”€ Dockerfile               # Container configuration
โ”œโ”€โ”€ .dockerignore            # Docker ignore rules
โ”œโ”€โ”€ .gitignore               # Git ignore rules
โ”œโ”€โ”€ pyproject.toml           # Project dependencies and metadata
โ”œโ”€โ”€ LICENSE                  # MIT license
โ””โ”€โ”€ README.md                # Project documentation

๐Ÿณ Docker Deployment

For projects with Redis, Celery, or external databases:

# Production deployment with all services
docker-compose up --build

# Run in background
docker-compose up -d --build

This starts:

  • FastAPI application (port 8000)
  • Database (MySQL/PostgreSQL)
  • Redis (if enabled)
  • Celery worker & beat (if enabled)
  • Automatic database migrations

๐Ÿ› ๏ธ Commands

Create New Project

forge init <project-name>     # Interactive mode
forge init forge-project --no-interactive  # Use defaults

Check Version

forge --version

๐Ÿ“š Generated Project Features

Once your project is running, you'll have access to:

๐ŸŽฏ Best Practices

Recommended Stack

forge init forge-project
# Choose: PostgreSQL + SQLModel + Complete JWT + Redis + Celery + Docker

Simple API

forge init simple-project
# Choose: SQLite + SQLModel + Basic JWT + No Redis + No Docker

๐Ÿ“ License

MIT License

๐Ÿ™ Acknowledgments

Built with โค๏ธ using:

  • FastAPI - Modern, fast web framework
  • SQLModel - SQL databases with type safety
  • Pydantic - Data validation
  • Rich - Beautiful terminal output

Need help? Check out the full documentation or open an issue on GitHub.

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

ningfastforge-0.1.8.1.tar.gz (114.9 kB view details)

Uploaded Source

Built Distribution

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

ningfastforge-0.1.8.1-py3-none-any.whl (124.6 kB view details)

Uploaded Python 3

File details

Details for the file ningfastforge-0.1.8.1.tar.gz.

File metadata

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

File hashes

Hashes for ningfastforge-0.1.8.1.tar.gz
Algorithm Hash digest
SHA256 eca70130c1d55f6250d8f28c51f30ecf2962f8e52dbe2cd8b9c8d98701c6c3d7
MD5 30165b7fa5a97944d1617c994b306aa9
BLAKE2b-256 9520322f0f9a8cd8b0edf9d2e4d4c54293059a88a16588f95d42d241fae1824b

See more details on using hashes here.

Provenance

The following attestation bundles were made for ningfastforge-0.1.8.1.tar.gz:

Publisher: publish.yml on ning3739/forge

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

File details

Details for the file ningfastforge-0.1.8.1-py3-none-any.whl.

File metadata

File hashes

Hashes for ningfastforge-0.1.8.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a430621be69fd7098766f8b17238cfd6e157100b0940e0ca870bb4d08d6ec864
MD5 925710edecdef47f4416c1f64f97bfaa
BLAKE2b-256 900d5f08a4c7ba875601528ec9a81ca0be02e08f76b3838cb382ff8dede3089a

See more details on using hashes here.

Provenance

The following attestation bundles were made for ningfastforge-0.1.8.1-py3-none-any.whl:

Publisher: publish.yml on ning3739/forge

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