Docs
Database

Getting Database URL

NeonDB

NeonDB Landing Page

Log in to NeonDB

Go to NeonDB's website and log in or create an account. Once you log in, you'll will be redirected to create a project if you dont have one.

NeonDB Create Project

After going to the dashboard, copy the connection string as shown in the image below.

NeonDB COPY DATABASE URL

Then paste it in your .env file.

Change Database URL
DATABASE_URL="postgresql://neondb_owner:***********@ep-*****-*******-********.us-east-2.aws.neon.tech/neondb?sslmode=require"

After pasting the database url, open your terminal and run the following commands one by one to sync your database models with neondb.

Sync database
npx prisma generate // Regenerate prisma client
npx prisma db push // Push updates to Neon server

That's it! You've successfully set up the database API, well done!