Skip to content

Local Development

  1. Install dependencies:

    Terminal window
    bun install
  2. Run the dev server:

    Terminal window
    bun run dev # next dev

For local dev the contact route reads secrets from a .env file (see below).

Script Command Purpose
dev next dev Local dev server
build next build Plain Next build
build:cf opennextjs-cloudflare build Workers build only, no deploy
type-check tsc --noEmit Typecheck
start next start Serve a plain Next build (not the Workers runtime)
preview opennextjs-cloudflare build && … preview Build + preview on the Workers runtime
deploy opennextjs-cloudflare build && … deploy Build + deploy to Cloudflare
upload opennextjs-cloudflare build && … upload Build + upload a new version without deploying it
cf-typegen wrangler types … Regenerate Cloudflare env types

.github/workflows/ci.yaml runs on every push. It runs bun install --frozen-lockfile, bun run type-check and bun run build:cf, then serves the built worker with wrangler dev --local and fails unless / and /privacy return 200. A worker can build cleanly and still 500 on every request. Because next.config.mjs sets ignoreBuildErrors, the type-check step is the only type gate. CI doesn’t deploy. Dependabot opens weekly bun and GitHub Actions update PRs.

The site is a Cloudflare Worker. bun run deploy builds with OpenNext and deploys with wrangler (Worker name website). It deploys from main.

The contact form needs:

  • RESEND_API_KEY — Resend API key
  • CONTACT_EMAIL — recipient of submissions
  • CONTACT_FROM_EMAIL — optional verified “from” override

Locally these live in .env (gitignored). In production they are Cloudflare Worker secrets — set them with wrangler secret put <NAME> rather than committing them.