The console moves to templ and Datastar; the SPA is frozen
Status
Section titled “Status”Accepted. The migration is largely done: /ui is the default console and the single-page application (SPA) is kept for roll-back and removal later.
2026-10-24, confirming a ruling of 2026-10-14. Made the default on 2026-11-06.
Context
Section titled “Context”The platform’s console was a Vue and PrimeVue single-page application of about 40,000 lines under frontend/, built with Node and embedded in the Go binary. It worked, but it meant a second language and toolchain in the product build, a generated client to keep in step with the API, and a different component family from the server-rendered pages the application framework had started to offer. A move to Nuxt UI was considered for the platform too.
Decision
Section titled “Decision”- The platform’s admin console is server-rendered with templ and Datastar, using the framework’s UI kit, and is served by the Go binary under
/ui. A move of the platform itself to Nuxt UI was considered and not taken. Nuxt UI remains the primary UI for business applications built on the framework. - The SPA is frozen. Bug and security fixes only. No new page is written in it. Pages that had been started in it were ported.
- New features are built in templ from the start; ingestion pages exist only there.
- Islands are allowed where a page needs real client code, as web components or scripts on a server-rendered page, never as a second SPA: code, JSON and YAML editing (a vendored CodeMirror 6 bundle), diagrams (vendored Mermaid in strict mode, loaded only on pages that draw one), WebAuthn, and the Swagger viewer. No Node or Vite in the product build for them.
- An area becomes primary only when the owner asks. About a month after a switch the losing implementation is removed. If the new one proves inferior in that month, the decision reverses and the new one is removed. Only one implementation of an area survives. When every area is decided,
frontend/, PrimeVue and the Node steps leave the build. - Per-area acceptance is a checklist: list state in the URL, drawer deep links, field-level errors, confirmations, every server-side permission gate reflected, the Datastar error contract, phone width, dark mode, and the area opened in a real browser against an isolated platform.
- Sign-in, passkey and two-factor pages came last, because a defect there locks people out.
Since 2026-11-06 /ui is the default console. The SPA’s page URLs redirect to the equivalent /ui page, and setting FC_CONSOLE=spa turns the redirects off. The SPA code remains in the repository until the removal step.
Consequences
Section titled “Consequences”Good:
- One language and one toolchain for the product. No generated client to drift.
- Permission checks are made on the server where the data is, and the page reflects them.
- The platform’s console dogfoods the same kit that framework applications use.
Bad:
- Datastar is a young library with a small ecosystem. It is pinned, with the kit’s own error contract and fixtures, and islands cover what it cannot do.
- While both implementations exist there is parity drift risk. Fixes go to the default and to the other copy when the defect is in both.
- Three component families remain: the templ kit, its Java template twin in the framework, and Nuxt UI. A language-neutral kit of specs and goldens that the first two both pass keeps them aligned.
Alternatives considered
Section titled “Alternatives considered”| Alternative | Why not |
|---|---|
| Keep the SPA and keep building in it | Keeps the Node toolchain and the generated client, and splits new work across two stacks. |
| Move the platform to Nuxt UI | Still a client-side application with a build pipeline and API client. Better suited to business applications. |
| Rewrite everything at once | The hardest areas (authentication, sign-in) would be risked early. They went last, with the SPA as fallback. |