# ADR-003: SSR Strategy - Go Templates with Preact Hydration ## Status Accepted ## Context The application needs to serve document pages that are readable without JavaScript (for performance and accessibility), while providing rich interactivity (comments, editing, search) when JavaScript is available. We need a server-side rendering strategy that works with our Go backend and Preact frontend. ## Decision **Strategy C**: Go's `html/template` renders initial HTML for all pages. Preact hydrates interactive components on the client. ### Implementation Details 1. **Server Rendering**: - Go handlers query database for document content - Markdown parsed to HTML server-side (Goldmark) - `html/template` renders full page with document HTML embedded - No JavaScript required for reading 2. **Client Hydration**: - Preact components mount into designated DOM containers - Comments, search, editor are Preact islands - Static content remains server-rendered HTML - `preact-iso` handles client-side navigation between pages 3. **Data Passing**: - Initial state embedded as JSON in `