FastForge is a powerful, Symfony-style CLI scaffolder designed to bootstrap and accelerate the development of FastAPI applications. It provides a robust, production-ready directory structure, fully integrated with uv for lightning-fast package management, alongside essential utilities like rate limiting, scheduling, WebSocket management, and JWT middleware.
- Rapid Scaffolding: Generate full FastAPI projects with a single command.
- Entity Generation: Automatically create models, schemas, controllers, and routers for your database entities.
- AI Service Integration: Instantly scaffold RAG, Agentic, and OCR services powered by LLMs (OpenAI, Anthropic, Mistral, Azure).
- dbt Support: Built-in commands to initialize and manage analytical engineering pipelines.
- Data Sync: Generate ELT scripts to sync NoSQL databases (like MongoDB) to relational databases (like PostgreSQL).
- Production-Ready: Includes pre-configured JWT middleware, rate limiting (slowapi), background scheduling (apscheduler), and WebSockets.
Since FastForge manages virtual environments and dependencies via uv, you should install it globally using uv tool:
uv tool install fast-stack-forge(Alternatively, you can install from source: uv tool install git+https://github.com/SavanTech25/fast-stack-forge.git)
To bootstrap a new project, use the init command. You can specify your preferred database engine (sqlite, postgresql, mysql, or mongodb).
fast-stack-forge init my_project --db mongodbThis will create a structured FastAPI project that utilizes pyproject.toml and a Makefile for streamlined development.
Navigate into your generated project and install dependencies:
cd my_project
make install
source .venv/bin/activateStart the development server:
make runFastForge features a make:entity command that automatically generates your boilerplate code for a given entity. Make sure you run this from the root of your newly created project!
fast-stack-forge make:entity User name:string age:int email:string:hash is_active:boolField Syntax: name:type[:modifier]
- Types:
string,int,float,bool,text,date,datetime - Modifiers:
encrypt,hash,nullable,fk=ModelName
FastForge now includes native scaffolding for analytical engineering via dbt!
To initialize a complete dbt project package inside your src/ directory:
fast-stack-forge init:etl my_dbt_project --archi medallion --connector local--archi: Choosedefault(stg, int, mart),medallion(bronze, silver, gold), orstar(raw, dim, fact).--connector: Chooselocal(DuckDB),snowflake,bigquery, orpostgres.
To quickly scaffold a dbt model inside your project without boilerplate:
fast-stack-forge make:dbt fact_user --view --incremental --layer silver--view: Sets materialization toview.--incremental: Configures incremental logic automatically.
FastForge includes a powerful make:service command that instantly scaffolds production-ready AI services (RAG, Agents, OCR) connected directly to your FastAPI routes.
fast-stack-forge make:service DocumentOCR --type ocr --provider azureOptions:
--type: Chooserag(Retrieval-Augmented Generation),agent(Tool-calling Agent),agentic(Workflow State Graph), orocr(Vision Extraction).--provider: Chooseopenai,anthropic,mistral,gemini, orazure.--vector-store: (Forragtype only). Choosechroma(Local),qdrant(Cloud/Docker), orsupabase(PostgreSQL/pgvector). Defaults tochroma.
Example: Building a fully-functional RAG service with Qdrant and OpenAI
fast-stack-forge make:service HelpdeskBot --type rag --provider openai --vector-store qdrantThis generates the HelpdeskBotService integrated with langchain-openai, langchain-qdrant, and automatically exposes a POST /helpdeskbot endpoint with JWT authentication in your FastAPI app!
To support the standard dbt architecture (where your operational database needs to be replicated to your analytical database), you can use the make:sync command.
fast-stack-forge make:sync MongoToPg --source mongodb --dest postgresThis scaffolds a pure-Python sync script utilizing pymongo, pandas, and sqlalchemy. The generated script handles flattening NoSQL documents and automatically syncing them to PostgreSQL, with built-in APScheduler boilerplate for continuous execution.
When you initialize a project with FastForge, it generates a clean, modular structure.
(Note: PyPI does not support Mermaid diagrams natively, so here is the ASCII representation of the architecture)
my_project/
├── Makefile
├── pyproject.toml
├── README.md
├── app/
│ └── main.py <-- FastAPI entry point, imports db & limiter
└── src/
└── my_project/
├── controller/ <-- Business logic
├── data/ <-- database.py
├── entity/ <-- ORM Models
├── middleware/ <-- middleware.py (JWTBearer)
├── router/ <-- API Routes
├── schema/ <-- Pydantic Models
├── service/ <-- Generated AI Services
└── utils/
├── connection_manager.py
├── crud_router.py
├── limiter.py
└── scheduling.py
app/main.py: The main FastAPI entry point. It handles lifecycle events (connecting to the database, starting schedulers) and attaches rate limiters.src/{project_name}/: Your primary application package, automatically recognized bypyproject.tomlanduv.entity/: Database models (SQLAlchemy or motor/MongoDB depending on yourinitchoice).schema/: Pydantic models for validation and serialization.controller/: Business logic and database interaction functions.router/: API route definitions, connected to your controllers.data/: Database configuration and connection setup.middleware/: Contains pre-configuredJWTBearermiddleware for instant authentication handling.utils/:limiter.py: Pre-configuredslowapirate limiting.scheduling.py: Asynchronous background task scheduler viaapscheduler.connection_manager.py: Generic WebSocket manager.crud_router.py: A generic factory for building standard CRUD routes effortlessly.
Contributions are welcome! Feel free to open an issue or submit a pull request if you have ideas for new features or improvements.
This project is licensed under the MIT License.