Cloud Mirror — a mirror that reflects your data, faithfully.
Open-source, developer-first analytics: a versioned semantic layer that makes dashboards correct by construction, with every dashboard emitted as real React code in your repo — editable via GUI or code, both views of the same source of truth.
Status: MVP. Semantic layer, query compiler, DuckDB/Postgres connectors, widget library, codegen, and a studio with live preview + GUI↔YAML editing.
- Vision:
docs/VISION.md - MVP plan:
docs/MVP_PLAN.md - Decisions:
docs/adr/
Requires Node ≥ 20 and pnpm.
git clone <this repo> && cd yunjing
pnpm install
pnpm build
pnpm --filter @yunjing/studio dev # → http://localhost:3000The studio opens on the demo project (a small SaaS: 240 users, ~500 orders seeded into in-memory DuckDB). From there:
- Preview — the right pane runs real queries through the semantic layer.
- Edit visually — drag a widget by its top bar, resize via the corner handle; watch the YAML on the left update (comments preserved).
- Edit as code — change a title or a metric reference in the YAML;
the preview re-renders on every valid keystroke. Invalid references get
squiggles with line numbers.
Save(or Cmd+S) writes to disk. - Add / remove widgets —
+ Widgetinserts a template into the YAML; select a widget and hitDeleteto remove it. - Connect your data — the bar above the preview accepts a Postgres URL or a local CSV/Parquet path (exposed as a DuckDB view, no ingestion). "tables" shows the introspected schema to write your semantic layer against.
- Export — emits
Dashboard.tsx+queries.ts+runtime.tsxinto a directory you choose. The generated code imports@yunjing/ui, passes stricttscand ESLint, and is yours to own.
To sanity-check the whole pipeline without the studio:
node examples/demo/smoke.mjs # specs → validation → SQL → DuckDB → codegen| File | Role |
|---|---|
semantic.yunjing.yaml |
Models, dimensions, metrics, joins — the trusted definitions (ADR-001) |
*.dashboard.yaml |
Layout + widgets, referencing metrics by name only — never raw SQL (ADR-002) |
| Generated React | Build artifact of the two specs; regenerate any time |
GUI edits and code edits both mutate the spec files. See
examples/demo/ for a complete example
(generate-seed.mjs regenerates the dataset deterministically).
pnpm install
pnpm build && pnpm lint && pnpm test| Path | Purpose |
|---|---|
packages/core |
Semantic layer: schema types, parser, validator |
packages/query |
Compiles metric requests → SQL; executes |
packages/connectors |
Postgres, DuckDB (CSV/Parquet via DuckDB) |
packages/codegen |
Dashboard spec → React components |
packages/ui |
Widget library (charts, tables, KPI cards) |
apps/studio |
GUI editor + code editor + live preview |