A modern FastAPI project scaffolding CLI tool
Project description
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:
- API Documentation: http://127.0.0.1:8000/docs (Swagger UI)
- Alternative Docs: http://127.0.0.1:8000/redoc (ReDoc)
- Health Check: http://127.0.0.1:8000/health
๐ฏ 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
๐ 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
Release history Release notifications | RSS feed
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 ningfastforge-0.1.8.3.tar.gz.
File metadata
- Download URL: ningfastforge-0.1.8.3.tar.gz
- Upload date:
- Size: 115.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a5b76eb520c46080b6b8c1a61bfd6311750ff590237a94aad4b3c5f3006782e9
|
|
| MD5 |
d29c285a56fa8513575d2f30ae89fd8c
|
|
| BLAKE2b-256 |
909d2f146fe0b5da009a7637533cddb024b34343187ad64fe773d3bb710351e2
|
Provenance
The following attestation bundles were made for ningfastforge-0.1.8.3.tar.gz:
Publisher:
publish.yml on ning3739/forge
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ningfastforge-0.1.8.3.tar.gz -
Subject digest:
a5b76eb520c46080b6b8c1a61bfd6311750ff590237a94aad4b3c5f3006782e9 - Sigstore transparency entry: 830871195
- Sigstore integration time:
-
Permalink:
ning3739/forge@488047deda3da30f5cc0acd861ad6533973f244e -
Branch / Tag:
refs/heads/main - Owner: https://github.com/ning3739
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@488047deda3da30f5cc0acd861ad6533973f244e -
Trigger Event:
push
-
Statement type:
File details
Details for the file ningfastforge-0.1.8.3-py3-none-any.whl.
File metadata
- Download URL: ningfastforge-0.1.8.3-py3-none-any.whl
- Upload date:
- Size: 124.6 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 |
67a9d1f94d9ee13ebcf761606cd6809ae2d840b2d838624b6946714443496cc9
|
|
| MD5 |
ab686a3e1b632b0e737c32fc3bdc7640
|
|
| BLAKE2b-256 |
4d10f09d0130a201a1e9537fcef8426f1d9b1ce514b774852bb148317369f273
|
Provenance
The following attestation bundles were made for ningfastforge-0.1.8.3-py3-none-any.whl:
Publisher:
publish.yml on ning3739/forge
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ningfastforge-0.1.8.3-py3-none-any.whl -
Subject digest:
67a9d1f94d9ee13ebcf761606cd6809ae2d840b2d838624b6946714443496cc9 - Sigstore transparency entry: 830871207
- Sigstore integration time:
-
Permalink:
ning3739/forge@488047deda3da30f5cc0acd861ad6533973f244e -
Branch / Tag:
refs/heads/main - Owner: https://github.com/ning3739
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@488047deda3da30f5cc0acd861ad6533973f244e -
Trigger Event:
push
-
Statement type: