Sales Intelligence

SaaS Boilerplate Specs

Production-ready Next.js 15 SaaS template with Supabase, Stripe, and i18n. Located at services/saas-boilerplate/

Tech Stack

Next.js 15React 18TypeScript 5SupabaseStripeTailwind 3.4shadcn/uiRadix UIZustandSentryPostHogSendGridFramer MotionReact Hook FormZod

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)

TableDescription
profilesUser accounts — name, email, phone, company, job title, onboarding status
preferencesUser settings — theme, language, privacy preferences
security_settingsMFA config — email/phone MFA enabled, compliance settings
creditsCredit balance — total, used, last topup date
credit_purchasesTransaction history — amount, price, Stripe payment ID, status
subscriptionsSubscription details — plan type, Stripe ID, status, renewal date
usage_logsFeature usage — feature name, credits consumed, timestamp
api_keysAPI keys — key hash, name, enabled flag, last used date
payment_methodsStripe cards — brand, last4, expiry, is_default
verification_codesOTP & reset tokens — code, type, expires_at

Setup Guide

1

Navigate to the boilerplate

cd services/saas-boilerplate
2

Install dependencies

npm install
3

Configure environment

cp .env.local.example .env.local # then fill in your values
4

Start dev server (port 3001)

PORT=3001 npm run dev

Environment Variables

26 variables required in .env.local. Injected automatically on deploy via individual SAAS_TEMPLATE_* GitHub Secrets.

App

NEXT_PUBLIC_URL

Supabase

NEXT_PUBLIC_SUPABASE_URLNEXT_PUBLIC_SUPABASE_ANON_KEYSUPABASE_SERVICE_ROLE_KEYSUPABASE_JWT_SECRET

Stripe

STRIPE_ACCOUNT_IDNEXT_PUBLIC_STRIPE_PUBLIC_KEYSTRIPE_SECRET_KEYSTRIPE_WEBHOOK_SECRET

Email

SENDGRID_API_KEYSENDGRID_FROM_EMAILBOUNCER_API_KEY

Analytics

NEXT_PUBLIC_GA_MEASUREMENT_IDNEXT_PUBLIC_ENABLE_ANALYTICSNEXT_PUBLIC_POSTHOG_KEYNEXT_PUBLIC_POSTHOG_HOST

Monitoring

SENTRY_AUTH_TOKENSENTRY_DSNBETTER_STACK_SOURCE_TOKENBETTER_STACK_SOURCE_IDBETTER_STACK_INGESTION_HOST

Cache

UPSTASH_REDIS_REST_URLUPSTASH_REDIS_REST_TOKEN

Newsletter

MAILERLITE_API_KEYMAILERLITE_NEWSLETTER_GROUP_ID

Consent

NEXT_PUBLIC_COOKIEBOT_ID

App 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