MATIH Platform is in active MVP development. Documentation reflects current implementation status.
12. AI Service
BI Analytics Platform
Dashboards

Dashboards

Production - Dashboard CRUD, widget management, templates, cloning

The Dashboard system provides full CRUD operations for creating and managing BI dashboards. Each dashboard contains widgets arranged on a 12-column grid, with support for multiple data sources, chart types, and interactive filters.


12.4.2.1Dashboard API

Implemented in data-plane/ai-service/src/bi/api/dashboard_routes.py:

# Create dashboard
curl -X POST "http://localhost:8000/api/v1/bi/dashboards?tenant_id=acme-corp&user_id=user-123" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Sales Overview Q4 2024",
    "description": "Executive sales dashboard for Q4",
    "visibility": "team",
    "tags": ["sales", "quarterly", "executive"]
  }'
 
# List dashboards
curl "http://localhost:8000/api/v1/bi/dashboards?tenant_id=acme-corp&visibility=team&limit=20"
 
# Get dashboard detail
curl "http://localhost:8000/api/v1/bi/dashboards/{dashboard_id}?tenant_id=acme-corp"
 
# Add widget
curl -X POST "http://localhost:8000/api/v1/bi/dashboards/{dashboard_id}/widgets?tenant_id=acme-corp" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Revenue by Region",
    "widget_type": "bar_chart",
    "position": {"x": 0, "y": 0, "width": 6, "height": 4},
    "data_source": {
      "sql": "SELECT region, SUM(revenue) AS total FROM orders GROUP BY region",
      "cache_ttl_seconds": 300
    },
    "config": {
      "x_axis": "region",
      "y_axis": "total",
      "color_scheme": "blue",
      "show_legend": true
    }
  }'
 
# Create from template
curl -X POST "http://localhost:8000/api/v1/bi/dashboards/templates/executive_overview?tenant_id=acme-corp&name=My+Dashboard"
 
# Clone dashboard
curl -X POST "http://localhost:8000/api/v1/bi/dashboards/{dashboard_id}/clone?tenant_id=acme-corp&new_name=Copy+of+Dashboard"

Widget Types

TypeDescription
bar_chartVertical or horizontal bar chart
line_chartTime series or trend line chart
pie_chartPie or donut chart
scatter_plotScatter plot with optional trend line
tableData table with sorting and filtering
metricSingle KPI metric card
heatmapColor-coded matrix visualization
area_chartStacked or layered area chart