The goal is to build a lightweight, responsive web management console for CubeOne (Community Edition). CubeOne is a high-performance, in-memory OLAP engine. This Web UI will serve as the primary interface for users to model data, manage cubes, and perform analysis via standard REST APIs.
Target UX: We aim to provide a "Classic Explorer" style interface familiar to FP&A professionals.
Note on References: The images and descriptions below refer to industry-standard layouts (similar to TM1 Architect) strictly for functional workflow and layout reference.
Do NOT copy any specific color schemes, icons, or proprietary visual assets. We are building a modern, original UI using open-source component libraries (e.g., Element Plus, Ant Design).
Important Distinction: While our Backend API (FastAPI) is Resource-Oriented (flat lists of Dimensions, Cubes, etc.), the Web UI must be Object-Oriented and Hierarchical.
We are NOT building a simple flat 'API Admin Panel'—we already have the built-in FastAPI docs for that. We are building a contextual management tool.
| Concept | Backend API (Flat) | Frontend UI (Hierarchical) |
|---|---|---|
| Structure | /cubes, /views, /dimensions, /subsets are separate endpoints. |
An "Instance" node visually contains its related Cubes and Dimensions. A "Cube" node visually contains its related Dimensions, Views, and Rules. A "Dimension" node visually contains its related Subsets. |
| Context | Global. You get a list of all dimensions. | Contextual. You see dimensions belonging to a specific Cube. |
| Navigation | Linear. | Tree-based drill-down. |
- Input: Server IP, Port, Instance Name (Optional: Username/Password for future Enterprise compatibility).
- Action: "Connect" button that calls
/cube/listand/dimension/listor/server/statusto verify connection.
Reference Image: docs/images/ui_ref_tree_structure.png
The left sidebar is the heart of the application. It maps the server structure into a collapsible Tree View. The frontend must reorganize the flat API data into the following hierarchy:
- 📍 Root Node: Instance Name (e.g., "PA_Training")
- 📂 Cubes (Folder)
- 🧊 [Cube Name] (e.g., "Sales_Plan") -> Key UI Logic Here!
- 📂 Dimensions (Virtual Folder)
- Lists the specific dimensions used by this cube (e.g., "Version", "Month").
- 📂 Views (Virtual Folder)
- Lists saved views for this cube.
- 📜 Rules (File icon)
- Click to open the Rule Editor for this cube.
- 📂 Dimensions (Virtual Folder)
- 🧊 [Cube Name] (e.g., "Sales_Plan") -> Key UI Logic Here!
- 📂 Dimensions (Folder - Global List)
- 📏 [Dimension Name] (e.g., "Product")
- 📂 Subsets (Virtual Folder)
- Lists subsets belonging to this dimension (e.g., "Default", "All Products").
- 📂 Subsets (Virtual Folder)
- 📏 [Dimension Name] (e.g., "Product")
- 📂 Cubes (Folder)
Developer Note (Chaining Calls): You will need to chain API calls. For example, when expanding Dimensions folder under a Cube node, you may need to call
GET /cube/{cube_name}to find out which dimensions belong to it, and then render them as children nodes. Same for other components folder, such as views, subsets, etc.
Reference Image: docs/images/ui_ref_cube_viewer.png
When a user opens a Cube or a View, the main content area should render a high-density data grid (Pivot Table).
Layout Requirements:
- Toolbar (Top)
- View Selector: Dropdown to switch between saved views.
- Actions: "Recalculate" (Refresh data), "Zero Suppress" (Hide empty rows/cols).
- Dimension Layout (Pivot Area)
- Titles (Filters): Dimensions placed at the top. User selects one element to filter the data.
- Rows: Dimensions stacked vertically on the left. Support nested headers (e.g., Year -> Quarter).
- Columns: Dimensions placed horizontally across the top.
- The Grid (Center)
- Read/Write: Cells should display values. (MVP: Read-only is fine; Goal: Editable inputs).
- Freeze Panes: Row and Column headers must remain visible when scrolling.
When the Rules node under a cube is clicked:
- Load: Call
GET /cube/rule/view_rawto retrieve the existing rule script. (Show blank if empty). - Edit: Provide a simple code editor (e.g., Monaco Editor or simple Textarea).
- Save: Call
POST /cube/rule/edit_rawto save the changes.
These images are for layout structure reference only.
Shows how Cubes, Dimensions, and Subsets should be nested.
Shows the "Pivot" layout with Titles, Rows, and Columns.
Crucial Developer Note: The CubeOne Server provides atomic REST APIs. The Frontend is responsible for chaining these calls and transforming the data structures (e.g., constructing a Tree from parent-child edges).
Below is the mapping between UI Components and the actual Server Endpoints.
The frontend needs to build a multi-level tree. Since there is no single "Get Whole Tree" endpoint, you must fetch metadata level-by-level or construct it from flat definitions.
| UI Node Level | Data Needed | Target Endpoint | Integration Logic |
|---|---|---|---|
| 1. Instance | List of Cubes | /cube/list |
Call to get all cube names to populate the first level folders. |
| 2. Cube Children | List of Dims in a Cube | /cube/get |
Input: { "names": "Sales_Plan" }. Response contains "dimensions": [...]. Use this list to render the "Dimensions" folder under a specific cube. |
| 3. Global Dims | List of All Dims | /dimension/list |
Populate the global "Dimensions" folder at the bottom of the tree. |
| 4. Subsets | List of Subsets | /dimension/subset/list |
Input: { "dimension": "Product" }. Lists all subsets for that dimension. |
The dimension editor needs to show the parent-child structure (Ragged Hierarchy).
| Feature | Target Endpoint | JSON Payload Key | Frontend Logic |
|---|---|---|---|
| Load Hierarchy | /dimension/get |
{ "name": "Year" } |
Critical: The response returns "edges": [ ["All_Years", "FY23"], ... ]. The Frontend MUST implement an algorithm to convert these flat parent-child pairs into a nested Tree structure for the UI. |
| Update Hierarchy | /dimension/set |
{ "name": "Year", "edges": [...] } |
To move a node, update the edges array and send it back. |
The Grid is the most complex component. It requires defining exactly what is on Rows, Columns, and Titles.
| Feature | Target Endpoint | Usage Note |
|---|---|---|
| Render Grid | /view/grid |
This is the core query API. You must construct a JSON body defining the view layout: { "cube_name": "...", "rows": [...], "columns": [...], "titles": [...] }.The server returns the calculated cell values. |
| Save View | /view/set |
Saves the current grid layout definition to the server. |
| List Views | /view/list |
Lists saved views to populate the dropdown selector. |
| Feature | Target Endpoint | Usage Note |
|---|---|---|
| Read Rules | /cube/rule/view_raw |
Returns the raw TM1-style rule script string (e.g., ['Sales'] = N: ...). |
| Save Rules | /cube/rule/edit_raw |
Accepts the full rule script string. Note: This overwrites the existing rules for the cube. |
💡 Tip for Frontend Developers: Please refer to CubeOne_Function_Reference) for the exact JSON request/response schema for each endpoint mentioned above.