Neon Database Setup

This guide will walk you through setting up your database and backend services with Neon for data storage.

Create Neon Account

  1. Go to neon.tech
  2. Sign up for a free account
  3. Click "New Project" to create your first project
  4. Choose your organization and enter project details
  5. Select a region close to your users
  6. Set a strong database password and save it securely

Get Your API Keys

Once your project is created:

  1. Go to Projects → Connect in your Neon dashboard
  2. Click "Show password" to reveal your password
  3. Copy your Connection String

Add to your .env file:

POSTGRES_URL=your_project_url

View and/or Update Database Tables

Create essential tables for your application:

Navigate to lib/db/schema.ts to view the User table

You can create new tables in the schema.ts file

Generate a Drizzle Schema

With Drizzle, you can generate a schema from your database tables and then use it to migrate changes to your database.

pnpm db:generate
pnpm db:migrate

View your database tables

You can view your database tables in your Neon dashboard.

pnpm db:studio

Copy the link https://local.drizzle.studio/ and paste it in your browser to view your database tables.