SaaS Boilerplate Specs
Production-ready Next.js 15 SaaS template with Supabase, Stripe, and i18n. Located at services/saas-boilerplate/
Tech Stack
Features
Authentication
Email/password, Google OAuth, MFA via email OTP, session management, email verification
Payments
Stripe subscriptions & one-time purchases, credit-based pricing, auto-topup, payment history
Internationalization
Multi-language support (EN/DE), URL-based language detection, full translation coverage
Blog & Learning Center
Blog posts with categories, learning center with tutorials, YouTube embeds, related posts
API Key Management
Generate, enable/disable, and delete API keys with usage tracking
Onboarding Flow
Multi-step onboarding wizard with industry/company size selection and progress tracking
Analytics
Sentry error tracking, PostHog product analytics, Google Analytics 4, usage statistics
Email System
SendGrid transactional emails, multi-language templates (OTP, password reset, notifications)
Theming
Dark/light mode with system detection, CSS variables, comprehensive color system
Responsive Design
Mobile-first approach, responsive layouts, mobile detection hooks
User Settings
Profile management, security settings, language & theme preferences, session tracking
Developer Experience
Turbopack dev server, ESLint, Zod validation, typed Supabase client, custom hooks
Database Schema (Supabase)
| Table | Description |
|---|---|
profiles | User accounts — name, email, phone, company, job title, onboarding status |
preferences | User settings — theme, language, privacy preferences |
security_settings | MFA config — email/phone MFA enabled, compliance settings |
credits | Credit balance — total, used, last topup date |
credit_purchases | Transaction history — amount, price, Stripe payment ID, status |
subscriptions | Subscription details — plan type, Stripe ID, status, renewal date |
usage_logs | Feature usage — feature name, credits consumed, timestamp |
api_keys | API keys — key hash, name, enabled flag, last used date |
payment_methods | Stripe cards — brand, last4, expiry, is_default |
verification_codes | OTP & reset tokens — code, type, expires_at |
Setup Guide
Navigate to the boilerplate
cd services/saas-boilerplateInstall dependencies
npm installConfigure environment
cp .env.local.example .env.local # then fill in your valuesStart dev server (port 3001)
PORT=3001 npm run devEnvironment Variables
26 variables required in .env.local. Injected automatically on deploy via individual SAAS_TEMPLATE_* GitHub Secrets.
App
NEXT_PUBLIC_URLSupabase
NEXT_PUBLIC_SUPABASE_URLNEXT_PUBLIC_SUPABASE_ANON_KEYSUPABASE_SERVICE_ROLE_KEYSUPABASE_JWT_SECRETStripe
STRIPE_ACCOUNT_IDNEXT_PUBLIC_STRIPE_PUBLIC_KEYSTRIPE_SECRET_KEYSTRIPE_WEBHOOK_SECRETSENDGRID_API_KEYSENDGRID_FROM_EMAILBOUNCER_API_KEYAnalytics
NEXT_PUBLIC_GA_MEASUREMENT_IDNEXT_PUBLIC_ENABLE_ANALYTICSNEXT_PUBLIC_POSTHOG_KEYNEXT_PUBLIC_POSTHOG_HOSTMonitoring
SENTRY_AUTH_TOKENSENTRY_DSNBETTER_STACK_SOURCE_TOKENBETTER_STACK_SOURCE_IDBETTER_STACK_INGESTION_HOSTCache
UPSTASH_REDIS_REST_URLUPSTASH_REDIS_REST_TOKENNewsletter
MAILERLITE_API_KEYMAILERLITE_NEWSLETTER_GROUP_IDConsent
NEXT_PUBLIC_COOKIEBOT_IDApp Routes
Auth
- /login
- /sign-up
- /forgot-password
- /reset-password
Protected
- /home
- /purchase
- /payment-history
- /api-keys
- /settings
- /usage
- /help-center
Public
- / (landing)
- /about
- /pricing
- /blog
- /learning-center
- /newsletter
- /affiliate-program