How wikar/dux works
DUX is an analytics stack: clients submit DAX-inspired DUX queries, which are parsed, resolved against a live semantic model, emitted as DuckDB SQL, and executed to return tabular results. The server also exposes schema and model operations, DuckLake imports and maintenance, and JSON-backed dashboards; the CLI runs queries locally. The UI adds a field-based query builder, Explorer, and dashboard designer. The README documents the major capabilities, while sampled source confirms selected query, client, dashboard-store, and import behavior; unsampled endpoint wiring is represented only where documented.
Main entry points: duxd/main.go HTTP server · executor.go Query executor · App.tsx Web UI · dux/main.go DUX CLI
Components 23
Clients
- Web UI
web/app/src/App.tsx - API client
web/core/src/client.ts - Query builder
web/core/src/generateQuery.ts - Visual query
web/app/src/dash/elementQuery.ts - DUX CLI
cmd/dux/main.go - Dashboard designer
web/app/src/dash/DashApp.tsx - Dashboard queries
web/app/src/dash/elementQuery.ts
Service
- HTTP server
cmd/duxd/main.go - Runtime startup
internal/bootstrap/bootstrap.go
Query pipeline
- Parser and AST
parser/parser.go - Semantic resolution
semantic/resolver.go - SQL emitter
emitter/emitter.go - Query executor
executor/executor.go
Data and model
- Schema and model
semantic/schema.go - Model metadata
semantic/metadata.go - DuckLake service
internal/ducklake/service.go - DuckLake runtime
internal/ducklake/ducklake.go - Lake catalog and data
Dashboards
- Dashboard API
dash/server.go - Dashboard store
dash/store.go
Other components
- Analyst
- HTTP client
- DuckDB
Connections 28
- Analyst → Web UI: uses
- Analyst → DUX CLI: runs queries
- HTTP client → HTTP server: calls API
- Web UI → Query builder: generates DUX
- Web UI → API client: requests data
- Dashboard designer → Dashboard queries: runs visuals
- Dashboard queries → Query builder: generates DUX
- Dashboard queries → API client: executes queries
- API client → HTTP server: calls REST
- DUX CLI → Runtime startup: starts runtime
- DUX CLI → Query executor: executes query
- HTTP server → Runtime startup: starts runtime
- HTTP server → Query executor: executes query
- HTTP server → Schema and model: serves schema
- HTTP server → DuckLake service: dispatches lake operations
- HTTP server → Dashboard API: serves dashboard API
- Query executor → Parser and AST: parses DUX
- Query executor → Semantic resolution: resolves query
- Query executor → SQL emitter: emits SQL
- Query executor → DuckDB: executes SQL
- Semantic resolution → Schema and model: reads model
- Schema and model → Model metadata: persists model
- DuckLake service → DuckLake runtime: uses owner
- DuckLake service → Lake catalog and data: imports and maintains
- DuckLake runtime → DuckDB: uses engine
- DuckDB → Lake catalog and data: reads and writes
- Dashboard API → Dashboard store: reads and writes
- Dashboard designer → Dashboard API: loads and saves