LeapView is a dashboards-as-code BI monolith. Go owns configuration compilation, security, deployments, managed data, DuckDB/DuckLake execution, and the Datastar SSE command loop. Gomponents renders page shells; Lit components render typed signal payloads in the browser.
dashboards/is the canonical analytics source root. The compiler discovers connections, sources, models, semantic models, pipelines, and dashboards from its six conventional subdirectories; authored Project, access, and publication resources are not part of the portable bundle.internal/project/compiler/loads, validates, and compiles the complete resource graph into deployable serving-state artifacts.internal/deployment/,internal/servingstate/, andinternal/runtimehost/prepare immutable serving-state generations, activate the graph for the instance-bound environment, lease DuckLake snapshots, and drain readers safely during cutover.internal/manageddata/implements local and S3-backed ingestion, revisions, upload protocols, runtime views, retention, and binding resolution.internal/analytics/model/defines semantic models.internal/analytics/query/plans governed single- and multi-dataset queries.internal/analytics/materialize/andinternal/analytics/duckdb/execute and cache them.internal/access/owns principals, authentication credentials, RBAC, grants, data policies, groups, SCIM, sessions, service principals, and access auditing.internal/app/is the composition root and top-level HTTP router. Feature handlers live beside their domains under packages such asinternal/dashboard/http,internal/project/http, andinternal/agent/http; feature route tables are mounted from each module'sroutes.go(for exampleinternal/dashboard/module/routes.go).pkg/pagestreamis LeapView's product-owned, signal-only Datastar subset for Gomponents MPA shells, the canonical/updatesSSE transport, and bounded in-process fan-out that disconnects slow subscribers. Product client identity and dashboard delivery policy remain outside the package.api/signals/main.tspis the source of truth for browser signal contracts. Generation produces feature-owned Go models and TypeScript types inweb/generated/signals/index.ts.internal/dashboard/ui/,internal/admin/ui/, andinternal/agent/ui/render gomponents document shells.web/components/contains Lit route and visual components.- ECharts is the built-in chart renderer. TanStack Table powers table state (columns, row models, sorting) behind LeapView-owned signal/query contracts; row windowing and virtualization are LeapView's own controller in
web/components/dashboard/table/.
GET /opens Insights;GET /exploreopens Data Explorer; Develop uses/sources,/models,/semantic-models,/pipelines, and/connections.- Dashboard routes are
GET /dashboards/{dashboard}and/dashboards/{dashboard}/pages/{page}. The server-bound project is never selected in browser routes. - Each page opens the canonical
GET /updates?...Datastar SSE stream fromdata-init. - Browser components emit small domain events. Gomponents attributes translate them into CSRF-protected Datastar commands.
- Domain handlers authorize the request, update stream state, execute governed DuckDB queries where needed, and publish typed signal patches through the product-owned Pagestream package.
- Lit components subscribe to signal paths and render without ad hoc data-fetch APIs. Reads arrive as signals; the only browser
fetchcalls are CSRF-protected command POSTs (web/components/shared/command.ts), file uploads (avatar and logo), and governed resource loads that signals cannot carry (map style and tile assets, chart data URLs, chat dashboard artifacts, saved explorations, and Data Explorer dashboard append targets). Do not add new read APIs to components; extend the signal contract instead.
cmd/leapview/main.goandinternal/app/cli/serve.go: process startup and lifecycle.cmd/leapview-site/main.goandinternal/app/site/http/: independently deployable public site startup and HTTP adapter.internal/app/router.goandinternal/app/runtime_router_routes.go: top-level router assembly and the platform, public, authentication, API, static, and error route groups; authenticated feature routes are mounted frominternal/*/module/routes.go.internal/project/compiler/compiler.go: project compilation entrypoint.internal/runtimehost/manager.go: serving-generation and snapshot-lease lifecycle.internal/analytics/materialize/runtime.go: query execution, coalescing, and cache integration.internal/analytics/query/planner.go: semantic query planning.internal/dashboard/runtime/: dashboard query orchestration and signal payload construction.internal/dashboard/ui/page.go: governed dashboard document shell.web/components/dashboard/dashboard-page.ts: interactive report surface.web/components/dashboard/table/report-table.ts: BI table component.docs/: authored and generated public documentation;site/: site-specific browser source and static assets..github/workflows/ci.yml: canonical parallel CI workflow.
task devbuilds, bootstraps, deploys, and starts the managed development server.task ciruns the fast pull-request contract locally; run it before a meaningful push while developing.task ci:prruns that same PR contract locally, with bounded Go and frontend lanes.task ci:fullruns static/race, desktop, route QA, and deployment validation in addition to the PR contract; the merge queue runs it against the exact candidate before merge.task ci:nightlyadds dependency security scans to the full contract and runs automatically every day.task ci:localremains a compatibility alias fortask ci:full. GitHub Actions runs the same contracts on ephemeral GitHub-hosted runners with correctness-independent remote caches.task generateregenerates sqlc, configuration, API, signal, and JSON Schema artifacts.task generated:checkverifies intentional public contract snapshots are current.task dev:status,task dev:logs, andtask dev:stopmanage the worktree-local server.
Use focused tests during iteration and task ci before handing off substantial changes. Follow red-green-refactor for features and fixes. Prefer long-term correctness, simplicity, robustness, and scalability over minimizing implementation cost.