Skip to content

Official RapidKit example projects for production-ready backend APIs (FastAPI, NestJS), including AI agent reference implementations and step-by-step tutorial code.

Notifications You must be signed in to change notification settings

getrapidkit/rapidkit-examples

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RapidKit Examples

Official example projects for RapidKit.

This repository contains production-style reference implementations that accompany RapidKit tutorials and articles.


🚀 Featured Examples

💡 Quick Tip: Install the RapidKit VS Code Extension to clone, run, and manage these workspaces with one click. See the VS Code Extension section below for details.

1. Quickstart Workspace (⚡ Beginner)

Path: quickstart-workspace

Description: Production-ready FastAPI in 5 minutes

Includes:

  • product-api (FastAPI): Complete API with auth, database, caching, monitoring
  • JWT Authentication (register, login, refresh)
  • PostgreSQL with SQLAlchemy (async & sync)
  • Redis caching with connection pooling
  • CORS & Security Headers
  • Structured logging & Prometheus metrics
  • Docker & CI/CD templates

Modules: settings, auth_core, db_postgres, redis, cors, security_headers, logging, deployment

Articles:


2. AI Agent Workspace (🤖 Intermediate)

Path: my-ai-workspace

Description: Multi-provider AI assistant with FastAPI and NestJS

Includes:

  • ai-agent (FastAPI): Multi-provider AI assistant (echo/template/OpenAI-ready)
  • ai-agent-nest (NestJS): Parity implementation with ai_assistant module
  • Streaming + caching endpoints
  • Health checks & support ticket workflow
  • Integrated tests and module status checks

Modules: ai_assistant, settings, logging

Articles:


3. SaaS Starter Workspace (🏢 Advanced)

Path: saas-starter-workspace

Description: Complete multi-project SaaS backend foundation with FastAPI + NestJS + webhooks.

Includes:

  • saas-api (FastAPI): Main API for auth, profiles, subscriptions, billing, teams
  • saas-admin (FastAPI): Admin backend for user moderation and metrics
  • saas-nest (NestJS): Framework parity implementation + shared module health routes
  • saas-webhooks (FastAPI): Stripe webhook intake, logs, replay, retry-oriented processing

Modules: settings, logging, db_postgres, redis, auth_core, oauth, session, users_core, users_profiles, stripe_payment, cart, inventory, security_headers, rate_limiting, celery, email, notifications

Articles:


💡 VS Code Extension (Recommended)

The fastest way to work with RapidKit workspaces.

🎯 Why Use the Extension?

Skip manual cloning and setup. The RapidKit VS Code Extension provides a complete integrated development experience for RapidKit projects.

✨ Key Features

1. One-Click Workspace Import

  • Clone from GitHub — Paste any RapidKit workspace URL, clone instantly
  • Import Downloaded Workspaces — Drag & drop .zip files or browse local folders
  • Welcome Page — Visual gallery of all available example workspaces

2. Integrated Project Management

  • Run/Stop Services — Start development servers from the sidebar
  • View Logs — Real-time log streaming in integrated terminal
  • Health Checks — Monitor module status with visual indicators
  • Port Management — Auto-detect and resolve port conflicts

3. Module Management

  • Install Modules — GUI wizard for adding modules (auth, database, AI, etc.)
  • Configure Settings — Visual editors for module configurations
  • Module Status — See which modules are installed and their health

4. Development Tools

  • RapidKit Terminal — Integrated terminal with command autocomplete
  • Quick Actions — Run migrations, tests, or custom scripts with one click
  • Project Templates — Scaffolding wizards for new projects
  • Multi-Project Workspaces — Manage multiple services simultaneously

5. Testing & Debugging

  • Run Tests — Execute test suites from the sidebar
  • Debug Configuration — Pre-configured debug profiles
  • Coverage Reports — View test coverage inline

📦 Installation

Option 1: From VS Code

  1. Open VS Code
  2. Go to Extensions (Cmd/Ctrl+Shift+X)
  3. Search for "RapidKit"
  4. Click Install

Option 2: Command Line

code --install-extension rapidkit.rapidkit-vscode

Option 3: Direct Download

🚀 Quick Start with Extension

Import This Repository:

  1. Open VS Code
  2. Open Command Palette (Cmd/Ctrl+Shift+P)
  3. Type: RapidKit: Import Workspace
  4. Paste: https://github.com/getrapidkit/rapidkit-examples.git
  5. Select workspace (quickstart-workspace, my-ai-workspace, or saas-starter-workspace)
  6. Click Import & Setup

That's it! The extension will:

  • Clone the repository
  • Install dependencies
  • Configure environment
  • Open the workspace
  • Show available services in the sidebar

Run a Project:

  1. Open RapidKit sidebar (left panel)
  2. Expand "Projects"
  3. Click ▶️ next to any project (e.g., product-api)
  4. Extension starts the dev server automatically
  5. Click 🌐 to open in browser

🎬 Example Workflow

Scenario: Run the SaaS Starter Workspace

Command Palette → RapidKit: Import Workspace
→ Paste: https://github.com/getrapidkit/rapidkit-examples.git
→ Select: saas-starter-workspace
→ Click: Import & Setup

After import:

  • Sidebar shows 4 projects: saas-api, saas-admin, saas-nest, saas-webhooks
  • Click ▶️ on saas-api → Dev server starts on port 8000
  • Click ▶️ on saas-admin → Starts on port 8001
  • Click 🌐 → Opens Swagger docs automatically
  • Click 📊 → View logs in integrated terminal

Need to add a module?

  • Right-click project → Install Module
  • Select module (e.g., stripe_payment)
  • Extension installs and configures automatically
  • Service restarts with new module

📱 Extension UI Overview

Sidebar Panels:

  • 📦 Workspaces — All imported workspaces
  • 🎯 Projects — Services within active workspace
  • 🧩 Modules — Installed modules with status indicators
  • ⚙️ Settings — Quick access to configurations
  • 📝 Logs — Real-time log viewer

Status Bar:

  • RapidKit CLI Version — Click to check for updates
  • Active Workspace — Current workspace name
  • Running Services — Count of active dev servers

🔧 Advanced Features

1. Workspace Health Check:

  • Right-click workspace → Run Health Check
  • Extension validates Python, Poetry, dependencies, modules
  • Shows actionable fixes for any issues

2. Module Configuration:

  • Click any module in sidebar
  • Visual editor for config/{module}.toml files
  • Autocomplete for configuration options

3. Custom Scripts:

  • Define scripts in pyproject.toml:
    [tool.rapidkit.scripts]
    seed-db = "python scripts/seed_database.py"
    migrate = "alembic upgrade head"
  • Run from Command Palette: RapidKit: Run Script

4. Multi-Workspace Support:

  • Open multiple RapidKit workspaces side-by-side
  • Switch between workspaces in dropdown
  • Each workspace has independent service states

🆚 Extension vs Manual Setup

Task Manual With Extension
Clone workspace 4 commands 1 click
Install dependencies 3 commands per project Automatic
Start dev server Terminal, type commands Click ▶️
Check logs Switch terminals Integrated viewer
Install module CLI + config edits GUI wizard
Health check npx rapidkit doctor Right-click menu
Port conflicts Manual debugging Auto-resolves

Time saved per project: ~5-10 minutes

🐛 Troubleshooting

Extension not showing workspaces?

  • Reload window: Cmd/Ctrl+Shift+PReload Window
  • Check output panel: View → Output → RapidKit

Project won't start?

  • Right-click → Run Health Check
  • Install missing dependencies: Right-click → Install Dependencies

Module installation fails?

  • Check logs in Output panel
  • Ensure virtual environment is activated
  • Try: Right-click project → Rebuild Environment

📚 Learn More


⚡ Quick Start (Manual Setup)

Quickstart Workspace (Beginner - 5 minutes)

Production-ready FastAPI with auth, database, caching:

git clone https://github.com/getrapidkit/rapidkit-examples.git
cd rapidkit-examples/quickstart-workspace/product-api

# Start infrastructure
docker-compose up -d postgres redis

# Install & run
source .rapidkit/activate
rapidkit init
rapidkit dev

Endpoints:


AI Agent Workspace (Intermediate)

FastAPI:

git clone https://github.com/getrapidkit/rapidkit-examples.git
cd rapidkit-examples/my-ai-workspace/ai-agent
source .rapidkit/activate
rapidkit init
rapidkit dev

NestJS:

cd rapidkit-examples/my-ai-workspace/ai-agent-nest
source .rapidkit/activate
rapidkit init
rapidkit dev -p 8013

Endpoints:

  • 📚 Swagger UI: http://127.0.0.1:8000/docs (or auto-fallback port)
  • 🤖 AI Providers: GET /ai/assistant/providers
  • 💬 Completions: POST /ai/assistant/completions
  • 📡 Streaming: POST /ai/assistant/stream
  • 🎫 Support Ticket: POST /support/ticket

SaaS Starter Workspace (Advanced)

git clone https://github.com/getrapidkit/rapidkit-examples.git
cd rapidkit-examples/saas-starter-workspace
npx rapidkit doctor --workspace

Run each service:

# Main SaaS API
cd saas-api && source .rapidkit/activate && rapidkit init && rapidkit dev

# Admin API
cd ../saas-admin && source .rapidkit/activate && rapidkit init && rapidkit dev -p 8001

# NestJS API
cd ../saas-nest && source .rapidkit/activate && rapidkit init && rapidkit dev -p 8002

# Webhooks service
cd ../saas-webhooks && source .rapidkit/activate && rapidkit init && rapidkit dev -p 8003

Key endpoints:

  • saas-api: /auth/register, /subscriptions/plans, /teams
  • saas-admin: /admin/users, /admin/subscriptions, /admin/health
  • saas-nest: /docs, /api/health/module/{module}
  • saas-webhooks: POST /api/webhooks/stripe, GET /api/webhooks/logs, POST /api/webhooks/replay/{event_id}

🔍 Workspace Health Check

Quickstart Workspace:

cd quickstart-workspace
npx rapidkit doctor --workspace

AI Agent Workspace:

cd my-ai-workspace
npx rapidkit doctor --workspace

SaaS Starter Workspace:

cd saas-starter-workspace
npx rapidkit doctor --workspace

Checks:

  • ✅ Python version (3.10+)
  • ✅ Poetry installation
  • ✅ RapidKit Core version
  • ✅ Virtual environment status
  • ✅ Project dependencies
  • ✅ Module configurations

📁 Repository Layout

rapidkit-examples/
├── README.md                    # This file
├── examples.json                # Workspace metadata
│
├── quickstart-workspace/        # ⚡ Beginner (5 minutes)
│   ├── README.md               # Workspace guide
│   ├── pyproject.toml          # Workspace dependencies
│   └── product-api/            # Production-ready API
│       ├── README.md           # Project guide
│       ├── src/
│       │   ├── main.py         # FastAPI app
│       │   ├── modules/        # RapidKit modules
│       │   ├── routing/        # API routes
│       │   └── health/         # Health probes
│       ├── tests/              # Test suite
│       ├── config/             # Module configs
│       ├── docker-compose.yml  # Postgres + Redis
│       └── Dockerfile          # Production image
│
├── my-ai-workspace/            # 🤖 Intermediate (10 minutes)
    ├── README.md               # Workspace guide
    ├── ai-agent/               # FastAPI AI assistant
    │   ├── README.md
    │   └── EXAMPLE_README.md   # Tutorial walkthrough
    └── ai-agent-nest/          # NestJS implementation
        └── README.md
│
└── saas-starter-workspace/     # 🏢 Advanced (15-20 minutes)
    ├── README.md               # Workspace guide
    ├── saas-api/               # Main SaaS API (FastAPI)
    ├── saas-admin/             # Admin API (FastAPI)
    ├── saas-nest/              # Framework comparison (NestJS)
    └── saas-webhooks/          # Stripe webhook processor (FastAPI)

📚 Documentation Structure

Quickstart Workspace:

AI Agent Workspace:

SaaS Starter Workspace:


🎓 Learn More

RapidKit Resources:

Tutorial Articles:


🚀 Coming Soon

  • product-workspace - Step-by-step tutorial (Article 6)
  • ecommerce-workspace - Multi-service architecture (Article 10)
  • ddd-workspace - DDD + CQRS patterns (Article 11)
  • AI workspaces - Advanced AI patterns (Articles 7-8)

Built with RapidKit 🚀

About

Official RapidKit example projects for production-ready backend APIs (FastAPI, NestJS), including AI agent reference implementations and step-by-step tutorial code.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published