Skip to content
  • Akram GASSEM's avatar
    feat: bootstrap labs/dashboard — React + Vite + TanStack + Tailwind · 38417346
    Akram GASSEM authored
    Initial scaffold for the decoupled labdev dashboard. Same stack our
    labs/adapters frontend wave scaffolds (react-vite + tanstack-query +
    tanstack-router + tailwind + shadcn + zustand + zod-types + react-
    hook-form) — we eat our own dog food.
    
      Build      Vite 5 + React 18 + TS strict (`@/*` → `src/*`).
                 `npm run build` → tsc --noEmit + vite build → dist/.
                 dist/ is consumed by labdev's CI (M7 Phase J-style
                 clone+build+go:embed); never committed.
    
      Routing    TanStack Router file-based via @tanstack/router-plugin.
                 routeTree.gen.ts is .gitignored. Six routes wired:
                 / (overview, live) + /infra /gates /logs /config /about
                 (placeholders for subsequent sessions).
    
      Data       TanStack Query v5 with dashboard-tuned defaults (5s
                 stale, 5min gc, retry 1). All command dispatch funnels
                 through `dispatch(name, input)` in src/lib/api.ts which
                 POSTs to /api/commands/<name> and surfaces labdev's
                 LBDxxxx error codes via CommandError. stream(topic, cb)
                 helper for SSE.
    
      Types      Zod schemas in src/lib/types/api.ts mirror labdev's Go
                 I/O types. First wave covers service.status,
                 service.run, workspace.validate. Convention: TS type is
                 always z.infer<typeof Schema>; never hand-write.
    
      Styles     Tailwind v3 with CSS variables for shadcn theming
                 (slate / new-york). src/lib/utils.ts provides cn().
                 components.json pre-configured for `npx shadcn add`.
    
      Dev loop   `LABDEV_API_PORT=5099 npm run dev` serves on 5180 with
                 /api/ proxied to labdev. Vite HMR for view changes;
                 labdev only rebuilds when API or Command shapes change.
    
      Docs       README.md explains the two-repo split + dev loop.
                 AGENTS.md is the cross-tool agent context (Claude /
                 Cursor / Copilot) — rules of the road + where to put
                 new code.
    
    Subsequent sessions: wire /infra (poll infra.* commands), /gates
    (workspace.validate + tail), /logs (SSE stream), /config (config.*
    commands once M7 lands them), and add shadcn primitives as needed.
    labdev's internal/httpserver/ ships in parallel — first end-to-end
    demo when both halves meet on /api/commands/service.status.
    38417346
Loading