Local Development
-
Install dependencies:
Terminal window bun install -
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).
Scripts
Section titled “Scripts”| Script | Command | Purpose |
|---|---|---|
dev |
next dev |
Local dev server |
build |
next build |
Plain Next build |
type-check |
tsc --noEmit |
Typecheck |
lint |
next lint |
Lint |
preview |
opennextjs-cloudflare build && … preview |
Build + preview on the Workers runtime |
deploy |
opennextjs-cloudflare build && … deploy |
Build + deploy to Cloudflare |
cf-typegen |
wrangler types … |
Regenerate Cloudflare env types |
Deployment
Section titled “Deployment”The site is a Cloudflare Worker. bun run deploy builds with OpenNext and
deploys with wrangler (Worker name website). It deploys from main.
Environment
Section titled “Environment”The contact form needs:
RESEND_API_KEY— Resend API keyCONTACT_EMAIL— recipient of submissionsCONTACT_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.