Architecture
browser ──► cubebi-web (Node/Express, :18450)
├─ React app: Explore · Charts · Dashboards · Data model
├─ /api/* charts & dashboards ──► Postgres db "bi_app"
└─ /cubejs-api/v1/{load,meta,sql,dry-run}
proxied with a server-signed JWT ──► cubebi-cube (Cube Core, :4000)
├─ Postgres db "warehouse" (read-only role)
└─ cubebi-cubestore (pre-aggregations)Components
| Service | Image | Role |
|---|---|---|
cubebi-db | postgres:16-alpine | Two databases. warehouse holds the business data; Cube reads it as cube_reader, a read-only role. bi_app holds the app's metadata: charts, dashboards, dashboard_items. |
cubebi-cube | cubejs/cube:v1.8.35 | Semantic layer in production mode. Compiles cube/model/, plans SQL, serves REST, runs the refresh worker. |
cubebi-cubestore | cubejs/cubestore:v1.8.35 | Stores and serves pre-aggregation rollups. |
cubebi-web | built from web/ | Express server plus the React app. |
Request flow
- The browser builds a Cube query: measures, dimensions, time dimension, filters.
cubebi-webforwards it to Cube with a JWT it signs itself. The API secret never reaches the browser, and the proxy only allowsload,meta,sqlanddry-run.- Cube compiles the query against the model. It answers from a Cube Store rollup when one matches, and otherwise generates SQL for Postgres.
- The web app renders the result with ECharts. Every chart also has a table view.
Web app
- Server (
web/server/index.js): Express 5,pg,jsonwebtoken. Provides the REST API for charts and dashboards, the Cube proxy, and static hosting.index.htmlis never cached; hashed assets are cached permanently. - Client (
web/client/src): React 19 with Vite, and@cubejs-client/core, which retries Cube's "Continue wait" responses for you. Pages use hash routing. - Charts: a palette checked for colour-blindness and contrast, in light and dark modes. Each series keeps the same colour wherever it appears, and long series lists are capped at 8.