Architecture
Next.js on Cloudflare via OpenNext
Section titled “Next.js on Cloudflare via OpenNext”The site is a Next.js App Router app compiled for the Cloudflare Workers runtime
by @opennextjs/cloudflare. The build
produces a .open-next/ worker + assets bundle that wrangler deploys.
next.config.mjscallsinitOpenNextCloudflareForDev()sogetCloudflareContext()works undernext dev. It also setstypescript.ignoreBuildErrors: true(type errors don’t fail the marketing build).wrangler.jsoncwires the Worker: the.open-next/worker.jsentry, theASSETSbinding for static files,nodejs_compat, andobservability.enabled.public/_headerssets a long immutable cache on/_next/static/*.
The page
Section titled “The page”The site is one landing page (src/app/page.tsx) composed of section
components — Hero, Introduction, Features, Process, Team, Contact —
plus a Navigation, Footer, and a couple of visual effects. There is no CMS
or content collection; copy and layout live in the components.
Contact form
Section titled “Contact form”The one server route is src/app/api/contact/route.ts (runtime = "nodejs",
force-dynamic). It:
- reads secrets from
getCloudflareContext().env(falling back toprocess.env), - validates the submission (name/email/company/role required, message optional),
- sends an email via Resend to
CONTACT_EMAIL, with the submitter asreplyTo, escaping the HTML, - returns
400on bad input,502on a Resend failure,500if unconfigured.
The client ContactForm mirrors the validation and POSTs JSON to /api/contact.