Next.jsReactSaaSStarter

rovidev-saas-starter — Next.js SaaS Template

By rovidev95

A multi-tenant SaaS starter built on Next.js App Router, including organizations, RBAC, plan limits, Stripe subscriptions and idempotent webhooks.

Explore the design

Compare the page layouts and mobile experience. Open any screenshot for a closer look.

3 previews
Desktop homepage1 / 3
Desktop captureTop of page

Actual screenshot captured by the server browser.

All pages & views 3

Screenshots show visual appearance; interactive behavior may differ.

Recorded 2026-10-03View source

What stands out

A quick read of the recorded project description.

01

Tenant model is User ↔ Membership ↔ Organization, and tenant pages uniformly verify membership via getOrgContext(slug)

02

RBAC defines three roles—OWNER / ADMIN / MEMBER—mapped to a permissions module

03

Plan seat and project limits are enforced server-side

04

Stripe checkout, customer portal, and webhook are all included; the webhook records the event id before processing to avoid duplicate side effects

05

Email-password authentication uses bcrypt and JWT session cookies signed by jose

06

Provides a CI workflow and unit tests covering rbac, plans, billing, and slug

Template Details

This is a multi-tenant SaaS skeleton built with Next.js App Router, covering the infrastructure most SaaS applications need at the start: authentication, organizations, role-based access control, plan limits, and Stripe subscription webhooks with idempotent handling. The tenant model is User ↔ Membership ↔ Organization, and all tenant-scoped pages verify that the user actually belongs to the organization via getOrgContext(slug). RBAC defines three roles—OWNER / ADMIN / MEMBER—mapped to permissions in src/lib/rbac.ts. Plan seat and project limits are enforced server-side, with logic in src/lib/plans.ts. Authentication uses email plus password, with bcrypt and JWT session cookies signed by jose. The Stripe part includes checkout, customer portal, and a webhook that records the event id before processing to avoid compounding side effects from duplicate deliveries. The repository includes a CI workflow and unit test scripts covering business logic such as rbac, plans, billing, and slug. The demo site is hosted on Render's free tier; after idle periods, the first request may take about 50 seconds to wake up. The demo account is [email protected] / password123, and the test card number is 4242 4242 4242 4242. The code is MIT licensed, but third-party assets such as demo images, fonts, and icons must be checked separately under their respective licenses; external services such as domain, hosting, database, and payment may incur separate charges.

Next.jsSaaSStarter

Is it right for your project?

Use Cases

  • Quickly building a multi-tenant SaaS backend with organization and member management
  • Integrating Stripe subscriptions, customer portal, and idempotent webhook handling into a product
  • Enforcing seat and project limits by plan on the server side
  • Needing a runnable, testable full-stack starting point with Next.js App Router

Suitable For

  • Developers preparing to build a multi-tenant SaaS from scratch
  • Teams needing a reference implementation for Stripe subscriptions and webhook idempotency
  • Projects intending to build upon MIT-licensed code for further development

Getting started & customization

Use these recorded setup notes alongside the repository instructions for your chosen version.

  1. 1

    Copy .env.example to .env and set DATABASE_URL and AUTH_SECRET

  2. 2

    Start Postgres with docker compose up -d db, or provide your own database

  3. 3

    Run npm install, npx prisma migrate dev, npm run db:seed, then npm run dev in sequence

  4. 4

    For Stripe, create two recurring prices and fill them into STRIPE_PRICE_PRO and STRIPE_PRICE_SCALE

  5. 5

    For local development, forward events with stripe listen --forward-to localhost:3000/api/stripe/webhook

Read repository instructions

License & source material

Usage conditions & limitations

Free to use · keep license notice

This entry covers the free version under the MIT license in the public repository; the free scope is the code of this version and does not mean external services or third-party assets are free.

Must comply with when using

  • Free use, modification, commercial use, and distribution of this version's code are permitted.
  • When distributing copies or substantial portions of the code, retain the original author's copyright notice and the full MIT license notice.
  • 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

  • Using Stripe subscription features requires creating two recurring prices yourself and filling the price IDs into the STRIPE_PRICE_PRO and STRIPE_PRICE_SCALE environment variables; Stripe is an external paid service and may incur charges.
  • Before running, you must configure the DATABASE_URL and AUTH_SECRET environment variables and prepare a PostgreSQL database yourself (you can start one with docker compose or provide your own).
  • Local development of Stripe webhooks requires installing and using the Stripe CLI to forward events, depending on a Stripe account and external services.
  • The official demo site is hosted on Render's free tier; after idle periods, the first request may take about 50 seconds to wake up, affecting only the demo experience, not self-hosted code.
  • Demo images, fonts, icons, and other third-party assets must be checked under their respective licenses; the code's MIT license alone is not sufficient to judge them.
  • External services such as domain, hosting, database, payment, or AI may incur separate charges.
View Original Text Basis

Permission is hereby granted, free of charge

Original License Text

Create two recurring prices and put their ids in `STRIPE_PRICE_PRO` / `STRIPE_PRICE_SCALE`.

Original README

cp .env.example .env # set DATABASE_URL and AUTH_SECRET

Original README

stripe listen --forward-to localhost:3000/api/stripe/webhook

Original README

Hosted on Render's free tier, so the first request after idle may take ~50s to wake up.

Original README
https://github.com/rovidev95/rovidev-saas-starter/blob/main/LICENSEhttps://github.com/rovidev95/rovidev-saas-starter/blob/main/README.md

Compiled by DeepSeek based on repository license and README ·2026-10-03. 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-06-28
Screenshot last checked
2026-10-03

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.

Automatically checked against source and license rules; no manual editorial review.

Inspect the recorded source material

SHA-256: 6df0585a52928a0840100a79c09830746fcd1c783b97faace67bfba944106c03

2026-10-03T02:52:32.815Z

Source file / repository
# saas-starter

[![CI](https://github.com/rovidev95/rovidev-saas-starter/actions/workflows/ci.yml/badge.svg)](https://github.com/rovidev95/rovidev-saas-starter/actions/workflows/ci.yml)
[![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
![Next.js](https://img.shields.io/badge/Next.js-15-000000)
[![Live demo](https://img.shields.io/badge/Live%20demo-rovidev--saas--starter.onrender.com-2563eb?style=flat&logo=render&logoColor=white)](https://rovidev-saas-starter.onrender.com)

> **Live demo:** [rovidev-saas-starter.onrender.com](https://rovidev-saas-starter.onrender.com)
> Sign in with **[email protected]** / **password123**, then go to *Billing* to try a
> subscription. Use Stripe's test card **4242 4242 4242 4242** (any future expiry / CVC).
> Hosted on Render's free tier, so the first request after idle may take ~50s to wake up.

A multi-tenant SaaS skeleton built with the Next.js App Router. It covers the
plumbing most SaaS apps need on day one: authentication, organizations, role
based access control, plan limits and Stripe subscriptions with a webhook that
doesn't double-apply events.

Stack: Next.js 15, React 19 (server actions), Prisma + PostgreSQL, Tailwind,
TypeScript.

![Landing and pricing](docs/landing.png)

## What's included

- Tenancy: `User` ↔ `Membership` ↔ `Organization`. Every tenant-scoped page goes
  through `getOrgContext(slug)`, which checks the user actually belongs to the org.
- RBAC: `OWNER / ADMIN / MEMBER` mapped to permissions in `src/lib/rbac.ts`.
- Plans with seat/project limits enforced server-side (`src/lib/plans.ts`).
- Stripe checkout, customer portal and a webhook that records each event id
  before processing.
- Email/password auth with bcrypt and a signed JWT session cookie (jose).

## Getting started

```bash
cp .env.example .env          # set DATABASE_URL and AUTH_SECRET
docker compose up -d db       # or your own Postgres
npm install
npx prisma migrate dev
npm run db:seed               # demo org + [email protected] / password123
npm run dev
```

## Stripe

Create two recurring prices and put their ids in `STRIPE_PRICE_PRO` /
`STRIPE_PRICE_SCALE`. Forward events while developing:

```bash
stripe listen --forward-to localhost:3000/api/stripe/webhook
```

The webhook stores every event id in `ProcessedWebhook` before acting, so a
re-delivered event is acknowledged without repeating side effects.

## Layout

```
src/
  app/
    page.tsx                marketing + pricing
    (auth)/                 login / register
    dashboard/[slug]/       overview, members, billing (tenant scoped)
    actions/                server actions (auth, org, billing)
    api/stripe/webhook/     stripe webhook
  lib/
    rbac.ts plans.ts billing.ts slug.ts   business logic (unit tested)
    auth.ts tenant.ts session.ts          auth + tenancy
    db.ts stripe.ts env.ts                infra
```

## Scripts

```bash
npm run dev
npm run build        # prisma generate + next build
npm test             # rbac, plans, billing, slug
npm run typecheck
npm run prisma:migrate
npm run db:seed
```

Secrets are read lazily, so `next build` runs without real credentials.

## Custom work

Building a SaaS and need the multi-tenant/billing foundation done right?
Get in touch at [rovidev.com](https://rovidev.com).

## License

MIT
Report a correction

Explore similar templates

Compare previews and descriptions within the same stack and category.