logo
SaaSkit
Database

Supabase

Ready-to-use database for modern web apps

Setup

Create a free project on Supabase. This will automatically create a ready-to-use database for you.

Click the Connect button and select the options shown in the image below.

Connect to your Supabase database using the connection mode
Connect to your Supabase DB

Select Transaction pooler if you plan to deploy your app on a serverless platform like Vercel. Select Direct connection if you are deploying to a VPS such as Digital Ocean.

Copy the connection string provided and paste it into your .env file:

DATABASE_URL=

Open /db/index.ts and uncomment one of the highlighted lines:

index.ts
// export { neonDB as db } from "./neon/serverless-db";
// export { neonDB as db } from "./neon/db";
 
// export { supabaseDB as db } from "./supabase/serverless-db";
// export { supabaseDB as db } from "./supabase/db";

Use serverless-db if you plan to deploy your app on a serverless platform like Vercel. Use db if you are deploying to a VPS such as Digital Ocean.

Migrate your database schema to Supabase by running the following commands:

npm run db:generate
npm run db:migrate

That’s it! Your database is now ready. You can view all your tables in the Table Editor section of your Supabase dashboard.

On this page