Introduction
Start building on the GenerateSaaS Next.js boilerplate with a shared Hono backend and flag-gated features.
GenerateSaaS is a production-ready SaaS boilerplate: this Next.js 16 frontend (apps/web-next) runs on a shared Hono backend (@repo/api), and every feature is gated by a flag in the config object in packages/config/src/index.ts. Pick the features you need, flip them on, ship.
Features
Each capability ships as a @repo/* package behind a config flag.
Auth & access
Authentication
Email/password, social OAuth, 2FA, passkeys via Better Auth.
API Keys
Per-user keys for programmatic API access, rate-limited by plan.
CAPTCHA
Cloudflare Turnstile bot protection on auth and public forms.
Billing
Payments
Stripe or Polar subscriptions - config.payment.
Plans & Pricing
Subscription tiers, prices, and currencies in pricingConfig.
Credits
Prepaid, metered usage balances on top of billing.
One-time Products
Single-purchase items with ownership checks.
Organizations
Multi-tenant teams - config.tenancy.multiTenant.
Messaging
Transactional + marketing mail - config.email.
Newsletter
Daily sync of opted-in users to Listmonk or Resend.
SMS
Twilio text messaging - config.sms.
Notifications
In-app + email channels - config.notifications.
Admin Notifications
Operator alerts to Discord, Slack, or Telegram.
Storage & data
Storage
S3-compatible file uploads - config.storage.
Database
Drizzle + Postgres schema, migrations, and auth tables.
Caching
Redis-backed cache layer.
Backend & platform
API
Typed Hono RPC backend - config.apiDocs serves Scalar docs.
Background Jobs
Inngest functions for billing and lifecycle.
i18n
Localized routing and messages via next-intl.
Performance Monitoring
Per-request Hono timing - method, path, status, duration.
Content & growth
Blog
MDX marketing blog - config.blog.
Marketing & SEO
Prerendered landing, structured data, sitemap, robots.
Waitlist
Pre-launch signup capture - config.waitlist.
Onboarding
Post-signup profile step + welcome email sequence.
Banners
Site-wide and dashboard announcement bars - config.banner.
Integrations
Analytics
Umami page analytics - config.analytics.
Support Chat
Crisp live-chat widget - config.support.
Affiliate Tracking
Referral attribution and payouts.
Cookie Consent
GDPR-aware consent banner gating third parties.
AI & ops
AI
LLM features via @repo/ai.
Audit Logs
Activity trail via @repo/audit.
CLI
Scaffold, eject, and license generated projects.
Dashboard & Settings
Authenticated dashboard with flag-gated settings and admin.
Deployment
Vercel, Docker, and self-hosting targets.
Config-flag philosophy
The config object in packages/config/src/index.ts is the single source of truth for what your app exposes, read by both the frontend and the backend. Most features are a discriminated union { enabled: false } | { enabled: true; ... }; flip the flag and routes, sidebar entries, UI, and API surface appear or disappear together.
| Flag state | Behavior |
|---|---|
enabled: true | Feature renders, its routes mount, its @repo/* package runs. |
enabled: false | UI hidden, routes skipped, backend paths short-circuit - no setup required, no dead code to remove. |
Shipped defaults: nearly everything is on - payment (stripe), storage (s3), sms (twilio), email (smtp), newsletter (listmonk), captcha (turnstile), plus notifications, blog, apiKeys, apiDocs, and tenancy.multiTenant. The only feature off by default is waitlist (the lone top-level boolean shipped as false; signups create real accounts).
Not every flag is enabled-shaped: apiDocs and waitlist are plain booleans, tenancy toggles on multiTenant, and analytics/support/affiliate activate by the presence of a provider key (e.g. umami, crisp). email has no off switch - it is always on; you only pick its provider. Swappable vendors (payment, storage, email, sms, newsletter, captcha) are chosen via the provider value plus matching env vars.
These docs are AI context
This /docs tree does double duty: it renders as the Fumadocs site (apps/docs, gated by config.docs.enabled) and ships into every generated project as AI-agent context. Cited config keys, @repo/* names, and file paths are real, so a coding agent can act on them directly.
Frequently asked questions
Can I use one feature without the others?
Yes. Each capability is an independent @repo/* package behind its own config flag - enable only what you need.
What's the difference between config.payment and config.tenancy?
config.payment toggles billing (Stripe or Polar); config.tenancy.multiTenant toggles organizations and team membership. They're independent flags.
Where do I change which features are on?
Edit packages/config/src/index.ts. See Configuration for every flag and its options.