A comprehensive SaaS starter template built with Next.js 15, designed to accelerate the development of AI-powered SaaS applications with modern best practices and scalable architecture.
A Lean Starter Template for building a SaaS with authentication, payments, and AI.
git clone <your-repo-url>
cd <repo-folder>
pnpm install
cp .env.example .env.local
Fill in .env.local with your credentials:
DATABASE_URL
NEXTAUTH_SECRET
BETTER_AUTH_URL
OAuth: AUTH_GITHUB_ID, AUTH_GITHUB_SECRET, etc.
OPENAI_API_KEY
Stripe: STRIPE_SECRET_KEY, STRIPE_PUBLISHABLE_KEY, STRIPE_WEBHOOK_SECRET
Optional: NEXT_PUBLIC_APP_URL, NEXT_PUBLIC_GA_MEASUREMENT_ID, SMTP settings, THEME, etc.
Then:
bash
Copy code
pnpm db:generate
pnpm db:migrate
pnpm seed # optional
pnpm dev
App runs at http://localhost:3000.Feature What to Edit Path(s) Brand & Theme Copy themes/base β themes/your-brand, adjust CSS, update THEME env themes/β¦, next.config.ts Auth / OAuth Providers Add provider in config & add env vars src/lib/auth/config.ts Database / Models Add tables in schema, relations, then regenerate & migrate src/db/schema.ts Stripe / Payments Create products in Stripe, sync or customize logic, webhook handlers src/lib/stripe/, src/app/api/stripe/webhook/route.ts AI / Chat Edit model, system prompts, user context logic src/app/api/chat/route.ts, chat UI files SEO / Metadata / Analytics Update metadata in layout & analytics logic src/app/layout.tsx, src/lib/analytics.ts Pages / Content Add blog posts (MDX) or custom pages under src/app/ src/content/blog/, src/app/(marketing)/β¦
Copy all .env.local variables into your production/hosting environment.
Ensure OAuth redirect URLs & Stripe webhook URLs reflect your production domain.
Run database migrations before starting.
For Vercel, you can use their dashboard or one-click deploy; ensure environment variables and functions are configured correctly.
OAuth redirect errors β ensure callback URLs match domain & env settings
Database connection issues β check DATABASE_URL, ensure DB is running
Stripe webhook failures β verify webhook secret & event handling
Chat / AI not working β check OPENAI_API_KEY is valid
pnpm dev β start development
pnpm build && pnpm start β build & run
pnpm lint / pnpm check-types β linting / type checking
pnpm analyze β bundle analysis
pnpm db:studio β DB exploration tool



