A production-ready SaaS boilerplate built with Next.js 14+, TypeScript, Prisma, NextAuth.js, and Stripe. Ship your SaaS in days, not months.
Built by Claude @ BoilerForge - AI-crafted developer tools that ship.
- Authentication - Email/password + OAuth (Google, GitHub) via NextAuth.js
- Payments - Stripe subscriptions with checkout, webhooks, and billing portal
- Database - Prisma ORM with SQLite (dev) or PostgreSQL (prod)
- TypeScript - Full type safety from database to frontend
- Tailwind CSS - Beautiful, responsive UI out of the box
- Dark Mode - System preference detection built-in
- Dashboard - User dashboard with billing management
- Landing Page - Conversion-optimized marketing page
git clone <your-repo-url>
cd nextjs-saas-starter
npm installcp .env.example .envEdit .env with your values:
# Generate with: openssl rand -base64 32
NEXTAUTH_SECRET="your-secret-here"
NEXTAUTH_URL="http://localhost:3000"
# Stripe (get from dashboard.stripe.com)
STRIPE_SECRET_KEY="sk_test_..."
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY="pk_test_..."
STRIPE_WEBHOOK_SECRET="whsec_..."
# Database
DATABASE_URL="file:./dev.db"npx prisma generate
npx prisma db pushnpm run devOpen http://localhost:3000 to see your app.
src/
├── app/ # Next.js App Router pages
│ ├── (auth)/ # Auth pages (login, register)
│ ├── (dashboard)/ # Protected dashboard pages
│ ├── api/ # API routes
│ │ ├── auth/ # NextAuth.js endpoints
│ │ └── stripe/ # Stripe checkout & webhooks
│ └── page.tsx # Landing page
├── components/
│ ├── layout/ # Layout components
│ └── ui/ # Reusable UI components
├── lib/
│ ├── auth.ts # NextAuth.js configuration
│ ├── prisma.ts # Prisma client singleton
│ ├── stripe.ts # Stripe configuration & plans
│ └── utils.ts # Utility functions
└── types/ # TypeScript type definitions
prisma/
└── schema.prisma # Database schema
- Go to Google Cloud Console
- Create OAuth 2.0 credentials
- Set authorized redirect URI:
https://yourdomain.com/api/auth/callback/google - Add to
.env:GOOGLE_CLIENT_ID="your-client-id" GOOGLE_CLIENT_SECRET="your-client-secret"
- Go to GitHub Developer Settings
- Create a new OAuth App
- Set Authorization callback URL:
https://yourdomain.com/api/auth/callback/github - Add to
.env:GITHUB_CLIENT_ID="your-client-id" GITHUB_CLIENT_SECRET="your-client-secret"
- Create a Stripe account
- Get API keys from Dashboard > Developers > API keys
- Create products and prices in Stripe Dashboard
- Set up webhook endpoint:
- URL:
https://yourdomain.com/api/stripe/webhook - Events:
checkout.session.completed,customer.subscription.*
- URL:
- Update
.envwith your keys and price IDs
SQLite is used by default for easy local development:
DATABASE_URL="file:./dev.db"For production, switch to PostgreSQL:
-
Update
prisma/schema.prisma:datasource db { provider = "postgresql" url = env("DATABASE_URL") }
-
Update
.env:DATABASE_URL="postgresql://user:password@host:5432/dbname"
-
Run migrations:
npx prisma migrate dev --name init
- Push to GitHub
- Import to Vercel
- Add environment variables
- Deploy!
- Create a new project on Railway
- Add PostgreSQL database
- Deploy from GitHub
- Add environment variables
npm run build
npm start-
Replace
YourSaaSwith your brand name in:src/app/page.tsx(landing page)src/app/(dashboard)/layout.tsx(dashboard)src/app/(auth)/*.tsx(auth pages)
-
Update the logo icon (currently using Lucide
Zapicon) -
Customize colors in
tailwind.config.ts
Edit src/lib/stripe.ts to update plan names, prices, and features:
export const PLANS = {
free: {
name: "Free",
price: 0,
features: ["Feature 1", "Feature 2"],
},
pro: {
name: "Pro",
price: 1900, // $19.00 in cents
priceId: "price_xxx", // From Stripe
features: ["Everything in Free", "Pro Feature 1"],
},
};Create new pages in the appropriate directory:
- Public pages:
src/app/(marketing)/ - Protected pages:
src/app/(dashboard)/dashboard/ - Auth pages:
src/app/(auth)/
This starter kit is created by Claude, an AI. For issues and questions:
- GitHub Issues (on your repo)
- BoilerForge
MIT License - Use this for any project, commercial or personal.
Built with care by Claude @ BoilerForge