Skip to Content
Get StartedDatabase Setup

🗄️ Database Setup (Prisma ORM)

The project uses Prisma ORM  — a powerful and type-safe ORM that supports most SQL databases. You can connect to a local instance, Dockerized DB, or cloud providers like Prisma Data Platform or Supabase.

In this example, we’ll use Prisma’s free Postgres database.

1. Create a Free Postgres Database

  1. Go to https://www.prisma.io/postgres
  2. Log in or create a free account
  3. Click New Project
  4. Enter a project name for your new database project
  5. Choose Get Started under Prisma Postgres
  6. Select the region closest to your app’s hosting location
  7. Click Create Project

2. Get Your Database Connection URL

Once the project is created:

  1. Click the Connect button
  2. Copy the value of DATABASE_URL — this is your unique connection string

Example:

DATABASE_URL="postgresql://username:password@aws-0-eu-central-1.pooler.supabase.com:6543/db_name"

3. Update Your .env File

Paste the copied value into your .env file, replacing the placeholder:

DATABASE_URL="your_copied_connection_string_here"

4. Run Prisma Migrations

Initialize your database schema by running:

pnpm prisma migrate dev

This will create the required tables and synchronize your database with the project schema.

Note: This setup uses Prisma Accelerate, which is already pre-configured in the project for better performance and connection pooling.
However, if your database provider does not support Prisma Accelerate, you can safely remove or comment out the accelerate-related configuration in your Prisma setup.

Last updated on