Skip to content

AhmedRaoofuddin/Generator

Repository files navigation

FastAPI Fullstack Generator

Production-Ready FastAPI + Next.js Generator for AI Applications

GitHub Stars License Python Coverage Integrations

Generate enterprise-grade full-stack applications with AI agents, authentication, real-time streaming, and observability in minutes.

Quick StartFeaturesDocumentationExamples


Table of Contents


Overview

FastAPI Fullstack Generator is a powerful CLI tool that scaffolds production-ready full-stack applications with AI capabilities. Built for developers who need enterprise-grade infrastructure without the boilerplate.

Demo & Interface Preview

Generator in Action

Generator Demo

Generated Application Interface

The generator creates a complete full-stack application with a modern, professional UI:

API Documentation & Observability

FastAPI Swagger UI Logfire Dashboard LangSmith Dashboard
API Docs Logfire LangSmith

Chat Interface (AI Agent)

Light Mode Dark Mode
Chat Light Chat Dark

Admin Panel & Monitoring

SQLAdmin Panel Celery Flower
Admin Flower

Authentication Pages

Register Login
Register Login

Why Choose This Generator?

Feature Benefit
FastAPI Modern Stack FastAPI + Next.js 15 + React 19 + TypeScript
AI AI-First Built-in support for PydanticAI, LangChain, LangGraph, and CrewAI
Security Security JWT auth, OAuth2, rate limiting, CSRF protection out of the box
Observability Observability Logfire, LangSmith, Sentry, and Prometheus integration
Performance Performance Async-first architecture with WebSocket streaming
Enterprise Enterprise-Ready Admin panels, webhooks, background tasks, and more

Perfect For

  • Startups Startups - Ship MVPs fast with production-ready infrastructure
  • Enterprise Enterprise Teams - Standardized project structure and best practices
  • AI Dev AI Developers - Pre-configured AI agent frameworks and tooling
  • Full-Stack Full-Stack Developers - Complete frontend + backend in one command

Key Features

AI Agent Frameworks

Framework Provider Support Best For
PydanticAI OpenAI, Anthropic, OpenRouter Type-safe agents, simple use cases
LangChain OpenAI, Anthropic Complex chains, many integrations
LangGraph OpenAI, Anthropic Multi-step reasoning, state machines
CrewAI OpenAI, Anthropic Multi-agent teams, complex workflows

Features:

  • ✅ Real-time WebSocket streaming
  • ✅ Conversation persistence
  • ✅ Custom tool/function calling
  • ✅ Multi-provider LLM support
  • ✅ Built-in observability

Backend Architecture

┌─────────────────────────────────────────┐
│         FastAPI Application             │
├─────────────────────────────────────────┤
│  • Async-first architecture             │
│  • Repository + Service pattern         │
│  • Django-style CLI commands            │
│  • Auto-generated API documentation     │
└─────────────────────────────────────────┘

Tech Stack:

  • FastAPI FastAPI - High-performance async API framework
  • Pydantic Pydantic v2 - Data validation and settings
  • SQLAlchemy SQLAlchemy/SQLModel - Database ORM
  • Alembic Alembic - Database migrations
  • JWT JWT + OAuth2 - Authentication & authorization

Frontend Experience

┌─────────────────────────────────────────┐
│      Next.js 15 Application             │
├─────────────────────────────────────────┤
│  • React 19 + TypeScript                │
│  • Tailwind CSS v4                      │
│  • Dark/Light mode                      │
│  • Real-time WebSocket chat              │
│  • Responsive design                    │
└─────────────────────────────────────────┘

Highlights:

  • TypeScript Type-Safe - Full TypeScript coverage
  • React Modern UI - Beautiful, accessible components
  • WebSocket Real-Time - WebSocket streaming for AI responses
  • Responsive Responsive - Mobile-first design
  • Themes Themes - Dark/light mode support

Quick Start

Installation

# Using uv (recommended - fastest)
uv tool install fastapi-fullstack

# Or using pip
pip install fastapi-fullstack

# Or using pipx
pipx install fastapi-fullstack

Generate Your First Project

# Interactive wizard (recommended for first-time users)
fastapi-fullstack new

# Quick mode with presets
fastapi-fullstack create my_ai_app --preset ai-agent --frontend nextjs

# Production-ready setup
fastapi-fullstack create my_ai_app --preset production

# Minimal setup (no extras)
fastapi-fullstack create my_ai_app --minimal

Start Development

cd my_ai_app

# Install dependencies
make install

# Start database (Docker)
make docker-db

# Run migrations
make db-migrate
make db-upgrade

# Create admin user
make create-admin

# Start backend
make run

# In another terminal - start frontend
cd frontend
bun install && bun dev

Access your application:


Architecture

System Architecture

graph TB
    subgraph Client["Client Layer"]
        Browser[Web Browser]
        Mobile[Mobile App]
    end
    
    subgraph Frontend["Frontend - Next.js 15"]
        UI[React Components]
        WS[WebSocket Client]
        State[Zustand Store]
    end
    
    subgraph Backend["Backend - FastAPI"]
        API[REST API]
        WS_Server[WebSocket Server]
        Services[Business Logic]
        Repos[Data Access]
        Agents[AI Agents]
    end
    
    subgraph Infrastructure["Infrastructure"]
        DB[(PostgreSQL/MongoDB)]
        Cache[(Redis)]
        Queue[Task Queue]
    end
    
    subgraph External["External Services"]
        LLM[LLM Providers]
        Webhooks[Webhook Endpoints]
    end
    
    Browser --> UI
    UI --> API
    UI --> WS
    WS <--> WS_Server
    API --> Services
    WS_Server --> Agents
    Services --> Repos
    Agents --> LLM
    Repos --> DB
    Services --> Cache
    Services --> Queue
    Services --> Webhooks
Loading

Code Organization

generated_project/
├── backend/
│   ├── app/
│   │   ├── api/          # REST endpoints
│   │   ├── agents/       # AI agent implementations
│   │   ├── core/         # Configuration & security
│   │   ├── db/           # Database models
│   │   ├── repositories/ # Data access layer
│   │   ├── services/     # Business logic
│   │   └── schemas/      # Pydantic models
│   ├── cli/              # Management commands
│   └── tests/            # Test suite
└── frontend/
    ├── src/
    │   ├── app/          # Next.js App Router
    │   ├── components/   # React components
    │   ├── hooks/        # Custom React hooks
    │   ├── stores/       # State management
    │   └── lib/          # Utilities
    └── e2e/              # End-to-end tests

AI Agent Support

Framework Comparison

Feature PydanticAI LangChain LangGraph CrewAI
Type Safety ✅ Native ⚠️ Manual ⚠️ Manual ⚠️ Manual
Multi-Agent ⚠️ Complex ⚠️ Complex ✅ Native
Tool Calling
Streaming
Memory ✅ Built-in ✅ Chains ✅ Checkpointer ✅ Built-in
Complexity Low Medium Medium High

Quick Example

# Generated agent code (PydanticAI example)
from pydantic_ai import Agent
from app.agents.tools import get_current_datetime

agent = Agent(
    model="openai:gpt-4o-mini",
    system_prompt="You are a helpful assistant.",
)

@agent.tool
async def current_time() -> str:
    """Get the current date and time."""
    return get_current_datetime()

# WebSocket streaming endpoint included
@router.websocket("/ws")
async def agent_ws(websocket: WebSocket):
    async for event in agent.iter(user_input):
        await websocket.send_json({"type": "token", "content": event.content})

Enterprise Integrations

Available Integrations

Category Technologies
Databases PostgreSQL, MongoDB, SQLite
Auth JWT, OAuth2 (Google), API Keys
Caching Redis, fastapi-cache2
Observability Logfire, LangSmith, Sentry, Prometheus
Tasks Celery, Taskiq, ARQ
Security Rate limiting, CORS, CSRF protection
Admin SQLAdmin panel
Events Webhooks, WebSockets
DevOps Docker, Kubernetes, CI/CD

Integration Examples

# Enable specific integrations
fastapi-fullstack create my_app \
  --redis \
  --rate-limiting \
  --admin-panel \
  --sentry \
  --prometheus \
  --webhooks

Configuration Options

Core Configuration

Option Values Default Description
Database Database postgresql, mongodb, sqlite, none postgresql Database backend
ORM ORM sqlalchemy, sqlmodel sqlalchemy ORM library
Auth Auth jwt, api_key, both, none jwt Authentication method
AI AI Framework pydantic_ai, langchain, langgraph, crewai pydantic_ai AI agent framework
LLM LLM Provider openai, anthropic, openrouter openai LLM service provider
Frontend Frontend none, nextjs nextjs Frontend framework
Tasks Background Tasks none, celery, taskiq, arq none Task queue system

Presets

# Production preset - everything enabled
fastapi-fullstack create my_app --preset production

# AI Agent preset - optimized for AI applications
fastapi-fullstack create my_app --preset ai-agent

# Minimal preset - bare bones
fastapi-fullstack create my_app --minimal

Documentation

Comprehensive Guides

Document Description
Architecture Architecture System design and patterns
Frontend Frontend Guide Next.js setup and components
AI Agent AI Agent Guide Agent frameworks and tools
Observability Observability Monitoring and tracing
Deployment Deployment Production deployment
Development Development Local development setup
Changelog Changelog Version history

Quick Reference


Examples

Example 1: AI Chatbot Application

fastapi-fullstack create chatbot_app \
  --preset ai-agent \
  --ai-framework pydantic_ai \
  --llm-provider openai \
  --frontend nextjs \
  --database postgresql \
  --auth jwt \
  --websockets

Result: Full-stack chatbot with real-time streaming, conversation history, and user authentication.

Example 2: Enterprise SaaS Platform

fastapi-fullstack create saas_platform \
  --preset production \
  --database postgresql \
  --auth jwt \
  --oauth-google \
  --redis \
  --admin-panel \
  --sentry \
  --prometheus \
  --kubernetes

Result: Production-ready SaaS with admin panel, monitoring, and Kubernetes deployment configs.

Example 3: Minimal API Service

fastapi-fullstack create api_service \
  --minimal \
  --database postgresql \
  --auth api_key \
  --frontend none

Result: Lightweight API service with authentication and database support.


Contributing

We welcome contributions! Please see our Contributing Guide for details.

How to Contribute

  1. Fork Fork the repository
  2. Branch Create a feature branch (git checkout -b feature/amazing-feature)
  3. Code Make your changes
  4. Test Run tests (uv run pytest)
  5. Commit Commit your changes (git commit -m 'Add amazing feature')
  6. Push Push to the branch (git push origin feature/amazing-feature)
  7. PR Open a Pull Request

Built with ❤️ by Ahmed Raoofuddin

StarBugDiscussDocs

Generating production-ready AI applications since 2025


⬆ Back to Top

About

No description, website, or topics provided.

Resources

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors