Move the dashboard and setup pages to a Vue SPA
Test and publish / test (push) Successful in 1m28s
Test and publish / publish (push) Successful in 3m30s

The pages are now a Vue 3 + Vite + TypeScript app in web/, built into
internal/web/dist/app and embedded in the binary. Go still serves
index.html for / and /setup behind the admin gate, plus the hashed
/assets/* (public, cached forever). The router takes its base from the
current URL, so it works under nginx's /tracker/ prefix unchanged.

Only dist/.gitkeep is committed, so go build and go test need no Node;
an unbuilt binary shows a "run make web" page at /. The Dockerfile gains
a Node stage, CI typechecks and builds the app, and make build/run build
it first.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
2026-10-14 22:06:41 +01:00
co-authored by Claude Opus 5.5
parent 67638cdef0
commit 0be97384fa
26 changed files with 2326 additions and 461 deletions
+4 -3
View File
@@ -43,9 +43,10 @@ func New(s *store.Store, admin auth.Checker, loc *time.Location, log *slog.Logge
})
mux.HandleFunc("GET /readyz", srv.ready)
mux.HandleFunc("GET /tracker.user.js", web.UserScript)
mux.HandleFunc("GET /style.css", web.Style)
mux.Handle("GET /{$}", srv.adminPage(web.Page(web.Index)))
mux.Handle("GET /setup", srv.adminPage(web.Page(web.Setup)))
mux.Handle("GET /assets/", web.Assets())
// The Vue app's routes; it sends visitors between them itself.
mux.Handle("GET /{$}", srv.adminPage(http.HandlerFunc(web.App)))
mux.Handle("GET /setup", srv.adminPage(http.HandlerFunc(web.App)))
api := http.NewServeMux()
api.Handle("POST /desktop/events", srv.device(srv.ingestEvents(ingest.Desktop)))