π Open-source SaaS starter that gets you to production fast without breaking the bank!
Introduction Β· Quick Start Β· Features Β· Tech Stack Β· Project Structure Β· Deployment Β· Roadmap Β· Author Β· Credits
Stop spending months building the same SaaS foundations. Turbocamp is a production-ready starter that ships with everything you need to launch your SaaS - authentication, payments, database, email, analytics, ai, logging, and more.
Built for indie hackers and startups who want to focus on their product, not infrastructure. Get from idea to paying customers in days, not months.
- ποΈ Complete SaaS Foundation - Auth, organizations, payments, database, email, analytics, ai, logging all working together
- π° Cost-Optimized - Open-source first approach keeps your expenses low while scaling
- π Multi-Platform Ready - Centralized API works with web, mobile, desktop, or any client
- π Production Security - Rate limiting, input validation, security headers built-in
- π Track your vitals - User analytics, error tracking, and performance monitoring
- π Global Ready - Multi-language support and optimized for worldwide audiences
- π Documentation Platform - Beautiful docs site with Fumadocs for user guides and API references
Freedom Over Vendor Lock-in: Own your data and infrastructure from day one. Start with open-source tools, upgrade to premium services only when your revenue justifies it.
Developer Experience: TypeScript everywhere, comprehensive testing, hot reloading, and tools that just work together.
Business Focus: Skip the months of setup and integration. Start building features that make you money.
Clone & create this repo locally with the following command:
npx Turbocamp@latest init my-saas-projectOr, deploy with Vercel:
Get up and running in under 5 minutes! We'll set up your Marketing Site, Dashboard, and API - the three core components that power your application.
π Architecture Note: Our centralized API structure makes this template incredibly flexible - you can easily add mobile apps (React Native/Expo), desktop apps (Electron), or any other client that needs to connect to your backend.
π Type-Safe Environment: Turbocamp uses @t3-oss/env-nextjs for type-safe environment variables. All env vars are validated at build time with full TypeScript support!
pnpm installWe use Prisma as our type-safe ORM with Neon for PostgreSQL hosting. Set up your database first since everything else depends on it.
# Copy database environment
cp packages/db/.env.example packages/db/.envEdit packages/db/.env and add your database URL:
DATABASE_URL="postgresql://username:password@localhost:5432/Turbocamp?schema=public"
# Or use Neon: postgresql://username:password@your-neon-url/turbocamp?schema=publicRun migrations to set up your database:
pnpm migrateYour API handles authentication, database operations, and serves all clients. It's the heart of your application.
# Copy API environment
cp apps/api/.env.example apps/api/.env.localEdit apps/api/.env.local and add your auth secret:
BETTER_AUTH_SECRET="your-32-character-secret-key-here"
BETTER_AUTH_URL="http://localhost:3002"
# Add your database URL here too
DATABASE_URL="your-database-url-from-step-2"Your dashboard is where authenticated users manage their accounts and access core features.
# Copy dashboard environment
cp apps/dashboard/.env.example apps/dashboard/.env.localEdit apps/dashboard/.env.local:
NEXT_PUBLIC_DASHBOARD_URL="http://localhost:3001"
NEXT_PUBLIC_WEB_URL="http://localhost:3000"
BETTER_AUTH_URL="http://localhost:3001"
BETTER_AUTH_SECRET="same-secret-from-api"
AUTH_API_URL="http://localhost:3002"Set up i18n for global reach. This is used by your web app for multi-language support.
# Copy i18n environment for multi-language support
cp packages/i18n/.env.example packages/i18n/.env.localYour marketing site showcases your product and converts visitors into users.
# Copy web environment
cp apps/web/.env.example apps/web/.env.localEdit apps/web/.env.local:
NEXT_PUBLIC_WEB_URL="http://localhost:3000"
NEXT_PUBLIC_DASHBOARD_URL="http://localhost:3001"
NEXT_PUBLIC_API_URL="http://localhost:3002"
AUTH_API_URL="http://localhost:3002"pnpm devπ You're live! Your applications are now running:
- Marketing Site: http://localhost:3000 - Your public-facing website
- Dashboard: http://localhost:3001 - Your main application for authenticated users
- API: http://localhost:3002 - Your centralized backend serving all clients
- Email Preview: http://localhost:3003 - Preview your email templates
- Database Studio: http://localhost:5555 - Visual database management
We use Content Collections for type-safe, file-based content management. Perfect for blogs, documentation, and marketing pages.
# Copy CMS environment (optional)
cp packages/cms/.env.example packages/cms/.env.localYour content lives in apps/web/content/ - edit .mdx files and see changes instantly!
Want to add documentation? We've got you covered with Fumadocs - a beautiful, fast documentation framework.
# Copy docs environment (optional)
cp apps/docs/.env.example apps/docs/.env.localpnpm dev --filter=docsYour docs will be available at: http://localhost:3004
π‘ Pro Tip: Use
pnpmfor best compatibility with monorepos. You can also usebunornpm, but pnpm is recommended for optimal performance.
Everything you need to launch and scale your SaaS. Here's what's included out of the box:
- Complete Auth System - Sign up, sign in, password reset, email verification
- Role-Based Access Control - Manage user permissions and organization access
- Session Management - Secure, scalable session handling across all devices
- Social Login Ready - Easy integration with Google, GitHub, and other providers
- Multi-Tenant Architecture - Built-in support for teams and organizations
- Organization Creation - Users can create up to 5 organizations
- Team Management - Invite members, manage roles (owner, admin, member)
- Organization Switching - Seamless context switching between organizations
- Member Permissions - Fine-grained access control at organization level
- Invitation System - Email-based invitations with expiration
- Organization Settings - Profile management, billing per organization
- Stripe Integration - Accept payments, manage subscriptions, and handle billing
- Multiple Payment Methods - Credit cards, digital wallets, and bank transfers
- Billing Portals - Let customers manage their own subscriptions and invoices
- Tax Calculation - Automatic tax handling for global customers
- User Behavior Tracking - Understand how users interact with your product
- Conversion Funnels - Track user journeys from signup to payment
- Business Metrics - Revenue, churn, growth, and engagement analytics
- Custom Events - Track specific actions important to your business
- Transactional Emails - Welcome, password reset, billing notifications
- Marketing Campaigns - Newsletters, product updates, and announcements
- Email Templates - Beautiful, responsive email designs ready to use
- Delivery Tracking - Monitor email opens, clicks, and deliverability
- Multi-language Support - Reach international markets with i18n
- Responsive Design - Perfect experience on mobile, tablet, and desktop
- SEO Optimized - Built-in metadata, JSON-LD, and search engine optimization
- Performance First - Fast loading, optimized images, excellent Core Web Vitals
- Rate Limiting - Protect against abuse and DDoS attacks
- Input Validation - Sanitize and validate all user inputs
- CORS Protection - Secure cross-origin requests
- Security Headers - Industry-standard security configurations
- CMS Integration - Type-safe, file-based content management
- Documentation Site - Beautiful docs with search, navigation, and theming
- Blog System - Ready-to-use blog for marketing and announcements
- Content Collections - Manage content with TypeScript safety
- Feature Flags - Control rollouts and A/B test features without deployments
- Error Tracking - Monitor and debug issues in production
- Performance Monitoring - Track application performance and bottlenecks
- Testing Suite - Comprehensive testing setup with fast unit tests
Every tool chosen for maximum developer productivity and minimal vendor lock-in. Here's what powers your SaaS and why:
- Next.js 15 β The React framework that scales with you. Server Components, App Router, and edge-ready.
- Turborepo β Monorepo done right. Caching, parallel builds, and shared packages that just work.
- TypeScript β Your safety net. Catch bugs at compile time, not in production.
- @t3-oss/env-nextjs β Type-safe environment variables. Validated at build time with Zod schemas.
- Better Auth β Open-source auth that doesn't break the bank. Type-safe, secure, and yours to control.
- Prisma β Database queries that feel like magic. Type-safe, auto-completing, and migration-ready.
- Tailwind CSS β Style without the mess. Utility-first CSS that speeds up development.
- shadcn/ui β Copy, paste, customize. Beautiful components built on Radix UI primitives.
- Lucide Icons β Crisp icons that look great at any size.
- Stripe β Global payments, subscriptions, and billing. Handle money like a pro.
- Resend β Email delivery built for developers. Transactional emails that actually arrive.
- PostHog β Product analytics you can self-host. Understand your users without the privacy concerns.
- Vitest β Testing that's actually fast. Write tests that run in milliseconds.
- Biome β Formatting and linting without the complexity. One tool, fast performance.
- Content Collections β Markdown content with TypeScript safety. Perfect for blogs and docs.
- Fumadocs β Beautiful documentation framework. Auto-generated navigation, search, and mobile-friendly.
One API to rule them all. Our centralized API architecture gives you superpowers - build once, connect everywhere.
Why centralized? Your API at localhost:3002 becomes the single source of truth for all your applications. Whether you're building a web app, mobile app, or desktop client, they all speak to the same backend.
graph TD
A[Web App<br/>localhost:3000] --> |"API Calls"| D[API Server<br/>localhost:3002]
B[Dashboard App<br/>localhost:3001] --> |"API Calls"| D
C[Mobile App<br/>Future] --> |"REST API"| D
D --> E[Better Auth<br/>Authentication]
D --> F[Prisma ORM<br/>Database]
D --> G[Stripe<br/>Payments]
E --> H[(PostgreSQL<br/>Database)]
F --> H
subgraph "Authentication Flow"
I[Sign Up/Sign In] --> J{Where?}
J -->|Web App| K[Auth Modal<br/>Quick & Easy]
J -->|Dashboard| L[Full Auth Pages<br/>Complete Experience]
K --> M[Redirect to Dashboard]
L --> N[Stay in Dashboard]
end
subgraph "Cross-Domain Sessions"
O[Session Cookie] --> P[.turbocamp.dev]
P --> Q[Shared across all apps]
Q --> R[Secure & Seamless]
end
style D fill:#e1f5fe
style E fill:#f3e5f5
style H fill:#e8f5e8
style K fill:#fff3e0
style L fill:#fff3e0
Best of both worlds. We've implemented a smart dual-auth approach that optimizes for different user journeys:
- Auth Modal - Quick signup/signin without leaving the page
- Perfect for conversions - Users can sign up instantly from CTA buttons
- Seamless experience - Modal opens, user signs up, gets redirected to dashboard
- Mobile-optimized - Works beautifully on all screen sizes
- Full Auth Pages - Complete signup/signin experience with proper navigation
- Enhanced UX - Welcome messages, forgot password flows, and cross-navigation
- Professional feel - Dedicated pages that feel like a complete application
- Accessibility first - Proper focus management and screen reader support
One login, everywhere access. Our session management works across all your applications:
// Your sessions work across all domains
const session = await auth.getSession();
// β
Works on web app (localhost:3000)
// β
Works on dashboard (localhost:3001)
// β
Works on API (localhost:3002)
// β
Works on production (.turbocamp.dev)Key Features:
- Secure cookies with proper SameSite and Secure flags
- Cross-subdomain sharing for seamless multi-app experience
- Automatic refresh - sessions extend automatically with activity
- Proper cleanup - logout clears sessions across all apps
Built for the future. Your API is RESTful and mobile-ready from day one:
# Your API endpoints work with any client
curl -X POST http://localhost:3002/api/auth/sign-up/email \
-H "Content-Type: application/json" \
-d '{"email": "user@example.com", "password": "securepass123"}'Perfect for:
- React Native apps - Use the same auth endpoints
- Flutter applications - REST API integration out of the box
- Third-party integrations - Webhook endpoints and API keys ready
- Desktop applications - Electron or Tauri apps can connect easily
Security is not an afterthought. Every API call is protected:
- CORS configured - Proper cross-origin request handling
- Rate limiting - Protect against abuse and DDoS attacks
- Input validation - Zod schemas validate all inputs
- Secure headers - CSRF protection and security headers
- Environment isolation - Different configs for dev/staging/production
Organized for growth. Our monorepo structure separates concerns while sharing code efficiently:
turbocamp/
βββ apps/ # Your Applications
β βββ web/ # π Marketing website - Convert visitors to customers
β βββ dashboard/ # π Main SaaS application - Where users live
β βββ api/ # π Centralized API - Powers all your clients
β βββ docs/ # π Documentation site - Help your users succeed
βββ packages/ # π¦ Shared Business Logic
β βββ base/ # π¨ UI components & design system
β βββ auth/ # π Authentication & authorization
β βββ db/ # ποΈ Database schema & queries
β βββ email/ # π§ Email templates & sending
β βββ cms/ # π Content management (Content Collections)
β βββ analytics/ # π User tracking & insights
β βββ payments/ # π³ Stripe integration & billing
β βββ storage/ # ποΈ File storage utilities
β βββ security/ # π‘οΈ Rate limiting & protection
β βββ logging/ # π Error tracking & monitoring
β βββ i18n/ # π Internationalization
β βββ seo/ # π― SEO utilities & metadata
β βββ feature-flags/ # π© Feature flag management
β βββ ai/ # π€ AI/LLM integrations
β βββ testing/ # π§ͺ Testing utilities & configurations
βββ tooling/ # π οΈ Development tools & configs
β βββ typescript-config/ # Shared TypeScript settings
β βββ next-config/ # Shared Next.js configurations
βββ scripts/ # βοΈ CLI tool & deployment scripts
Centralized API: All your business logic lives in one place. Add mobile apps, desktop clients, or third-party integrations without rewriting code.
Shared Packages: Write once, use everywhere. Your authentication, database queries, and UI components work across all applications.
Independent Deployment: Deploy each app separately. Scale your API independently from your marketing site.
Developer Velocity: New team members understand the structure instantly. Everything has its place.
Complete Documentation: Fumadocs powers your docs site with automatic navigation, full-text search, and beautiful theming.
From localhost to production in minutes. Choose your deployment strategy:
Why Vercel? Built by the Next.js team, optimized for our stack, and generous free tier.
- Connect your repository to Vercel
- Set environment variables in the Vercel dashboard
- Deploy - Vercel automatically builds and deploys your apps
npx vercelFull control over your infrastructure. Perfect for AWS, GCP, or your own servers.
# Build the application
docker build -t turbocamp .
# Run the container
docker run -p 3000:3000 turbocampFor custom hosting environments.
# Build all applications
pnpm build
# Start production server
pnpm startπ‘ Pro Tip: Each app can be deployed independently. Deploy your API to a serverless function, your marketing site to a CDN, and your dashboard to a container.
Building the future of SaaS development. Here's what's coming next:
- AI Chat Interface - Drop-in customer support and user assistance
- Smart Analytics - AI-powered insights and recommendations
- Content Generation - AI-assisted marketing copy and documentation
- Mobile App Template - React Native starter that connects to your API
- Desktop App Boilerplate - Electron template for desktop applications
- Browser Extension - Chrome/Firefox extension starter
- Advanced Multi-tenancy - Team workspaces and organization management
- Advanced Workflows - Automation, triggers, and business process management
- Compliance Pack - GDPR, CCPA, SOC2 compliance tools and documentation
- E-commerce Starter - Product catalog, inventory, and order management
- SaaS Marketplace - Multi-vendor platform with payments and reviews
- Learning Management - Course creation, student management, and progress tracking
Vote on features you want to see next in our GitHub Discussions!
Created by @droidsize in 2025, released under the MIT license.
Want to support this project? Give it a β on GitHub!
This project was inspired by and builds upon the excellent work of:
- Vercel next-forge - The original inspiration for this template
- Midday v1 - Another excellent turborepo template, inspiration for the project structure
- shadcn - For the amazing UI components and design system
Special thanks to the entire open-source community for creating the amazing tools that make this template possible.
Built with β€οΈ by Droidsize and the open-source community