Deployment guide for 5CRSE on Vercel + Neon PostgreSQL

#Step 1: Neon Database

The production database is hosted on Neon (Serverless PostgreSQL).

  • Project: ep-proud-breeze-am3cdnlf (US East 1)
  • Database: neondb
  • Connection: postgresql://neondb_owner:***@ep-proud-breeze-am3cdnlf.c-5.us-east-1.aws.neon.tech/neondb?sslmode=require

Both Vercel Production and Preview environments use this database via DATABASE_URL.

#Step 2: Database Adapter

The project uses @payloadcms/db-postgres with Drizzle ORM:

// src/payload.config.ts
import { postgresAdapter } from '@payloadcms/db-postgres'

db: postgresAdapter({
  pool: {
    connectionString: process.env.DATABASE_URL || '',
  },
  push: false,
  prodMigrations: migrations,
  migrationDir: path.resolve(dirname, 'migrations'),
}),

#Step 3: Migrations

Schema changes use Payload's migration system (Drizzle under the hood):

# Create a new migration after schema changes
pnpm payload migrate:create

# Run migrations (happens automatically during build)
pnpm payload migrate

The build script runs payload migrate && next build automatically.

#Step 4: Vercel Blob Storage (media uploads)

Media uploads use @payloadcms/storage-vercel-blob:

import { vercelBlobStorage } from '@payloadcms/storage-vercel-blob'

plugins: [
  vercelBlobStorage({
    collections: { media: true },
    token: process.env.BLOB_READ_WRITE_TOKEN || '',
  }),
],

#Step 5: Deploy to Vercel

  1. Push to main branch — Vercel auto-deploys
  2. Or manually: npx vercel --prod

Required Environment Variables on Vercel:

VariableDescription
DATABASE_URLNeon PostgreSQL connection string
POSTGRES_URLSame as DATABASE_URL (for compatibility)
POSTGRES_URL_NON_POOLINGDirect connection for migrations
PAYLOAD_SECRETRandom secret for Payload CMS auth
BLOB_READ_WRITE_TOKENVercel Blob storage token
OPENAI_API_KEYOpenAI API key for AI assistant
STRIPE_SECRET_KEYStripe secret key
NEXT_PUBLIC_STRIPE_KEYStripe publishable key
NEXT_PUBLIC_PAYLOAD_URLDeployment URL (e.g. https://5crse.com)
PAYLOAD_PUBLIC_SERVER_URLSame as NEXT_PUBLIC_PAYLOAD_URL
TICKETMASTER_API_KEYTicketmaster Discovery API key
GEMINI_API_KEYGoogle Gemini for image generation

#Step 6: Post-Deploy

Visit https://5crse.com/admin to access the admin panel.

Domains: 5crse.com, www.5crse.com, 5crse.vercel.app