Skip to main content

Vercel

Deploying and running DirectoryKit on Vercel.

Vercel is the recommended host — made by the same team that builds Next.js, and the free tier is plenty for launching a directory.

For the fastest path, follow Deploy in 5 Minutes. This page covers the details.

Build settings (already configured)

vercel.json in the repo sets everything Vercel needs:

vercel.json
{
  "version": 2,
  "buildCommand": "pnpm build",
  "outputDirectory": ".next",
  "installCommand": "pnpm install",
  "framework": "nextjs"
}

You shouldn't need to change these. If Vercel imports the repo and asks for overrides, click Cancel and accept defaults — the file wins.

Why not Turbopack?

The project uses webpack because next.config.ts has custom config that Turbopack doesn't yet support. The pnpm build script already includes --webpack.

Import the project

Vercel Import Git Repository page

Go to vercel.com/new → pick your repo → Deploy.

Environment variables

Paste everything from your local .env.local into Vercel → Settings → Environment Variables before clicking Deploy. Missing vars usually cause the first build to succeed but runtime to error.

Vercel environment variables section

Full list: Environment Variables.

Cron jobs

Two cron schedules are defined in vercel.json:

"crons": [
  { "path": "/api/cron/competitions",      "schedule": "15 8 * * *" },
  { "path": "/api/cron/winner-reminders",  "schedule": "0 9 * * *" }
]

Vercel wires these automatically on deploy. Each endpoint checks Authorization: Bearer ${CRON_SECRET} — so make sure CRON_SECRET is set in env vars, or cron returns 401.

Vercel Cron Jobs settings page

See Cron Jobs for what each one does.

Hobby plan limit

Vercel Hobby allows one cron job that runs up to once per day. The Pro plan lifts those limits. If you're on Hobby, keep just one cron entry or upgrade.

Runtime settings

SettingValue
Build commandpnpm build (from vercel.json)
Node version18+ (auto)
Heap size4GB — already set via NODE_OPTIONS='--max-old-space-size=4096' in package.json scripts

Deploy succeeded — what next?

  1. Update NEXT_PUBLIC_APP_URL to your *.vercel.app URL → redeploy
  2. Update the Stripe webhook URL to point at production → copy the new signing secret
  3. Update Supabase Auth → Redirect URLs to include https://your-domain.vercel.app/auth/callback

Custom domain

See Domain Setup.

When builds fail

Most common causes:

  • Missing env var — check the build log for "is not defined"
  • pnpm-lock.yaml out of date — bump a dep locally, commit the updated lockfile
  • Schema mismatch — if you regenerated types against an old schema

See Troubleshooting for more.