Next.js 16 + Supabase Multi-tenant SaaS Template

Hey Cursor Community! :waving_hand:

I’m sharing a production-ready Multi-tenant SaaS Starter designed to solve complex infrastructure hurdles like tenant isolation and granular permissions.

:rocket: Key Features:

β€’ Next.js 16 (App Router) & Turborepo: Optimized for performance with a server-first architecture.

β€’ Subdomain Isolation: Automated tenant routing (e.g., acme.app.com) via middleware (now know as proxy).

β€’ Hardened Security: Database-level isolation using Supabase RLS, asymmetric JWT Claims, and Custom JWT claim injection that embed organization context into auth tokens.

β€’ Granular RBAC: A 5-tier role hierarchy with 41+ granular capabilities that you can easily extend (e.g., projects.delete).

β€’ Full Stripe Integration: Multi-tier subscriptions, usage tracking, and self-service billing portals.

β€’ Transactional Emails: Branded React Email templates powered by Resend and Supabase Edge Functions.

:building_construction: Tech Stack: Next.js 16, Supabase, Tailwind CSS, Stripe, and Sentry.

This template handles the β€œhard parts” of b2b SaaS apps like domain routing, auth, and billing so builders can focus on the features that make their app unique.

GitHub: GitHub - steve-piece/subdomain-isolated-turborepo: A multi-tenant Turborepo built with Next.js 16, featuring custom subdomains for each tenant.
Demo: https://marketing-app.com

1 Like