A minimal subscription starter kit built with Next.js, Supabase, and Dodo Payments. This boilerplate helps you quickly set up a subscription-based SaaS with authentication, payments, and webhooks.
- π Authentication: Google OAuth integration via Supabase
- π³ Payment Processing: Complete subscription management with Dodo Payments
- π¦ Dynamic Plans: Products with configurable features via metadata
- π‘ Webhook Integration: Real-time subscription lifecycle events via Supabase functions
- ποΈ Database Management: PostgreSQL with Drizzle ORM
- π¨ Modern UI: Built with Next.js 15, React 19, and Tailwind CSS
- π Dashboard: Comprehensive subscription and billing management
- π Invoice History: Complete payment and billing tracking
Before you begin, ensure you have the following installed:
- Node.js (v18 or higher) or Bun (v1.0 or higher)
- Git for cloning the repository
- A Supabase account (sign up here)
- A Dodo Payments account (sign up here)
- Google Cloud Console account (for OAuth setup)
# Clone the repository
git clone https://github.com/dodopayments/dodo-supabase-subscription-starter.git
cd dodo-supabase-subscription-starter
# Install dependencies
bun install
# or
npm install
# or
pnpm install- Go to Supabase and create a new project
- Wait for the project to be fully provisioned (this may take 2-3 minutes)
- Go to Settings β API and copy:
- Project URL (NEXT_PUBLIC_SUPABASE_URL)
- Anon/Public Key (NEXT_PUBLIC_SUPABASE_ANON_KEY)
- Service Role Key (for webhook function)
- Go to Settings β Database and copy the Connection String (DATABASE_URL)
- Go to Google Cloud Console
- Create a new project or select an existing one
- Enable the Google+ API
- Go to Credentials β Create Credentials β OAuth 2.0 Client IDs
- Set authorized redirect URIs to:
https://[your-project-ref].supabase.co/auth/v1/callback - Copy the Client ID and Client Secret
- In Supabase, go to Authentication β Providers β Google
- Enable Google provider and add your Client ID and Secret
- Create an account at Dodo Payments
- Go to Settings β API Keys and copy your API key
- Go to Settings β Webhooks and copy the webhook secret
Create a .env.local file in the root directory:
# Supabase Configuration
NEXT_PUBLIC_SUPABASE_URL=https://your-project-ref.supabase.co
NEXT_PUBLIC_SUPABASE_ANON_KEY=your-anon-key
SUPABASE_SERVICE_ROLE_KEY=your-key
# Database URL (from Supabase Settings β Database)
DATABASE_URL=postgresql://postgres:[password]@db.[project-ref].supabase.co:5432/postgres
# Dodo Payments Configuration
DODO_PAYMENTS_API_KEY=your-dodo-api-key
DODO_WEBHOOK_SECRET=your-webhook-secret
DODO_PAYMENTS_ENVIRONMENT=test_mode# Push the database schema to Supabase
bun run db:push
# or
npm run db:push
# or
pnpm run db:pushThis creates the necessary tables: users, subscriptions, and payments.
# Login to Supabase (you'll be prompted to authenticate)
bunx supabase login
# or
npx supabase login
# Deploy the webhook function
bun run deploy:webhook --project-ref [your-project-ref]
# or
npm run deploy:webhook -- --project-ref [your-project-ref]
# or
pnpm run deploy:webhook --project-ref [your-project-ref]Note: Replace [your-project-ref] with your actual Supabase project reference ID (found in your project URL).
- In your Dodo Payments dashboard, go to Settings β Webhooks
- Add a new webhook endpoint with this URL:
https://[your-project-ref].supabase.co/functions/v1/dodo-webhook - Select all payment and subscription events
- Save the webhook configuration
In your Dodo Payments dashboard:
- Go to Products β Create Product
- Fill in the basic product information (name, price, billing cycle)
- In the Metadata section, add:
{ "features": ["Feature 1", "Feature 2", "Feature 3"] } - Save the product
The features array will be dynamically displayed in your application's pricing UI.
# Start the development server
bun run dev
# or
npm run dev
# or
pnpm run devOpen http://localhost:3000 to view the application.
- Google OAuth only - Additional auth providers require extra setup
- Dodo Payments integration - Built specifically for Dodo, switching payment providers needs significant changes
- Subscription model - Designed for recurring payments, not one-time purchases
- Serverless deployment - Optimized for Vercel, traditional servers may need adjustments
- β Fast setup vs β Limited flexibility - Quick to deploy but harder to customize
- β Managed services vs β Vendor lock-in - Faster development but dependent on third parties
- β Modern stack vs β Learning curve - Great DX but requires familiarity with latest tools
You can deploy this project instantly using the button below:
This project was originally created by Darshan Gowda.

