SaaS Starter 2.0 โ TypeScript 6, Next.js 16, Hono 4.12, React 19 & Major Platform Expansion
The biggest SaaS Starter release ever. Core upgrades to TypeScript 6, Next.js 16, Hono 4.12, and React 19, plus nine major new features: 13 SaaS vertical templates, 4-provider billing factory, admin dashboard, Prometheus + Grafana monitoring, CLI tool, MCP server, 7-provider AI factory, 27 theme presets, dynamic branding, and module gating. Security hardened with fail-close admin, Docker Secrets, and stealth admin paths.
SaaS Starter v2.0.0 โ Major Release
Version 2.0 is the largest SaaS Starter release to date, delivering core framework upgrades alongside nine major new features and a security hardening pass. Several breaking changes require migration โ read the notes carefully.
๐ฅ Breaking Changes
- TypeScript 6.0 โ strict
rootDirenforcement;apps/api/tsconfig.jsonupdated with"rootDir": "../../".exactOptionalPropertyTypesandnoUncheckedIndexedAccessare now enabled. - ESLint 10 flat config โ
.eslintrcdropped; neweslint.config.mjsat repo root;next lintreplaced byeslint src --ext .ts,.tsxin web. - Zod v4 โ
z.record()now requires an explicit key schema:z.record(z.string(), valueType). - Vitest v4 โ constructor mocks must use
functionkeyword, not arrow functions.
โฌ๏ธ Dependency Upgrades
| Package | From | To | |---|---|---| | TypeScript | 5.5 | 6.0 | | Next.js | 15.x | 16.2.3 | | Hono | 3.x | 4.12 | | React | 18.x | 19 | | ESLint | 8.x | 10.2.0 | | Tailwind CSS | 3.4 | 4.2.2 | | Vitest | 2.x | 4.1.4 | | Zod | 3.x | 4.3.6 | | Stripe SDK | 16.x | 22.0.1 | | OpenAI SDK | 4.x | 6.34.0 | | Anthropic SDK | 0.32 | 0.88.0 | | Groq SDK | 0.7 | 1.1.2 | | Framer Motion | 11.x | 12.38.0 | | Recharts | 2.x | 3.8.1 | | Pino | 9.x | 10.3.1 | | Nodemailer | 7.x | 8.0.5 | | Resend | 4.x | 6.10.0 | | bcryptjs | 2.x | 3.0.3 | | nanoid | 4.x | 5.1.7 | | Vite | 5.x | 8.0.8 | | @types/node | 20.x | 25.6.0 | | Lucide React | 0.447 | 1.8.0 |
๐๏ธ Template System (13 SaaS Vertical Templates)
Pre-built vertical presets that configure modules, landing page, dashboard sections, and navigation for a specific business domain โ expanded from 8 to 13 templates:
- Developer API Platform (
developer) โ API-first, usage-based billing, developer tools - E-Commerce (
ecommerce) โ product catalog, cart, order management - CRM / Professional Services (
professional) โ client portals, pipeline management - Creator Platform (
creator) โ content subscriptions, digital storefronts, payouts - Internal Tools Builder (
internal-tools) โ admin panels, workflow automation, audit logs - Fintech (
fintech) โ financial dashboards, transactions, risk monitoring - Healthcare (
healthcare) โ patient portals, appointments, care notes - Kanban / Productivity (
productivity) โ boards, tasks, team collaboration - AI SaaS Platform (
ai) โ multi-provider AI, credit metering, streaming chat, RAG - Education / LMS (
education) โ course creation, student enrollment, certificates - Marketplace Platform (
marketplace) โ multi-vendor, commissions, dispute resolution - Social & Community (
social) โ feeds, groups, messaging, moderation - Booking Platform (
booking) โ scheduling, calendar management, reminders
Each template includes relevant landing page content, dashboard sections, DB schema additions, and visual identity. Generate with pnpm saas-starter init or install from the admin panel at /admin/templates.
๐ณ Billing Factory (4 Providers)
The billing factory now supports four providers, swappable via BILLING_PROVIDER:
| Provider | Env Value | Notes |
|---|---|---|
| Stripe | stripe | Checkout, customer portal, subscriptions, metered billing |
| Paddle | paddle | Paddle Billing (v2), tax handling, Paddle-specific webhook events |
| Lemon Squeezy | lemonsqueezy | License key management, subscriptions, one-time payments |
| Polar | polar | Open-source-friendly billing, pay-what-you-want, subscriptions |
Webhook handlers are implemented for all four providers with HMAC verification, idempotent processing (Redis dedup), and BullMQ retry with exponential backoff.
๐ฅ๏ธ Admin Dashboard
Completely overhauled admin experience at /admin:
- MRR, churn, growth, DAU/MAU stats with trend charts
- User impersonation with audit trail
- Feature flags (runtime toggles without redeploy)
- Plan overrides per org
- Trial extensions
- AI usage overview (tokens by provider, spend)
- Billing history and invoice download
- SEO metadata editor
- RBAC permissions matrix viewer
- Real-time notification stream
๐ Monitoring Stack (Prometheus + Grafana)
Production observability out of the box:
apps/apiexposes/metricsendpoint (Prometheusprom-client)- Pre-built Grafana dashboards covering API latency, p95/p99, request rates by route, error rates, BullMQ queue depth, DB connection pool, and AI token consumption
docker-compose.monitoring.ymlโ adds Prometheus + Grafana containers with pre-configured data sources and dashboards- Alerting rules for error rate spikes, queue backlogs, and certificate expiry
๐ง CLI Tool (packages/cli)
A saas-starter CLI for common operations, run via pnpm saas-starter:
pnpm saas-starter initโ interactive project initialization wizardpnpm saas-starter add <module>โ enable an optional modulepnpm saas-starter remove <module>โ disable an optional modulepnpm saas-starter doctorโ run 11 environment checkspnpm saas-starter deploy <platform>โ generate deployment config for Coolify, etc.
โ ๏ธ Always use
pnpm saas-starterinside the monorepo. Usingnpx saas-startermay download an unrelated package from the public npm registry.
๐ค MCP Server (packages/mcp)
Model Context Protocol server for AI agent integration:
- Exposes project context (routes, schema, config, plans) to AI coding tools
- Run with
pnpm mcpโ compatible with Cursor, Claude Code, Copilot Workspace, and other MCP clients - Provides real-time schema and route information so agents write correct factory calls and ESM imports
๐ง AI Factory (7 Providers)
Expanded from 4 to 7 AI providers, swappable via AI_PROVIDER:
| Provider | Env Value | Default Model |
|---|---|---|
| OpenAI | openai | gpt-4.1 |
| Anthropic | anthropic | claude-sonnet-4-20250514 |
| Google Gemini | gemini | gemini-2.5-pro |
| Groq | groq | llama-4-maverick |
| Cerebras | cerebras | llama-3.1-8b |
| Mistral | mistral | mistral-large-latest |
| Together | together | meta-llama/Llama-3.3-70B-Instruct-Turbo |
Streaming and non-streaming chat endpoints unchanged: POST /api/ai/stream and POST /api/ai/chat.
๐ณ Billing Webhooks (All 4 Providers)
Full webhook handler coverage for Stripe, Paddle, Lemon Squeezy, and Polar:
- HMAC signature verification per provider
- Idempotent event processing via Redis dedup
- BullMQ retry with exponential backoff for failed deliveries
- Events processed:
checkout.completed,subscription.created,subscription.updated,subscription.cancelled,subscription.renewed,payment.failed,payment.refunded - Admin UI for manual retry of failed webhook deliveries
๐ Dark / Light Theme with 27 Presets
Full theming system powered by CSS custom properties:
- System-preference detection with manual override toggle
- Smooth transitions between light and dark modes
- 27 preset color themes across 4 categories:
- B2B Corporate: Default (Indigo), Ocean, Forest, Fintech, Enterprise, Banking, Legaltech
- B2C Friendly: Rose, Amber, Pastel, Bubbly, Wellness, Edtech, Marketplace, Healthcare, Productivity
- Developer: Dracula, Terminal, GitHub, Monokai, Synthwave, Brutalist, Cyber Minimal
- VibeCoder: Neon, Retrowave, Aurora, Candy, Frost, Glass, AI Native
- Presets applied at runtime โ no rebuild required
- Per-org theme preference persisted in DB
๐จ Dynamic Branding System
Runtime-configurable branding without code changes:
saas-starter.config.tsโ top-level feature toggles, branding colors, module enablement- Logo, favicon, and OG image served from config
- Primary/accent colors propagated to all UI components including charts, buttons, and email templates
- Plan names and descriptions editable in
packages/shared/src/plans.ts
๐ Module Gating System
Fine-grained control over which features are active:
- Toggle SaaS modules on/off from the admin dashboard (
/admin/modules) or viasaas-starter.config.ts - Disabled modules vanish from navigation, routes return 404, and API endpoints are blocked โ no dead ends
- 13 built-in modules: AI, storage, roadmap, webhooks, referrals, waitlist, affiliates, feedback, customDomains, projects, announcements, blog, changelog
๐ก๏ธ Security Improvements
- Fail-close admin access โ if
ADMIN_UIDSenv var andadmin_userDB table are both empty, admin routes return 403 (previously fell through to open access) - Docker Secrets โ all sensitive environment variables (database passwords, API keys, secrets) can be loaded from Docker Secrets (
/run/secrets/<name>); supported inapps/api/src/config.ts - Stealth admin path โ configure a custom admin path via
ADMIN_PATHenv var (defaults to/admin). SetREQUIRE_ADMIN_PATH_COOKIE=truefor stealth 404 behavior. @types/bcryptjsremoved (deprecated; types ship withbcryptjsv3)
๐ Bug Fixes
- PostgreSQL 15+ schema permissions โ
setup-local.shnow grantsSCHEMA publictosaas-starteruser on the correct database for both macOS and Linux - Next.js build-time fetch hang โ
AbortController(3 s timeout) added to all build-timefetch()calls inpage.tsxanddemo/layout.tsx - Stripe API version literal โ updated to
'2026-03-25.dahlia'(Stripe SDK 22 requirement) - Recharts v3 formatter types โ tooltip formatter updated to handle
undefinedvalues - Nginx reverse proxy generation โ
scripts/setup-proxy.shandconfigs/nginx.conf.templateno longer emitmapinsideserverblocks, fixingnginx: "map" directive is not allowed here
๐ฆ Other Changes
apps/web/src/types/global.d.tsโ ambient module declarations for CSS/SVG/image imports (required by TS6)eslint.config.mjsโ ESLint 10 flat config with TypeScript, Next.js, and React Hooks rulesLICENSEโ Commercial Source License added to repository root
๐ Migration Guide
- Update env vars โ run
pnpm saas-starter doctorto validate; add any new provider keys (CEREBRAS_API_KEY,MISTRAL_API_KEY,TOGETHER_API_KEY,LEMONSQUEEZY_API_KEY,POLAR_ACCESS_TOKEN) - Run migrations โ
pnpm migrate - Fix Zod v4 โ search for
z.record(ValueType)and add explicit key schema:z.record(z.string(), ValueType) - Fix Vitest v4 โ convert arrow-function constructor mocks to
functionkeyword - Fix ESLint โ remove
.eslintrc*files; use the neweslint.config.mjs - Set
ADMIN_PATHโ configure a custom admin path or use the default/admin - Configure monitoring โ
docker compose -f docker-compose.yml -f docker-compose.monitoring.yml up -dto add Prometheus + Grafana