# Web UI Status: phase 1 pages and the phase 2 repository browser are built. Last updated 2026-11-25. ## Approach The UI is rendered on the server by the same Rust binary that serves everything else. There is no separate frontend application and no Node build step. | Concern | Choice | Notes | | --- | --- | --- | | HTTP framework | axum | Lore's server uses it too | | Templates | maud | Components are plain Rust functions, so a handler can return a whole page or one fragment. Askama is the alternative if HTML should live in template files | | Interactivity | htmx | Vendored, not fetched from a CDN | | Scripts | A few small hand-written ones | Only where HTML is not enough: diff viewer, image comparison, later 3D previews | | Styles | Plain CSS with custom properties | One stylesheet, `crates/forge-web/assets/app.css` | | Look | The desktop client's pixel style: IBM VGA 8x16 font, Sweetie 16 palette, bevelled buttons, square panels | Owner, 2026-11-25 ("a similar facelift"). The font is self-hosted under `/static/`; its CC BY-SA licence is at `/licenses`, linked from every footer | | Assets | Embedded in the binary | One file to deploy | | Live updates | Server-sent events | Fed by Lore's notification stream: activity, lock state, CI status | | API | JSON under `/api/v1` | Calls the same core services as the pages; authenticated by API tokens | All of these are confirmed by the owner; maud and htmx were confirmed on 2026-11-25. ### One port for pages and gRPC Lore reaches the user directory and repository registry over gRPC at `user_url`. lore-forge serves them on the same port as its pages and issuer, routing requests whose content type is `application/grpc*` to the gRPC services and everything else to the web routes. So one public URL is both the issuer and `user_url`. A reverse proxy in front must speak HTTP/2 to lore-forge and pass gRPC through. htmx is not vendored yet: no phase 1 page needs it. Every phase 1 page works as plain forms: a successful POST redirects with `?ok=` for its notice; a refused one re-renders the form with the error and status 422. ## Why server rendering suits Lore Lore is content-addressed. A tree, a file and a diff between two revisions are each fixed by their hashes and never change. - Rendered and syntax-highlighted output can be cached indefinitely, keyed by hash. - The hash is a natural `ETag`, so browsers and proxies cache correctly without extra logic. - Only branch tips, locks and activity are mutable; those are the parts driven by live updates. ## Large files Game repositories hold very large binary files. lore-forge does not relay them. - Downloads redirect to presigned URLs served by `loreserver`. - The browser fetches large assets directly from `loreserver`. - Listings and diffs are streamed from Lore's gRPC streams into the response rather than buffered. ## Security The web UI shares a process with the token issuer, which holds the keys to every repository. Repository content is untrusted: Markdown, SVG and HTML files can carry script. - **Raw content on a separate origin.** Raw files and previews are served from a different hostname than the UI and issuer, so a malicious file cannot read session cookies or call the UI as the user. - **Strict content security policy** on the main origin, with no inline script or style: `default-src 'none'` with `'self'` for scripts, styles, fonts and images (`data:` images too), `form-action 'self'`, `frame-ancestors 'none'`. A test renders every page and fails on any `