Database Setup
Configure your Supabase PostgreSQL database for Echo Boilerplate
Step 1: Create Supabase Project
Set up your database project
- Go to supabase.com and create a new project
- Choose a project name and database password
- Select a region closest to your users
- Wait for initialization (2-3 minutes)
Step 2: Get Your Credentials
Copy your database connection details
From Settings → API:
- Project URL →
NEXT_PUBLIC_SUPABASE_URL - anon/public key →
NEXT_PUBLIC_SUPABASE_ANON_KEY - service_role key →
SUPABASE_SERVICE_ROLE_KEYKeep secret!
From Settings → Database:
- Connection String →
SUPABASE_DB_URL
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:
- Open Supabase → Storage → Buckets
- Create a bucket named
public-assets - Mark it as Public so the admin media manager can serve files
Prefer the Supabase CLI? Run supabase storage buckets create public-assets --public.
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
- Start your development server:
pnpm dev - Visit
http://localhost:3000 - Try signing up or accessing the admin panel
- 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: