Migrate the marketing site from Next/OpenNext to TanStack Start on Vite#133
What
Move the marketing site (website/) off Next.js and OpenNext onto the same stack the product already runs: TanStack Start + Vite, built to a Nitro server and deployed as a Cloudflare Worker.
The app is already there — root package.json has @tanstack/react-start, vite and nitro and no next dependency, and the relay worker runs .output/server/index.mjs. The marketing site is the only Next app left: website/package.json pins next@16.4.2 with @opennextjs/cloudflare@1.20.12, deployed as the separate relay-web worker (website/wrangler.jsonc, main: .open-next/worker.js). A Cloudflare contact recommended moving to a natively supported framework rather than staying on the OpenNext path.
Why
Keeping Next on the marketing site makes the release gate depend on OpenNext's transitive tree. When #89 was audited, 8 of its 9 advisories came through website/: six on next, plus sharp via @opennextjs/cloudflare > wrangler > miniflare, and proxy-addr and glob via @opennextjs/cloudflare > @opennextjs/aws. Upgrading Next and OpenNext to their patched versions still left proxy-addr and glob pinned by @opennextjs/aws, so the fix needed overrides in pnpm-workspace.yaml to reach a clean audit. Migrating removes that dependency entirely instead of patching around it.
One deploy pattern is the second win: the marketing site today needs opennextjs-cloudflare build and a .open-next artifact, while the app builds through Vite and Nitro.
Surfaces to port
- Marketing pages:
/,/about,/features,/pricing,/roadmap,/privacy-and-data, plus the/waitlistpermanent redirect to the app. Preserve/llms.txt,/llms-full.txt,/sitemap.xml,/robots.txt, and/api/client-review-videoGET/HEAD with byte-range support. Contact is a mailto link and binding legal/accessibility pages live in the app. website/lib/site-metadata.ts— canonical and Open Graph URLs built fromNEXT_PUBLIC_MARKETING_SITE_URL; they must keep pointing at the marketing host while app links keep using the app host.website/lib/roadmap.ts— GitHub GraphQL read usingGITHUB_TOKEN; the deployed page currently renders "We couldn't load the roadmap right now", so the port must carry the token requirement over and the fix belongs here too.- Shared pricing constants from the app (
FREE_OPEN_PROJECT_LIMIT,CREATOR_MONTHLY_PRICE_USD,TEAM_INCLUDED_EDITOR_SEATS, and the rest) so the copy never drifts. - Cloudflare Worker config: replace
website/wrangler.jsoncwith a Nitro output worker, keep theweb.relay-app.cc.cdroute and theNEXT_PUBLIC_MARKETING_SITE_URL/NEXT_PUBLIC_CONVEX_URLvariables.
Acceptance criteria
website/builds with Vite + TanStack Start and deploys as its own Worker with no.open-nextstep.- Remove runtime Next/OpenNext dependencies, imports, and build configuration; keep
pnpm audit --prodgreen. Remove the OpenNext-onlyproxy-addr,glob,sharp, andsource-map-jsoverrides when no remaining dependency needs them. Historical documentation can still name the previous stack. - Every page above preserves its current copy, title and description;
/waitlistkeeps its permanent app redirect and/api/client-review-videopreserves GET/HEAD/range behavior. - Canonical and
og:urlstill resolve tohttps://web.relay-app.cc.cd/..., verified against the deployed HTML rather than the build output. sitemap.xml,robots.txt,llms.txtandllms-full.txtserve the same content with correct content types.- If
/roadmapremains in the approved scope, it renders live canonical-repo issues using a server-onlyGITHUB_TOKEN; if removal is approved and merged first, port that removal instead. Coordinate with #98. - Pricing copy still derives from the shared constants, with a test that fails if a hard-coded price or seat count appears.
- The marketing build runs in CI next to the app: typecheck, production build and the production dependency audit.
- Deployed parity: capture title, canonical,
og:url,og:imageand H1 for each route before and after the cutover, and diff them. - 404 behaviour and trailing-slash handling match the current site.
- Rollback: keep the
relay-webworker deployable from the last Next revision until the new worker has served production traffic for a week.
Notes
- Not a launch blocker on its own. The dependency bump cleared the audit for now, so this can land on its own schedule without holding the release.
- Do the port behind the same hostname in a preview worker first; keep the switch a routes/variables change, not a DNS migration.
Main branch review (2026-10-19)
Reviewed 17cd594.
Status: not started on main. website/package.json still runs Next 16.4.2 and OpenNext 1.20.12, and website/wrangler.jsonc still uses .open-next/worker.js. The app's TanStack Start/Vite/Nitro migration is already complete; this issue is only for website/.
The production audit is now green in successful main CI run; #89 is completed, so the port remains independent work. That CI typechecks marketing but does not call pnpm --dir website build; preserving/adding the marketing production build gate is still required.
The route inventory below is corrected to main: keep the /waitlist permanent redirect and /api/client-review-video GET/HEAD byte-range endpoint (website/app/api/client-review-video/route.ts, website/lib/client-review-video.ts) as well as the text/metadata endpoints. Contact is presently a mailto link; binding legal pages are served by the app, not standalone marketing pages. Preserve the security headers in website/next.config.mjs during the port.
Main still contains /roadmap; coordinate keep/remove with #98. No separate roadmap-removal branch or UI PR counts as merged implementation. Remove runtime Next/OpenNext dependencies and only their unnecessary overrides, without requiring historical documentation to erase those names or dropping security pins still needed by other consumers.