CodeBaseHub

Setup Supabase

Step-by-step guide to set up Supabase for CodeBaseHub

Create a Supabase Project

  1. Go to Supabase and sign in
  2. Click New Project and fill in the project details
  3. Create a strong password and save it (you'll need it for database credentials)
  4. Wait for the project to be created

Get Your Database Credentials

Once your project is created, you'll see the dashboard:

Supabase Dashboard

Step 1: Click Connect Button

In the top right of the dashboard, click the Connect button.

Step 2: Open ORMs Tab

A modal will open. Click on the ORMs tab.

Step 3: Select Drizzle

From the list, select Drizzle as your ORM.

Step 4: Copy Database URL

You'll see a connection string like this:

postgresql://postgres:[YOUR-PASSWORD]@db.xxxxxxxxxxxxx.supabase.co:5432/postgres

Replace [YOUR-PASSWORD] with the password you created when generating the project.


Add to Your .env File

Copy the complete connection string and add it to your .env file in the server project:

apps/server/.env
DATABASE_URL=postgresql://postgres:your-actual-password@db.xxxxxxxxxxxxx.supabase.co:5432/postgres
DIRECT_URL=postgresql://postgres:your-actual-password@db.xxxxxxxxxxxxx.supabase.co:5432/postgres

Next Steps

Once your database credentials are set up in apps/server/.env, run these commands in order:

Terminal
pnpm db:push

This pushes your database schema to Supabase.

Terminal
pnpm db:generate

This generates TypeScript types from your database schema.

See the Installation Guide for more details.

Was this page helpful?
Setup Supabase | CodeBaseHub