Production-ready SaaS starter — web + mobile, batteries included.
Next.js 16 · Expo SDK 55 · Stripe · RevenueCat · Better-Auth · Drizzle ORM · Turborepo
Quick start · What's included · Features · Deploy · Contributing · Sponsor
Use this template to ship a full SaaS product — web dashboard + iOS/Android app — in days instead of months. Every integration is wired up and working out of the box.
| Layer | Web | Mobile |
|---|---|---|
| Framework | Next.js 16 (App Router) | Expo Router |
| UI | shadcn/ui — Radix + Tailwind v4 | NativewindUI — NativeWind |
| Auth | Better-Auth (RBAC via admin plugin) | Better-Auth HTTP + AsyncStorage |
| Payments | Stripe — Checkout, Portal, Webhooks | RevenueCat — IAP (iOS + Android) |
| Database | Drizzle ORM + PostgreSQL | via Web API |
| Resend + React Email templates | via Web API | |
| Background Jobs | Inngest — event-driven + cron | — |
| Rate Limiting | Upstash Redis | — |
| Analytics | PostHog | PostHog |
| Error Tracking | Sentry | Sentry |
| Tracing | OpenTelemetry (OTLP) | — |
| Feature Flags | PostHog (server + client) | — |
| Canary Rollouts | Vercel Edge Config | — |
| Testing | Vitest + happy-dom | — |
| CI/CD | GitHub Actions → Vercel | GitHub Actions → EAS Build |
No other open-source SaaS starter ships a complete web + mobile monorepo with dual payment processing.
| This template | create-t3-turbo | Open SaaS (Wasp) | Saasfly | ShipFast | Supastarter | Makerkit | |
|---|---|---|---|---|---|---|---|
| Price | Free | Free | Free | Free | $199+ | $299+ | $299 |
| Mobile app (Expo) | Yes | Yes | — | — | — | — | — |
| Mobile IAP (RevenueCat) | Yes | — | — | — | — | — | — |
| Web payments (Stripe) | Yes | — | Yes | Yes | Yes | Yes | Yes |
| Auth with RBAC | Better-Auth | NextAuth | Email/OAuth | NextAuth | NextAuth | Multi | Multi |
| Background jobs | Inngest | — | Wasp Jobs | — | — | Partial | Partial |
| OpenTelemetry tracing | Yes | — | — | — | — | — | — |
| Feature flags | PostHog | — | — | — | — | — | — |
| Canary rollouts | Edge Config | — | — | — | — | — | — |
| Rate limiting | Upstash | — | — | — | — | — | — |
| Email templates | React Email | — | — | — | Partial | Yes | Yes |
| Error tracking | Sentry | — | — | — | — | — | — |
| Analytics | PostHog | — | Plausible | — | — | — | — |
| CI/CD | GH Actions | — | — | — | — | — | — |
Key differentiators:
- Web + Mobile in one repo — the only open-source template with a full Expo app (auth flows, tab navigation, subscription paywall) alongside a Next.js dashboard
- Dual payment rails — Stripe for web + RevenueCat for iOS/Android IAP, both with webhook handlers
- Production observability — Sentry + OpenTelemetry + PostHog + Edge Config canary rollouts, all pre-wired
- Event-driven architecture — Inngest functions for welcome emails, payment failures, and scheduled cleanup with built-in retries
apps/
web/ Next.js 16 — dashboard, auth, billing, admin panel
mobile/ Expo Router — iOS & Android with NativewindUI
packages/
db/ @repo/db — Drizzle ORM schema + migrations
email/ @repo/email — React Email templates
shadcn-ui/ @repo/shadcn-ui — web UI components
nativewindui/ @repo/nativewindui — mobile UI components
typescript-config/ shared tsconfig presets
eslint-config/ shared ESLint rules
- Node.js >= 20
- pnpm >= 10.32
- PostgreSQL — local or hosted (Supabase, Neon, Railway, …)
# 1. Clone and run the setup script
pnpm setup
# 2. Fill in .env.local (the script creates it from .env.example)
# Minimum required: DATABASE_URL, BETTER_AUTH_SECRET
# 3. Run migrations
pnpm db:migrate
# 4. Start all apps
pnpm devWeb → http://localhost:3003
Mobile → cd apps/mobile && pnpm dev (Expo Go / simulator)
Copy .env.example to .env.local and fill in your credentials.
Minimum to run locally:
| Variable | Where to get it |
|---|---|
DATABASE_URL |
Supabase → Settings → Database → Connection string |
BETTER_AUTH_SECRET |
openssl rand -hex 32 |
NEXT_PUBLIC_APP_URL |
http://localhost:3003 |
Everything else (Stripe, RevenueCat, Sentry, …) is optional locally — the app degrades gracefully when services are unconfigured.
pnpm setup # First-time setup (install + .env.local + migration hint)
pnpm dev # Start all apps
pnpm build # Build all packages + apps
pnpm lint # Lint everything
pnpm typecheck # TypeScript check
pnpm test # Vitest (web)
# Database
pnpm db:generate # Generate Drizzle migrations from schema changes
pnpm db:migrate # Apply migrations to the database
pnpm db:push # Push schema directly (dev, no migration file)
pnpm db:studio # Open Drizzle Studio- Email + password sign-up / sign-in
- Admin RBAC via
admin()plugin — role management at/admin - Middleware protects
/dashboard/**and/admin/** - Mobile uses HTTP-based auth with AsyncStorage session
- Web (Stripe): checkout session → subscription → billing portal
- Mobile (RevenueCat): wraps Apple StoreKit + Google Play Billing
- Webhook handlers for both at
/api/webhooks/stripeand/api/webhooks/revenuecat
5 tables managed with Drizzle ORM: users, user_subscriptions, payments, mobile_subscriptions, mobile_payments
| Function | Trigger |
|---|---|
send-welcome-email |
user/signup event |
payment-failed-reminder |
stripe/payment.failed event |
subscription-canceled |
stripe/subscription.canceled event |
cleanup-sessions |
Cron — daily 3 AM UTC |
- Sentry — error boundaries + exception capture
- PostHog — analytics + feature flags (server + client)
- OpenTelemetry — OTLP trace export, 10% sample rate in prod
- Vercel Edge Config — canary rollouts + kill switches (<1ms reads)
- Import repo → Vercel auto-detects Next.js
- Set environment variables from
.env.example - Link an Edge Config store (optional, for canary rollouts)
cd apps/mobile
eas build --platform all # Production builds
eas submit # Submit to App Store + Play StoreCI automatically builds on v* git tags via .github/workflows/mobile.yml.
- SAAS_SETUP.md — Step-by-step third-party service setup
- STRIPE_WEBHOOK_SETUP.md — Stripe webhook configuration
- REVENUECAT_SETUP.md — RevenueCat mobile IAP setup
- CONTRIBUTING.md — Contribution guidelines
- CLAUDE.md — Full technical reference (AI-assisted dev context)
We welcome contributions! Check out CONTRIBUTING.md to get started.
Looking for something to work on? Browse issues labeled good first issue or help wanted.
If this template saved you time, consider supporting its development:
- GitHub Sponsors
- Buy me a coffee
- Star this repo — it helps others discover it
MIT — see LICENSE for details.
