Boilerplate-Stack

Supabase SaaS architecture

A Supabase SaaS boilerplate with the tenant boundary enforced

Boilerplate-Stack uses Supabase for more than sign-in. Auth identities, personal accounts, workspaces, memberships and Postgres Row Level Security form one data boundary that every account-scoped feature can reuse.

Use Supabase as the application foundation

  • Magic link, OTP and OAuth authentication flows
  • Personal accounts and multi-user workspaces
  • Dynamic roles, invitations and permission checks
  • Postgres RLS, explicit Data API grants and storage policies

Security lives below the component layer

01

Membership is the source of tenant access

A membership connects a user, an account and a role. Queries and mutations resolve that relationship before returning account data, allowing the same user to hold different permissions in different workspaces.

02

Row Level Security backs application checks

Account-scoped tables carry policies that verify membership inside Postgres. Server authorization remains explicit, while RLS provides the database boundary if a client attempts to query outside the current tenant.

03

Fresh projects reproduce the intended grants

Migrations define schema, policies, functions and explicit anon, authenticated and service-role grants. Local reset and disposable QA flows exercise the same boundary before changes reach a hosted project.

Supabase capabilities already connected

  • Auth callback, onboarding and session-aware server utilities
  • Workspace invitations, roles and account switching
  • Storage-backed CMS media and RAG documents
  • pgTAP and browser personas for cross-tenant access tests

Keep Supabase speed without guessing the security model

Start from explicit account boundaries, policies and migrations, then add the data that belongs to your product.

See pricing