Next.js + Supabase + Stripe
The complete SaaS stack - auth, database, billing, deploy - wired in days, not months.
The full SaaS stack in one combo
Next.js + Supabase covers the app. Stripe covers the money. Together, they deliver everything a subscription SaaS needs: auth, multi-tenancy, billing, prorating, dunning, refunds, customer-managed cancellations.
How the billing wiring actually works
The naive integration is "redirect to Stripe Checkout, hope for the best." The production-grade pattern:
- Customer hits the upgrade button - server action creates a Stripe Checkout session with metadata containing the workspace ID.
- Customer pays - Stripe redirects them back to a success page with a polling check.
- In parallel, Stripe sends a
checkout.session.completedwebhook to/api/stripe/webhook. - The webhook handler verifies the signature, looks up the workspace ID from the metadata, and writes a row to the
workspace_subscriptionstable. - The Supabase realtime channel notifies the success page that the subscription is active. Page redirects to dashboard.
Idempotency keys on every Stripe call prevent double-billing if a webhook is retried. The subscription table is the source of truth - never trust the user's session claim of "I'm on Pro," always check the database.
What I include by default
- 3-tier pricing page (Solo / Team / Enterprise) - easy to add more.
- Free trial logic - configurable per tier, automatic conversion or downgrade.
- Customer Portal integration - users self-serve cancellations, downgrades, payment method updates.
- Dunning flow - failed-payment retry logic, customer notification emails, automatic suspension after N retries.
- Annual + monthly cycles with proration on tier changes.
- ✓Subscription SaaS
- ✓Multi-tier pricing
- ✓Free trial → paid conversion flows
- ✓B2B with team plans
- -One-time payment products (Stripe Checkout works but is overkill)
- -Marketplaces (use Stripe Connect - different stack)
- -Crypto/web3 payments
Dollar Vibe Club
Our flagship - a community built to show people how to start earning online and keep the momentum going.
Read the case study →Build on Next.js + Supabase + Stripe?
See pricing →