Every SaaS needs the same foundation: auth, payments, a database, protected routes. I've built this from scratch too many times. This post covers the parts that actually trip people up — not the happy path, but the edge cases that break production apps.
The three Supabase client problem
Most tutorials show one Supabase client. In a Next.js 15 App Router project you need three:
// lib/supabase/client.ts — browser only (Client Components)
import { createBrowserClient } from "@supabase/ssr";






