Server & Build Stack
Custom server
Realm uses server.js for both dev and production — not next dev / next start.
server.js loads .env.local, prepares the Next.js instance, creates the HTTP server, and listens on PORT (default 3000). See custom-server.
proxy.ts is the Next.js middleware (Next.js 16 renamed middleware.ts to proxy.ts), handling locale routing and the GEO_COUNTRY cookie. See routes-and-proxy.
Build commands
Vercel project settings
server.js does not run in Vercel deployments — Vercel uses serverless functions. The Framework Preset must be set to Other, or the build may fail.
Other commands
See also
next-config—next.config.jsdetailed configurationenv-vars— full environment variable documentationcustom-server—server.jsimplementation details