πŸ“„ Our documentation is currently a work in progress. We’re adding more content soon β€” in the meantime, you can reach us at yourepicsaas@gmail.com.

logo png

YourEpicSaaS

Getting Started

Supabase Setup Guide

This guide walks you through setting up Supabase for the Next.js & Supabase Boilerplate.
Choose between Local Setup (via Docker) for development/testing or Cloud Setup for production.

What you'll learn: - Local vs. Cloud Supabase setup - Authentication configuration & email templates - Database schema management & seeding - Environment configuration & security best practices

Prerequisites

Required:

For Local Development:

For Cloud Setup:

  • Supabase CLI: npm install -g supabase

Quick Start

MethodBest ForTime Required
Local SetupDevelopment & Testing~5 minutes
Cloud SetupProduction & Team Collaboration~10 minutes

Local Supabase Setup

Verify Docker Installation

docker --version
docker ps

If Docker isn’t running, open Docker Desktop and wait for it to initialize.

Start Local Supabase

cd nextjs-and-supabase-boilerplate
npm run db:start

This:

Configure Environment

cp .env.example .env

Defaults in .env.example work for local development.

Verify Setup

npx supabase status
open http://127.0.0.1:54321

Cloud Supabase Setup

Create a Project

  1. Go to Supabase Dashboard
  2. Click New Project
  3. Fill in name, password, and region

Get API Credentials

  • Go to Settings β†’ API
  • Copy:
    • Project URL
    • Anon (public) key
    • Service role (secret) key

Never expose your service role key in client-side code.

Install & Authenticate CLI

npm install -g supabase
npx supabase login

Push Schema & Seed Data

cd nextjs-and-supabase-boilerplate
npx supabase db push --include-seed

This applies migrations, RLS policies, and seeds data.

Update .env

SUPABASE_URL="https://your-project-ref.supabase.co"
SUPABASE_ANON_KEY="your-anon-key"
SUPABASE_SERVICE_KEY="your-service-role-key"

Authentication Setup

Enable Email Provider

  1. Dashboard β†’ Authentication β†’ Providers β†’ Enable Email
  2. Enable confirmations and set Site URL to your domain

Configure SMTP

Use a provider like Resend, SendGrid, or Postmark:

  • Dashboard β†’ Settings β†’ Auth β†’ SMTP Settings
  • Enter SMTP credentials
  • Save changes

Customize Email Templates

  1. Copy templates from /supabase/templates/ (Local)
  2. Paste them into Dashboard β†’ Authentication β†’ Emails

Testing

  1. Database: Dashboard β†’ Table Editor
  2. Auth: Dashboard β†’ Authentication β†’ Users
  3. App: Sign up with a real email
  4. Email: Check inbox for confirmation

Troubleshooting

Connection Problems

  • Check .env values
  • Local: Ensure Docker is running
  • Cloud: Confirm project is active

Schema Push Fails

npx supabase login
npx supabase projects list
npx supabase link --project-ref your-project-ref