For the complete documentation index, see llms.txt. Prefer markdown by appending.mdto documentation URLs or sendingAccept: text/markdown.
Introduction
Start building with the TurboStarter web kit. Monorepo layout, auth, billing, database, and deployment patterns for production SaaS apps.
Welcome to the TurboStarter web documentation. This is your starting point for the Next.js app, shared API, and the product surfaces that live on the web - auth, billing, admin, marketing, and more.
What is TurboStarter?
TurboStarter is a fullstack starter kit for production SaaS. The web kit is the hub: Next.js frontend, serverless API, database, emails, and marketing - with mobile and browser extension apps sharing the same backend.
Looking to bootstrap quickly? Check out the TurboStarter CLI guide.
Demo apps
Try the live demos - web, mobile, and browser extensions:
Philosophy
- As simple as possible - easy to understand, easy to use, no overengineering.
- As few dependencies as possible - stay in control of every part of the project.
- As performant as possible - fast and light without unnecessary overhead.
Features
Web-first capabilities below. Most product features also ship on mobile and extension against the same API - those docs cover platform-specific pieces (push, store billing, content scripts, and so on).
For chatbots, agents, and image generation, see TurboStarter AI.
Authentication
Ready-to-use components and views
Pre-built authentication components and pages that match your brand.
Email/password authentication
Traditional email and password auth with validation and security best practices.
Magic links & OTP
Passwordless magic links and email one-time passwords with rate limiting.
Password recovery
Complete password reset flow with email verification and secure token handling.
Multi-factor authentication (MFA)
2FA with authenticator apps and TOTP - ready to use and customizable.
Passkeys (passwordless)
Passkeys (FIDO2/WebAuthn) for seamless, phishing-resistant sign-ins.
Anonymous & Google One Tap
Anonymous sessions and one-click Google One Tap on the web.
OAuth providers
Pre-configured social authentication for Google, GitHub, and Apple.
Organizations / teams
Multi-tenancy
Multi-tenant organization model with ownership and membership.
Teams and members
Create teams, invite members, assign roles, and manage seats.
Invitations
Email-based invites with role presets and expiry.
Roles per organization
Role-based permissions scoped to each organization.
Subdomain multi-tenancy
Map organizations to subdomains for B2B SaaS routing.
Billing
Subscriptions
Recurring plans with monthly/yearly intervals, trials, and upgrades.
One-time payments
Simple payment processing with secure checkout and confirmation.
Metered usage
Charge for API calls, tokens, or other usage with tiered pricing.
Per-seat billing
Price by team size with seats synced to organization membership.
Credits
Grant and consume prepaid balances for usage-based products and AI features.
Plan limits & entitlements
Gate features and quotas by plan - enforce access in the API and UI.
Organization billing
Bill users or organizations - B2B checkout, orders, and admin visibility.
Webhooks
Real-time billing events and payment provider synchronization.
Multiple providers
Unified API for Stripe, Lemon Squeezy, Polar, and Dodo Payments.
Database
Advanced querying
Type-safe SQL queries, relational joins, filters, ordering, and pagination.
Schema migrations
Automated schema migrations with version control and auto-generation.
PostgreSQL, MySQL & SQLite
Pick your engine - Postgres by default, with MySQL and SQLite guides.
Data validation
End-to-end validation using shared types and schema definitions.
API
Serverless architecture
Modern serverless infrastructure with auto-scaling and high availability.
Protected routes
Secure endpoints with role-based access control and rate limiting.
Feature-based access
Access control based on features and subscription plans.
Typesafe client
Fully typesafe frontend client with automatic type generation.
OpenAPI & API docs
Generate an OpenAPI spec and explore it with an interactive docs UI.
Admin
Super admin UI
Centralized admin workspace with overview metrics and quick actions.
User management
Search, filter, and manage users, status, auth methods, and MFA.
Roles and permissions
Granular access control for admins, moderators, and support staff.
Impersonation
Securely impersonate users to reproduce issues and provide support.
AI
Multiple providers
OpenAI, Anthropic, Groq, Mistral, Gemini, and more. For advanced AI, see TurboStarter AI.
Ready-to-use components
Pre-built chatbot and assistant components with real-time streaming.
Streaming responses
Real-time AI response delivery including progress indicators.
AI-assisted development
Rules, skills, and MCP setup so AI editors follow this repo's conventions.
Internationalization
Locale routing
Smart routing based on user locale and automatic language detection.
Multiple languages
Comprehensive multi-language support and translation management.
Language switching
One-click language changes and persistent preferences.
Mail templates
Multi-language email templates including fallback options.
Emails
Transactional emails
Automated email delivery including tracking and analytics.
Marketing emails
Create and send marketing campaigns using beautiful templates.
Email templates
Responsive email templates supporting dark mode customization.
Multiple providers
Resend, Mailgun, SendGrid, Postmark, Plunk, and Nodemailer.
Marketing & landing page
Hero & landing sections
Hero, features, pricing, testimonials, FAQ, and reusable CTAs.
SEO
Complete SEO toolkit including automatic sitemap generation.
Waitlist & newsletter
Pre-launch waitlist and homepage newsletter signup.
Onboarding flow
Dashboard onboarding wizard for first-run web users.
Blog
Full-featured blog system including categories and RSS feed.
Legal pages
Pre-built legal templates including version control.
Contact form
Smart contact form featuring spam protection and auto-responses.
Storage
File uploads
Complete file upload system including progress tracking and validation.
S3 storage
S3-compatible storage with presigned URLs and file optimization.
CMS
Blog pages
Complete blog management system including categories and tags.
MDX content collections
Organized content structure using MDX collections and custom frontmatter.
Theming
Built-in themes
10+ pre-built themes with customizable color schemes.
Dark mode
Built-in dark mode with system preference detection.
Components CLI
Component generation following best practices and TypeScript standards.
Design system
Complete atomic design system including accessibility features.
Analytics
Event tracking
Custom event tracking plus automatic session management.
Page views
Automatic page view capture including bounce rate metrics.
User identification
Cross-device user tracking and session management.
Multiple providers
Google Analytics, PostHog, Plausible, Umami, Open Panel, Vemetric, and more.
Cookie consent
c15t banner and preferences with analytics gated on measurement consent.
Feature flags
OpenFeature API
Provider-agnostic flag evaluation on client and server.
Multiple providers
In-memory defaults, PostHog, or GrowthBook via export swap.
Client and server evaluation
React hooks plus getBooleanValue in Server Components.
Targeting context
Signed-in user id, email, and name synced automatically.
Monitoring
Auto-capture exceptions
Automatically capture exceptions and errors in your application.
Track performance metrics
Track performance metrics such as page views, user sessions, and more.
Source maps
Automatically generate source maps to improve error reporting.
Multiple providers
Seamless integration with Sentry, PostHog, and more.
Security
Security overview
Threat model, boundaries, and how TurboStarter keeps the web kit safe.
Access control
Sessions, roles, and plan entitlements enforced on the server.
Secrets & validation
Env secrets, input validation, and integration hardening.
Security checklist
Ship-ready checks before you go to production.
Background tasks
Background jobs overview
Durable async work for emails, webhooks, and long-running workflows.
Trigger.dev
Type-safe background tasks with retries and observability.
Inngest & QStash
Event-driven and HTTP-based job runners as alternatives.
Vercel Workflows
Native Vercel workflows for durable multi-step jobs.
Deployment
Deployment checklist
Everything to verify before you ship to production.
Vercel, Cloudflare & more
Guides for Vercel, Cloudflare, Netlify, Docker, VPS, Fly, and others.
CI/CD workflows
Pre-configured deployment pipelines including automated testing.
Multiple environments
Dev, staging, and production configs across the monorepo.
Testing
Unit tests
Fast unit tests for individual functions and components.
Code coverage
Coverage metrics that show what code is and isn't tested.
E2E tests
Simulate real user scenarios across the stack with automated E2E tools.
Use like LEGO blocks
Use the entire stack or just the parts you need. Remove what you don't use without breaking the rest.
- Easy feature integration - plug new features in with minimal changes.
- Simplified maintenance - keep the codebase clean and maintainable.
- Core vs custom - distinguish kit features from your product logic.
- Additional modules - add billing, CMS, monitoring, mailer, and more as needed.
Scope of this documentation
This documentation focuses on TurboStarter's web kit - how to configure, run, and deploy it. For underlying libraries, follow the official docs linked from each section.
Enjoy!
Questions? Reach out at hello@turbostarter.dev.
Explore new features, build amazing apps, and have fun! 🚀
Tech Stack
Explore the web stack behind TurboStarter: Next.js, Hono, React Query, Better Auth, Drizzle, Tailwind, and shared monorepo packages.
CLI
Bootstrap a TurboStarter monorepo with the @turbostarter/cli package. Pick apps, providers, and naming in minutes instead of manual setup.
Extras
Tips, community links, and launch resources beyond the codebase. Practical extras that help you ship and grow your SaaS product.
FAQ
Answers to common TurboStarter web questions about setup, auth, billing, deployment, and day-to-day development.
How is this guide?
Last updated on