HCTHE HCLAB

Deploy on Vercel

Connect the repository

  1. Go to vercel.com/new
  2. Import the GitHub repository
  3. Framework preset: Next.js (auto-detected)
  4. Build command: npm run build (default)
  5. Install command: npm install (runs postinstallprisma generate)

Environment variables

Add variables in Project → Settings → Environment Variables before the first production deploy. At minimum:

  • DATABASE_URL
  • AUTH_SECRET
  • AUTH_TRUST_HOST=true
  • NEXT_PUBLIC_SITE_URL

See Production environment for the full list.

Database before first deploy

From your machine (or CI), push schema to production:

DATABASE_URL="postgresql://..." npx prisma db push
DATABASE_URL="postgresql://..." npm run db:seed   # optional

Custom domain

  1. Add domain in Vercel Domains
  2. Update DNS per Vercel instructions
  3. Set NEXT_PUBLIC_SITE_URL to the canonical HTTPS URL

Cron jobs

Configure Vercel Cron (or external scheduler) to hit:

Endpoint Purpose
GET /api/cron/research-ops All background jobs
GET /api/cron/process-events Event queue only
GET /api/cron/process-webhooks Study webhooks
GET /api/cron/run-export-schedules Scheduled exports

Pass Authorization: Bearer $CRON_SECRET when CRON_SECRET is set.

Build notes

  • Node 20+ recommended (matches local dev)
  • postinstall generates Prisma client automatically
  • TypeScript and ESLint run during next build