Echo

Database Setup

Configure your Supabase PostgreSQL database for Echo Boilerplate

Step 1: Create Supabase Project

Set up your database project

  1. Go to supabase.com and create a new project
  2. Choose a project name and database password
  3. Select a region closest to your users
  4. Wait for initialization (2-3 minutes)

Step 2: Get Your Credentials

Copy your database connection details

From Settings → API:

  • Project URLNEXT_PUBLIC_SUPABASE_URL
  • anon/public keyNEXT_PUBLIC_SUPABASE_ANON_KEY
  • service_role keySUPABASE_SERVICE_ROLE_KEY Keep secret!

From Settings → Database:

  • Connection StringSUPABASE_DB_URL
# Format:
postgresql://postgres:[password]@db.xxx.supabase.co:5432/postgres

Step 3: Run Database Migrations

Set up all required database tables

Migrations create all the necessary tables for your application: users, blog posts, settings, and more.

Create the storage bucket before running uploads:

  1. Open Supabase → Storage → Buckets
  2. Create a bucket named public-assets
  3. Mark it as Public so the admin media manager can serve files

Prefer the Supabase CLI? Run supabase storage buckets create public-assets --public.

pnpm db:migrate

Tip:

Make sure your SUPABASE_DB_URL is set correctly in your .env.local file before running migrations.

Step 4: Verify Setup

Test your database connection

  1. Start your development server: pnpm dev
  2. Visit http://localhost:3000
  3. Try signing up or accessing the admin panel
  4. Check browser console for any database errors

Troubleshooting

Connection refused

Check that your database password is correct in the connection string

SSL certificate error

Supabase connections require SSL. The connection string should include SSL parameters

Migration fails

Ensure you're using the service_role key (not anon key) for migrations

Next Steps

Once your database is set up, continue with: