Decision ADR-0006 · The Lighthouse
Static export (Next.js) instead of server-side rendering
Accepted ·
Context
The site needs:
- SEO-friendly classic pages and a blog;
- a heavy client-only 3D world;
- near-zero hosting cost.
SSR would need an always-on Node server or Lambda@Edge, which adds cost and cold starts.
Decision
Use Next.js with output: 'export':
- every route is prebuilt to static HTML and served from S3 through CloudFront, with immutable hashed assets;
- dynamic data comes from
/api/*(Lambda) and/rt(WebSocket) on the same origin; - the world canvas lives in the root layout, so navigating between districts doesn't reload it.
Consequences
- + Fits CloudFront's always-free tier, has no cold starts, and gives crawlers full HTML.
- − No server-side rendering at request time. Personalised data loads on the client.