TurboJet
DatabaseDatabase providers

Supabase Postgres

Managed PostgreSQL with Supavisor pooling — database only, not Supabase Auth.

Supabase provides managed PostgreSQL with built-in connection pooling via Supavisor, plus optional storage, realtime, and edge functions on their platform.

Better Auth, not Supabase Auth

TurboJet uses Better Auth for authentication. Supabase is used here only as a Postgres provider. User sessions live in your database tables, not in Supabase Auth.

For local development, prefer Local (Docker).

1. Create a Supabase account and project

Go to supabase.com, create an account and a project, and choose a strong database password. Save it — you need it for connection strings.

2. Get your connection strings

In the dashboard, open Connect, then the ORM tab. You need:

  • Pooler (Transaction mode) — runtime (DATABASE_URL). Port 6543.
  • Direct connection — migrations (DIRECT_URL). Port 5432.
Pooler (Transaction mode)
postgres://postgres.[project]:[password]@aws-0-[region].pooler.supabase.com:6543/postgres?pgbouncer=true
Direct
postgresql://postgres:[password]@db.[project-ref].supabase.co:5432/postgres

3. Configure environment variables

In the repository root .env:

DATABASE_URL="postgres://postgres.[project]:[password]@aws-0-[region].pooler.supabase.com:6543/postgres?pgbouncer=true"
DIRECT_URL="postgresql://postgres:[password]@db.[project-ref].supabase.co:5432/postgres"

4. How migrations use DIRECT_URL

This kit does not use prisma.config.ts. Migrate scripts temporarily set DATABASE_URL to DIRECT_URL:

packages/database/package.json
"db:migrate": "dotenv -e ../../.env -- sh -c 'DATABASE_URL=\"$DIRECT_URL\" prisma migrate dev'"

Runtime Prisma Client keeps using the pooler DATABASE_URL.

5. Run migrations

pnpm --filter @repo/database db:migrate
# or
pnpm --filter @repo/database db:push
pnpm --filter @repo/database db:generate

6. Enable Row Level Security

After migrations, enable Row Level Security (RLS) for each table in the Supabase Table Editor (table settings).

The app talks to Postgres through the server-side Prisma connection (not the Supabase browser SDK), but RLS is still a recommended extra safeguard on Supabase projects.

If you need object storage, use TurboJet’s Storage (Cloudflare R2 / AWS S3) — there is no Supabase Storage recipe in this kit.

Frequently asked questions

Does TurboJet use Supabase Auth?

No. Better Auth stores users and sessions in your Postgres database (including when that database is hosted on Supabase).

Do I need to enable RLS?

Yes — recommended on Supabase. Enable it for all tables after migrating.

Can I use Supabase realtime?

Not included by default. You would add the Supabase client SDK yourself; the kit only requires a Postgres connection string.

On this page