
Next.js SaaS Starter
A starter template for a subscription web app with login, Stripe payments, and a dashboard.nextjs/saas-starter
- Stars
- 16.2k
- Forks
- 2.8k
- Licence
- MIT
- Language
- TypeScript
- Last update
- 11 months ago
- Type
- Learning resource
What it is
This is a starter template for building a SaaS (software-as-a-service) web app with Next.js. It includes email and password login, Stripe checkout and subscription management, and a dashboard for logged-in users. The README describes it as intentionally minimal and meant as a learning resource rather than a finished product.
- Run a demo app locally with a seeded test user and team
- Test a Stripe checkout and subscription flow using Stripe's test card
- Study how middleware protects logged-in routes and Server Actions
- Adapt the dashboard with CRUD pages for users and teams
- Deploy the app to Vercel following the README's production steps
Great for
- Developers who want a working reference for combining Next.js, Postgres, and Stripe
- Students learning how authentication, payments, and dashboards fit together
- Developers who want shadcn/ui components already wired into a sample app
- Teams prototyping a subscription product before building custom features
Not ideal for
- People who need a complete, production-ready SaaS out of the box, since the README calls it intentionally minimal
- Non-developers, because setup requires running commands, editing environment variables, and configuring Stripe
- Projects that need a different database or payment provider, since the README only covers Postgres and Stripe
How to get it
- 1
Clone and build from source
You'll need: Node.js · pnpm · PostgreSQL database · Stripe account and Stripe CLI
Clone the repository
git clone https://github.com/nextjs/saas-starterEnter the project folder
cd saas-starterInstall dependencies
pnpm installCreate the .env file with the setup script
pnpm db:setup - 2
Run it
- Log in to Stripe with the Stripe CLI using stripe login
- Run pnpm db:migrate and pnpm db:seed to set up the database
- Start the dev server with pnpm dev
- Open http://localhost:3000 and sign in with the seeded test account, or create a user at /sign-up
- 3
Get the most out of it
- Use the Stripe CLI to forward webhooks locally to /api/stripe/webhook so subscription changes are handled
- Use the README's test card 4242 4242 4242 4242 to try checkout without real payments
- Review the Owner and Member roles to understand the basic RBAC setup
- Follow the production checklist to set the Stripe production webhook and environment variables before deploying to Vercel
Downloads
Strengths
- Covers many common SaaS pieces (auth, payments, roles, activity logs) in one codebase
- Uses widely adopted tools: Next.js, Postgres, Drizzle ORM, Stripe, and shadcn/ui
- MIT licensed and has a live demo to look at before installing
Trade-offs
- The README says it is intentionally minimal, so many features a real product needs are not included
- Requires a Stripe account, the Stripe CLI, and a Postgres database to run fully
- The README does not describe testing, scaling, or security hardening beyond the listed features
How it compares
| Project | Stars | Type | Level | Updated | Best for |
|---|---|---|---|---|---|
| saas-starter (this) | 16.2k | Learning resource | intermediate | 11 months ago | Developers who want a working reference for combining Next.js, Postgres, and Stripe |
| magicui | 23k | Library | intermediate | 4 days ago | React or Next.js developers who want animated landing-page elements |
| react-starter-kit | 23.7k | Learning resource | advanced | 4 days ago | Developers starting a SaaS-style web app who want a pre-built structure |
| trpc | 40.8k | Library | intermediate | 4 days ago | TypeScript teams building a web app where the frontend and backend are both written in TypeScript |
| blitz | 14.1k | Framework | intermediate | 12 months ago | Developers already comfortable with React and Next.js who want more built-in full-stack structure |
| next.js | 143k | Framework | intermediate | 4 days ago | Developers already comfortable with React who want a full framework around it |
Stats synced from GitHub. The assessment above was drafted with AI from the project's README on 2026-10-29 and may miss recent changes — check the README before relying on a command. MIT licence: free to use, modify and distribute, including commercially, as long as you keep the copyright notice.