Freeboard UI
Overview
The UI is a Vue 3 SPA (packages/ui) that lets users:
- authenticate against GraphQL API
- configure datasources and widgets
- save/load dashboards
- render realtime dashboard data through gateway-backed datasource transports (
http,sse,websocket,mqtt)
Core stack:
- Vue 3 + Vite
- Pinia
- Vue Router
- Apollo Client (+ GraphQL SSE)
- Monaco editor (code fields)
Key Paths
- Entry/bootstrap:
packages/ui/src/main.ts,packages/ui/src/bootstrap/appBootstrap.ts - Router:
packages/ui/src/router/index.ts - Stores:
packages/ui/src/stores/auth.tspackages/ui/src/stores/dashboard.tspackages/ui/src/stores/pluginRegistry.tspackages/ui/src/stores/profileCatalog.ts
- Runtime context and UI services:
packages/ui/src/runtime/runtimeContext.tspackages/ui/src/ui/modalHost.ts
- Models:
packages/ui/src/models/* - Datasources:
packages/ui/src/datasources/* - Widgets:
packages/ui/src/widgets/* - Runtime helpers:
packages/ui/src/widgets/runtime/* - Main shell:
packages/ui/src/components/Freeboard.vue
Runtime Behavior
- UI authenticates and stores token in session storage.
- Session token is persisted in
sessionStorage(legacy localStorage entries are migrated).
- Session token is persisted in
- Dashboard data is fetched from GraphQL.
- Datasources emit updates:
- GraphQL dashboard subscriptions use SSE.
- Realtime datasource plugins share a dashboard-level
StreamingManagersocket to/gateway/realtime.
- Dashboard snapshot is normalized.
- Widget runtime resolves bindings/templates per widget.
- Widget errors are isolated to avoid global dashboard failure.
See Widget Runtime for lifecycle details.
Important Config
- Vite dev proxy routes:
/graphql-> API (localhost:4001)/gateway-> Gateway (localhost:8001)
- Static build mode:
FREEBOARD_STATIC=1andFREEBOARD_BASE_PATHfor static deployments (e.g. GitHub Pages)
Extension Points
- New datasources:
packages/ui/src/datasources/ - New widgets:
packages/ui/src/widgets/
User-facing docs:
Developer Commands
bash
npm run dev --workspace=packages/ui
npm run build --workspace=packages/ui
npm run lint:ui
npm run test:ui
npm run check:ui:store-boundariesUI runtime tests live in packages/ui/test/*.test.ts and target binding resolution, plugin validation, and reactive widget runtime behavior.
Component/API References
For full generated references:
- UI component docs:
/dev/components/ - API TypeDoc:
/dev/api/ - GraphQL schema:
/dev/graphql/