v1.0 Production Architecture/FastAPI 3.12 + Next.js 15

Ship your AI SaaS in days.

FastAPI + Next.js with token billing built in.

Stop rewriting Python models into JavaScript wrappers. Keep your LangChain, DSPy, and PyTorch pipelines in native Python, paired with a Linear-style Next.js 15 frontend, Supabase pgvector RAG, and Stripe metered token billing.

14-day 100% money-back guarantee • No questions asked
$ git clone https://github.com/PySaasAI/agentlaunch.git my-saas
Copy
FastAPI 3.12
Pydantic v2 & Async I/O
Next.js 15
App Router & Server Actions
pgvector + RLS
HNSW Cosine Vector Search
Stripe Metering
Per-token billing API sync
Real Product Showcase

The Production Dashboard

Inspect the real UI components, vector explorer, and telemetry included in the template. No toy demos.

app.agentlaunch.dev/dashboard
MODEL:claude-3-5-sonnet-20241022
SSE Stream Active
Analyze our Q3 churn data from the uploaded financial reports and retrieve related retention clauses.
Cited pgvector chunks:sec_filing_q3.pdf #chunk-42 (0.91 similarity)customer_sla_terms.md (0.87 similarity)

Based on semantic vector matching against your indexed documentation, Q3 customer churn decreased by 14.2% among enterprise tiers, primarily driven by the revised SLA policy introduced in August.

Retrieved contract clause §4.2 affirms that accounts exceeding 50,000 monthly active users maintain automated failover without additional compute surcharges.

Session Telemetry
Time to First Token:54 ms
Input Tokens:38 tokens
Output Tokens:162 tokens
Total Billed:200 tokens
STRIPE METER EVENT
✓ meter_event:logged
Customer: cus_98d2a | Cost: $0.0030
Every token streamed through FastAPI is captured and sent to Stripe via background task before closing the stream.
Inspect Code Quality Before Buying

Repository File Tree Preview

Clean, modular, and strictly typed code. See how data flows from Next.js 15, is authorized in FastAPI, and streamed back with Stripe metering.

PySaasAI/agentlaunch
EXPLORER
📁 backend/
📁 frontend/
📁 supabase/
backend/api/core/auth.py
Zero-Trust Supabase JWT validation dependency in FastAPI
from fastapi import Depends, HTTPException, status
from fastapi.security import HTTPBearer, HTTPAuthorizationCredentials
from jose import jwt, JWTError
from api.core.config import settings

security = HTTPBearer()

async def get_current_user(
    credentials: HTTPAuthorizationCredentials = Depends(security)
) -> dict:
    """
    Zero-Trust JWT verification dependency.
    Validates Supabase JWT signature against SUPABASE_JWT_SECRET.
    Never trusts client parameters for user identity.
    """
    token = credentials.credentials
    try:
        payload = jwt.decode(
            token,
            settings.SUPABASE_JWT_SECRET,
            algorithms=["HS256"],
            audience="authenticated"
        )
        user_id: str = payload.get("sub")
        if not user_id:
            raise HTTPException(
                status_code=status.HTTP_401_UNAUTHORIZED,
                detail="Invalid token payload: missing sub claim"
            )
        return {
            "id": user_id,
            "email": payload.get("email"),
            "role": payload.get("role", "authenticated"),
            "stripe_customer_id": payload.get("user_metadata", {}).get("stripe_customer_id")
        }
    except JWTError as e:
        raise HTTPException(
            status_code=status.HTTP_401_UNAUTHORIZED,
            detail=f"Cryptographic JWT verification failed: {str(e)}"
        )
Live SSE & Metering Architecture Demo

See the Dual-Stack Engine in Action

Watch how a Next.js 15 client securely triggers a Python FastAPI SSE stream, queries pgvector with RLS, and records metered Stripe token usage in real time.

FastAPI: Healthy (3.12)
Next.js: Connected
Live Telemetry & Billing Stripe Synced
STREAM STATUS
Idle
TOKENS BILLED
0 tokens
STRIPE USAGE
$0.0000
TTFT (Time-to-first-token):--
Server-Sent Events: text/event-streamFastAPI ⇄ Next.js 15 SSE

Click "Execute Agent Stream" above to start the live token streaming demo.

Simulates SSE chunking, Supabase JWT verification, pgvector RAG, and Stripe token metering.

Why AgentLaunch Wins

Why Other Approaches Fall Short for ML Engineers

Node.js boilerplates force you into weak JavaScript AI libraries. Streamlit apps don't look like real B2B software. AgentLaunch gives you the best of both worlds.

Architecture FeatureNode.js BoilerplatesStreamlit / Reflex
AgentLaunchRecommended
AI / ML Library Ecosystem
Restricted to JS wrappers (LangChain.js lags behind)
Full Python, but trapped in clunky UI
Full native Python 3.12 (LangChain, DSPy, PyTorch, Hugging Face)
Frontend UI & User Experience
Modern React/Next.js
Streamlit / Gradio (Looks like internal data tools)
Linear-style Next.js 15 App Router + Tailwind & Framer Motion
Billing Model for AI Tokens
Flat monthly fee (High risk of token cost deficit)
No built-in billing
Automated Stripe Metered / Usage-Based Billing per token
Streaming Protocol
Custom WebSockets or polling
Session-state polling / rerenders
Sub-50ms Server-Sent Events (SSE) with token live-counter
Multi-Tenant Vector Isolation
App-level filtering (vulnerable to prompt leaks)
In-memory FAISS / Chroma (Single tenant)
Postgres pgvector with native Row-Level Security (RLS)
Zero-Trust Auth Bridge
NextAuth / Node sessions only
Basic HTTP basic auth or cookies
Supabase JWT validated cryptographically in FastAPI Depends
System Blueprint

Engineered for Separation of Concerns

No messy monolithic compromises. Keep your frontend fast and SEO-ready on Vercel while running your heavy AI workloads on high-throughput Python backends.

Layer 1

Next.js 15 Frontend

App Router & React Server Components. Manages sessions, handles SSR, renders the UI, and opens an SSE stream listener.

Next.js 15TypeScriptTailwind CSSFramer Motion
Secure Bridge

SSE & JWT Protocol

Zero-Trust authorization. Supabase JWT passed via Bearer header. Server-Sent Events stream tokens smoothly with sub-50ms TTFT.

text/event-streamBearer JWTCORS Middleware
Layer 2

FastAPI Python Runtime

Native Python 3.12 ecosystem. Executes LangChain, LlamaIndex, DSPy, or custom PyTorch models with Pydantic v2 validation.

Python 3.12FastAPIPydantic v2LangChain
Storage & RAG

Supabase + pgvector

PostgreSQL 16 with HNSW cosine distance indexing for ultra-fast vector similarity search, enforced by native Postgres RLS policies.

pgvectorPostgreSQL 16Supabase AuthRow Level Security
Automated Stripe Metered Billing (Token Usage)
Never lose money on OpenAI / Anthropic spikes. Billed dynamically per 1k tokens consumed.
POST /v1/billing/meter_events200 OK
Batteries Included

Everything You Need to Monetize AI Models

Engineered specifically for Machine Learning Engineers who want to launch enterprise-grade AI products without reinventing the full-stack wheel.

Python 3.12

FastAPI 3.12 & Pydantic V2

Functional, strictly-typed Python backend. Enforces RORO pattern with full input/output validation, zero untyped dicts, and async I/O.

Server-Sent Events

Sub-50ms SSE Streaming

Yields text/event-stream chunks directly to custom Next.js stream consumers. Smooth typing effect without UI blocking or web sockets overhead.

JWT Bearer

Zero-Trust Supabase JWT

FastAPI verifies Supabase Auth tokens cryptographically via FastAPI Depends injection. No unauthorized access to heavy AI GPU/API workloads.

pgvector

PostgreSQL pgvector RAG

Store and query document embeddings with HNSW cosine distance indexing. Strictly protected by PostgreSQL native Row-Level Security (RLS).

Usage-Based

Stripe Metered Billing

Calculates exact input and output tokens consumed during LLM requests and records metered usage in Stripe before stream closure.

Docker Compose

Production Docker & Multi-Cloud

Optimized multi-stage Dockerfiles. Ready for 1-click deployment on Vercel (frontend) and Railway, Fly.io, Modal, or AWS ECS (backend).

AL
Built & Maintained By

The PySaas AI Team

Full-Stack & AI Systems Engineers • 3+ years in production React, Next.js, FastAPI & real-time streaming architectures.

Why I Built AgentLaunch

I built AgentLaunch because existing AI boilerplates ignore the reality of how machine learning works. Almost every popular SaaS template on the market is 100% JavaScript. But ML engineers, data scientists, and AI researchers build their models in Python—using LangChain, DSPy, PyTorch, Hugging Face, and FastAPI.

When Python developers want to monetize their work, they are forced to either rewrite everything in fragile JS wrappers or spend 80+ hours figuring out cross-origin cookies, Supabase JWT verification, Server-Sent Events (SSE) buffering, and Stripe usage meters.

AgentLaunch gives you the best of both worlds: uncompromised Python compute power behind a consumer-grade, Linear-style Next.js 15 interface. You own 100% of the code with zero proprietary lock-in.

100% TypeScript & Typed Python
Direct GitHub Repo Access
No Obfuscated Dependencies
Early Bird: First 50 copies only — 19 seats remaining at $129

Pay Once, Build Forever.

$129 one-time vs. 80+ hours of tedious plumbing ($8,000+ value at $100/hr). Spend your weekend launching your AI model instead of wrestling with JWT headers and SSE buffers.

Claimed: 31 / 50 seats62% Sold
Solo Builder License1 Developer
$129/ one-time fee

Full production boilerplate for solo developers and ML engineers shipping their first commercial AI SaaS.

Full Next.js 15 & FastAPI Codebase: App Router, Pydantic v2, SSE stream generator
Stripe Metered Billing: Automated token calculation & Stripe Meter event logging
Supabase pgvector RAG: HNSW cosine index migrations with native multi-tenant RLS
Commercial Rights: Build unlimited personal SaaS projects or commercial tools
Client Work Allowed: Deploy projects for your paying freelance clients
Lifetime Access & Updates: Pull upstream improvements from the private GitHub repository
Agency & Team
Team / UnlimitedUnlimited Devs
$249/ one-time fee

For AI agencies, development shops, and teams building multiple commercial client platforms.

Everything in Solo License, plus:
Unlimited Team Seats: Invite your entire engineering team to the private repository
Unlimited Commercial Client Apps: Ship unlimited client deliverables with zero royalties
Multi-Agent LangChain & DSPy Templates: Advanced orchestration graphs included
Docker Multi-Stage & GitHub Actions CI/CD: Production deployment manifests
Priority GitHub Issue Support: Direct architecture review and assistance
14-Day 100% Money-Back Guarantee
If AgentLaunch doesn't save you at least 40 hours of setup, email us for a full refund.
Merchant of Record Security
Processed securely via Lemon Squeezy / Polar (Handles EU VAT & US sales tax).
Frequently Asked Questions

Everything You Need to Know

Honest answers about architecture, licensing, updates, and requirements.

We believe in radical transparency: AgentLaunch provides the complete production code, database migrations, authentication bridges, and deployment recipes. It does not include third-party API credits (you bring your own OpenAI/Anthropic/DeepSeek API keys), hosted GPU compute instances, or custom domain names. You run the code on your own infrastructure or cloud providers (Vercel, Railway, Supabase, Fly.io) with 100% ownership.
Backend: Python 3.12+ (strictly typed with Pydantic V2 and managed via uv). Frontend: Node.js 20+ with Next.js 15 App Router, React 19, and pnpm. All dependencies are locked with deterministic lockfiles (pnpm-lock.yaml and uv requirements.txt).
Yes! Both the Solo Builder ($129) and Team / Unlimited ($249) licenses grant you full commercial permission to build and deploy applications for paying clients or freelance projects. You can charge clients whatever you want with zero royalty fees. The only restriction is that you cannot resell or redistribute the boilerplate source code itself as a competing template.
When you purchase a license, you receive permanent access to the private GitHub repository. As Next.js, FastAPI, LangChain, or Supabase release updates, we push patches, new agent workflow recipes, and architectural improvements directly to the main branch. You can pull upstream changes into your fork at any time without paying renewal fees.
Because the machine learning and AI ecosystem lives in Python (LangChain, DSPy, PyTorch, Hugging Face, NumPy, LlamaIndex). JavaScript AI packages lag months behind Python and cannot run tensor operations or local model weights efficiently. Decoupling gives you the best of both worlds: uncompromised Python AI power with the world's fastest and most polished React web frontend.
When a user logs in via Supabase Auth in Next.js, their access token (JWT) is passed in the Authorization: Bearer <token> header with every request or SSE stream. FastAPI does not trust client parameters; it verifies the JWT cryptographic signature against Supabase's secret or JWKS using a custom Depends(get_current_user) dependency before initiating any AI workload.
AgentLaunch tracks exact input and output tokens during the SSE streaming generator. A try...finally block ensures that even if a user closes their browser mid-stream, the accumulated token count up to that point is automatically logged to the Stripe Meter Events API (POST /v1/billing/meter_events) before the socket terminates.
The repository includes production Dockerfiles and deployment recipes: deploy the Next.js frontend to Vercel with zero-configuration SSR, and deploy the FastAPI backend container to Railway, Fly.io, Render, Modal, or AWS ECS. Simply configure your CORS origins and environment variables, and your dual-stack SaaS is live in minutes.
19 seats left
$129 one-time
Get Boilerplate