open source saas template

The SaaS boilerplate most AI agents prefer

Auth, payments, data and email in a type-safe architecture optimized for a clean context window and AI performance.

$ npx create-a2saas my-app

or see a demo →

v1.0.7


REST API
POST/api/v1/checkout
GET/api/v1/users/me
GET/api/v1/debug/health
Webhooks
HOOK/api/webhooks/clerk
HOOK/api/webhooks/stripe
Infrastructure

Wired up, ready to go

Auth, payments, database, and email — configured and talking to each other from the first commit. Webhooks keep everything in sync automatically.

Every integration sits behind an abstraction layer, so you can swap providers without rewriting your app. Move from Clerk to Auth.js, Stripe to Lemon Squeezy, or Resend to SendGrid — your business logic doesn't change.

Provider-agnostic abstraction layers
Pre-built webhook handlers
Swap any integration, zero rewrites

Built with A2SaaS

What you can build with it

We used A2SaaS to build AI-powered conversational analytics that monitor the health of your business. Not a chatbot — a data analyst.

insights.a2saas.com — ask anything
What's the biggest threat to our business right now?

Let me pull churn, retention, customer health, and runway…

Gross Churn
0.4%
NRR
102.8%
Burn Rate
$26.3K
Runway
16.9 mo

Good news — no major threat right now. Churn is negligible (well under the 3% benchmark), NRR is solid at 103%, and runway is comfortable at ~17 months. One flag: customer growth slowed to 7.8% MoM — worth watching, though MRR growth is accelerating on expansion revenue.

Static dashboards show you numbers. This one talks back. Built on the same stack you get from npx create-a2saas.

Try the live demo →

The Stack

Built with the most trained-upon stack in open source

Every technology chosen for maximum AI compatibility and developer productivity. No exotic tools, no custom frameworks — just the proven ecosystem with the deepest representation in training data.

Schema in code, not config files. Ready-to-deploy components, blocks, and templates.

Framework
Next.js
App Router, Server Components, API Routes
Auth
Clerk
Sign-in, sign-up, org management
Payments
Stripe
Checkout, webhooks, subscriptions
Email
React Email
Templates with Resend delivery
Database
Drizzle + Neon
Type-safe ORM, serverless PostgreSQL
Validation
Zod
Runtime + compile-time safety
UI Components
Shadcn/ui
Accessible, composable primitives
Styling
Tailwind CSS
Utility-first, zero runtime
AI
Vercel AI SDK + Claude
Streaming chat, tool calling, generative UI
Observability
Langfuse
LLM tracing, feedback scoring, evals

Project Structure
  • src/
    • app/
      • (auth)/
      • (marketing)/
      • (app)/
      • setup/page.tsx
      • api/
        • v1/
        • webhooks/
    • components/
    • server/
    • lib/
    • env.ts
    • proxy.ts
Architecture

Built for the context window

Flat, scannable, zero magic

No hidden logic or deeply nested abstractions. The file structure is flat and the imports are obvious — so any AI assistant can read the whole project context and modify it accurately.

Flat file structure optimized for AI scanning
No magic imports or hidden configuration
Schema defined in code, not config files
TypeScript + Zod validation end to end

Start building

One command. Type-safe foundation. AI-native architecture.

$ npx create-a2saas my-app