GitHub login (Google optional), with OAuth implemented via arctic and cookie sessions with rotation
saas-starter — Next.js SaaS Template
By GenPM-net
A Next.js-based SaaS starter template that integrates GitHub login, Stripe subscriptions, plan entitlement gating, transactional email and Postgres/Drizzle, with backend logic kept as TypeScript source in src/lib.
Explore the design
Compare the page layouts and mobile experience. Open any screenshot for a closer look.
Actual screenshot captured by the server browser.
All pages & views 2
Screenshots show visual appearance; interactive behavior may differ.
What stands out
A quick read of the recorded project description.
Stripe subscriptions with checkout, customer portal and idempotent webhooks, with subscription state mirrored to Postgres
Server-side plan entitlement checks via hasEntitlement(user, 'pro')
A React Email welcome email sent through Resend on first login, output to the console in development
A Postgres + Drizzle data layer, with a separate schema.ts per module and migration files in drizzle/
Each module includes an AGENTS.md so tools such as Claude Code, Cursor, Copilot and Codex understand how to use it
Template Details
This template targets SaaS applications that need subscription billing set up quickly. The README states that it includes GitHub login (Google optional), Stripe subscriptions (checkout, customer portal, idempotent webhook sync to Postgres), plan entitlement gating (checked via hasEntitlement), a welcome email sent on first login (printed to the console in development), a Postgres + Drizzle data layer, and module documentation files prepared for AI coding agents. Backend code lives in src/lib and can be modified directly.
Before use you need a Postgres database, a GitHub OAuth app, Stripe test keys and several environment variables, and you must run Drizzle migrations. Local development requires forwarding Stripe webhook events. The README also describes installing additional modules (such as RBAC, storage and task queues) through GenPM, but the template itself does not include these modules. The template does not document complete production deployment steps, performance metrics or security audits; it only provides a Vercel deploy button and an MIT license.
Is it right for your project?
Use Cases
- Starting a SaaS project with GitHub login and Stripe subscription billing quickly
- Keeping backend auth, billing and email logic as readable TypeScript source that can be modified directly
- Working with AI coding assistants and wanting modules with clear documentation to guide changes
- Syncing Stripe subscription state to your own Postgres database and enforcing plan entitlements
Suitable For
- Developers familiar with Next.js, TypeScript and Postgres
- Teams that need a subscription SaaS foundation rather than a complete finished product
- Projects willing to configure GitHub OAuth, Stripe and an email service themselves
Getting started & customization
Use these recorded setup notes alongside the repository instructions for your chosen version.
- 1
Get the code via npx degit or GitHub's Use this template, then run npm install
- 2
Copy .env.example to .env.local and fill in variables such as DATABASE_URL, AUTH_SECRET, GitHub OAuth credentials, Stripe test keys, STRIPE_PRICE_PRO and APP_URL
- 3
Run the Drizzle migration command to initialize the database, then run npm run dev
- 4
During local development, forward Stripe events with stripe listen --forward-to localhost:3000/api/stripe/webhook
- 5
Production requires RESEND_API_KEY and EMAIL_FROM; in development emails are printed to the console
License & source material
Usage conditions & limitations
Free to use · keep license noticeThis listing covers the free version in the public repository under the MIT license; the free scope is that version's code and does not mean external services or third-party assets are free.
Must comply with when using
- The code of this version may be used, modified, used commercially and distributed free of charge.
- When distributing copies or substantial portions of the code, the original author's copyright notice and the full MIT license notice must be retained.
- The code is provided as is; warranties and limitations of liability are governed by the original license and applicable law.
Additional costs & items to verify
- Demo images, fonts, icons and other third-party assets must be checked against their own licenses; the code's MIT license alone does not determine their terms.
- External services such as domains, hosting, databases, payments or AI may incur separate charges.
- You must supply your own Postgres database (local, Neon, Supabase or RDS all work); the template itself does not provide a database service.
- You must create a GitHub OAuth app yourself and provide GITHUB_CLIENT_ID and GITHUB_CLIENT_SECRET, with the callback URL set to <APP_URL>/auth/callback/github.
- You must supply your own Stripe test-mode keys and webhook secret, and configure the webhook endpoint and specified events.
- You must create a Stripe monthly Pro price yourself and provide its price_… identifier.
- Production must configure RESEND_API_KEY and EMAIL_FROM; development may omit them, and emails are only printed to the console.
- Local development requires running stripe listen to forward Stripe events to /api/stripe/webhook; otherwise subscription state cannot sync.
- You must run the Drizzle migration command to initialize the database schema before use.
- Additional modules such as RBAC, storage and task queues must be installed separately through GenPM; the template itself does not include these modules.
- Installing additional modules requires the GenPM install script or CLI, which is an external tool dependency.
- Each module under src/lib includes its own LICENSE file, and its license notice must be retained when using or redistributing it.
View Original Text Basis
Permission is hereby granted, free of charge
Original License Text
| `DATABASE_URL` | Any Postgres: local, [Neon](https://neon.tech), Supabase, RDS. |
Original README
| `GITHUB_CLIENT_ID`, `GITHUB_CLIENT_SECRET` | A [GitHub OAuth app](https://github.com/settings/developers) with callback `<APP_URL>/auth/callback/github`. |
Original README
| `STRIPE_SECRET_KEY`, `STRIPE_WEBHOOK_SECRET` | Test-mode keys. Webhook endpoint `<APP_URL>/api/stripe/webhook` with `checkout.session.completed` and `customer.subscription.created/updated/deleted`. |
Original README
| `STRIPE_PRICE_PRO` | The `price_…` id of your monthly Pro price. |
Original README
| `RESEND_API_KEY`, `EMAIL_FROM` | Optional in development (emails are printed). Required in production. |
Original README
Locally, forward Stripe events: `stripe listen --forward-to localhost:3000/api/stripe/webhook`.
Original README
node --env-file=.env.local node_modules/drizzle-kit/bin.cjs migrate --config src/lib/db/drizzle.config.ts
Original README
genpm add @core/rbac @core/storage @core/jobs
Original README
curl -fsSL https://genpm.net/install.sh | sh # or: npx @genpm-net/cli <command>
Original README
https://github.com/GenPM-net/saas-starter/blob/main/LICENSEhttps://github.com/GenPM-net/saas-starter/blob/main/README.mdMIT. The modules in `src/lib` are MIT as well (see each `LICENSE`).
Original README
Compiled by DeepSeek based on repository license and README ·2026-10-17. Results only cover the materials read; dependencies, images, fonts, and subsequent term changes are subject to their respective original texts.
Project checks & description sources
Template Information
- Source platforms
- GitHub
- Documentation and maintenance reference score
- More documented · 85 / 100
- Technologies
- Next.js · React
- Website type
- SaaS · Starter
How this score is calculated
Our heuristic uses license records (up to 30), a demo link (12), a preview (10), stars (15), recorded maintenance (15), description completeness (8), feature records (5) and classification data (5). It is not a code, security or performance test, or a Google score. A link does not establish tested functionality.
What to verify for this project
- Repository update recorded
- 2026-10-16
- Screenshot last checked
- 2026-10-17
A demo link is listed. Check it with your own content and viewport sizes; its presence does not confirm that forms, authentication or payments work.
The catalog identifies Next.js as the primary stack. Check the actual dependency manifest and lockfile for versions and hosting requirements. These notes use recorded metadata, not a code audit or a deployment test.
Use a selection guide →How this description was prepared
AI-assisted description based on catalog records and repository material. Repository authors are not automatically the reviewers of this description.
Review declaration: codex-user-requested-batch-review-20261018 · 2026-10-18
Inspect the recorded source material
SHA-256: b67aae9f102d833174c46aa1352749d0101cd249cff566276ac4597fc13abc1d
2026-10-17T01:55:12.739Z
Source file / repository# Next.js SaaS Starter **Next.js 16 + GitHub login + Stripe subscriptions + plan gating + transactional email + Postgres/Drizzle.** No auth library to configure, no billing SDK to learn: the whole backend is plain TypeScript in `src/lib`, readable and yours to change, installed with [GenPM](https://genpm.net) and pinned to verified commits. [](https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2FGenPM-net%2Fsaas-starter&env=DATABASE_URL,AUTH_SECRET,GITHUB_CLIENT_ID,GITHUB_CLIENT_SECRET,STRIPE_SECRET_KEY,STRIPE_WEBHOOK_SECRET,STRIPE_PRICE_PRO,APP_URL&envDescription=Postgres%20URL%2C%20a%2032-char%20AUTH_SECRET%2C%20a%20GitHub%20OAuth%20app%20and%20Stripe%20test%20keys&envLink=https%3A%2F%2Fgithub.com%2FGenPM-net%2Fsaas-starter%23environment-variables&project-name=saas-starter&repository-name=saas-starter)  ## What's included | Feature | Where | How | |---|---|---| | GitHub login (Google optional) | `src/lib/auth` | Cookie sessions with rotation, OAuth via [arctic](https://arcticjs.dev). Routes in `src/app/auth`. | | Stripe subscriptions | `src/lib/billing`, `src/lib/stripe` | Checkout, customer portal, idempotent webhooks mirrored into Postgres. | | Plan gating | `src/lib/billing/plans.ts` | `await hasEntitlement(user, 'pro')` anywhere on the server. | | Welcome email | `src/lib/email` | React Email templates sent with Resend on first login (console in development). | | Postgres + Drizzle | `src/lib/db` | One client, a `schema.ts` per module, migrations in `drizzle/`. | | Rules for your AI agent | `src/lib/*/AGENTS.md` | Claude Code, Cursor, Copilot and Codex know how each module works before changing it. | ## Quick start ```bash npx degit GenPM-net/saas-starter my-saas && cd my-saas # or "Use this template" on GitHub npm install cp .env.example .env.local # fill it in (see below) node --env-file=.env.local node_modules/drizzle-kit/bin.cjs migrate --config src/lib/db/drizzle.config.ts npm run dev ``` Open http://localhost:3000, sign in with GitHub, then upgrade with Stripe's test card `4242 4242 4242 4242`. Locally, forward Stripe events: `stripe listen --forward-to localhost:3000/api/stripe/webhook`. ## Environment variables | Variable | What | |---|---| | `DATABASE_URL` | Any Postgres: local, [Neon](https://neon.tech), Supabase, RDS. | | `AUTH_SECRET` | 32+ random chars: `openssl rand -base64 32`. | | `GITHUB_CLIENT_ID`, `GITHUB_CLIENT_SECRET` | A [GitHub OAuth app](https://github.com/settings/developers) with callback `<APP_URL>/auth/callback/github`. | | `STRIPE_SECRET_KEY`, `STRIPE_WEBHOOK_SECRET` | Test-mode keys. Webhook endpoint `<APP_URL>/api/stripe/webhook` with `checkout.session.completed` and `customer.subscription.created/updated/deleted`. | | `STRIPE_PRICE_PRO` | The `price_…` id of your monthly Pro price. | | `APP_URL` | Public URL of the app (used in emails). | | `RESEND_API_KEY`, `EMAIL_FROM` | Optional in development (emails are printed). Required in production. | ## Add more modules Need roles and permissions, file uploads, background jobs, a blog or a whole store? ```bash curl -fsSL https://genpm.net/install.sh | sh # or: npx @genpm-net/cli <command> genpm search roles genpm add @core/rbac @core/storage @core/jobs ``` Or ask your agent: run `genpm mcp setup` once, then *"add role-based access control with genpm"*. Every install shows a dry-run plan first, never runs install scripts, and lands as source code you own. `genpm outdated` and `genpm update` bring module updates in with a three-way merge that keeps your edits. Browse the catalog at [genpm.net](https://genpm.net). ## How this template was made ```bash npx create-next-app@latest saas-starter --ts --app --src-dir --tailwind --eslint genpm add @core/billing @core/email --install-deps # pulls @core/auth, @core/db and @core/stripe ``` Then the integration steps from each module's `AGENTS.md`: route handlers in `src/app`, the price → feature map in `plans.ts`, `allowImportingTsExtensions` in `tsconfig.json`, and the landing and account pages. `genpm.lock` records the exact commit of every module. ## License MIT. The modules in `src/lib` are MIT as well (see each `LICENSE`).
Explore similar templates
Compare previews and descriptions within the same stack and category.

Next.js SaaS Starter
The official Next.js SaaS starter template, integrating email/password authentication, Stripe Checkout subscriptions, a dashboard with user/team CRUD, basic Owner/Member RBAC, and activity logging.
Next.js · SaaS

Next.js Commerce
Vercel's officially maintained Next.js App Router ecommerce starter with deep Shopify integration, offering a complete product catalog, cart, and checkout flow. Core logic is modular for swapping backends, and community provider versions exist for BigCommerce, Medusa, and Saleor.
Next.js · E-commerce

Next-js-Boilerplate
A developer-first Next.js 16 starter with Tailwind CSS 4 and TypeScript, supporting both App Router and Page Router.
Next.js · Starter

tailwind-nextjs-starter-blog
A Next.js and Tailwind CSS blog starter template using Contentlayer for Markdown/MDX, with built-in SEO, code highlighting, and tags. It targets personal technical blogs and migration from Jekyll/Hugo to React, and supports one-click Vercel deployment.
Next.js · Blog

next-forge
next-forge is a Turborepo-based Next.js template maintained by Vercel, positioned as a starting point for SaaS products.
Next.js · Starter

SaaS-Boilerplate
SaaS-Boilerplate is an open-source SaaS starter template built with Next.js App Router, React 19, TypeScript, Tailwind CSS, and Shadcn UI.
Next.js · SaaS
