How opencost/opencost-ui works
OpenCost UI presents Kubernetes and cloud cost information, with allocation analysis as a representative user workflow: request allocation data, retrieve it from the OpenCost API, then summarize and visualize costs. The tree also exposes newer dashboard/report workflows and legacy allocation, cloud-cost, and external-cost views, plus settings. The excerpts directly verify allocation fetching and selected chart/helper relationships; other feature ownership is identifiable from route/component paths, but their internal calls were not sampled, so those links are omitted rather than inferred.
Main entry points: root.tsx App shell · allocation.tsx Allocation route · allocation.ts Allocation service · external-services-chart-widget.tsx External services chart
Components 23
Application Shell
- App shell
app/root.tsx - Legacy navigation
app/components/legacy/Page.jsx - Settings
app/routes/settings.tsx
Allocation Analysis
- Allocation route
app/routes/legacy/allocation.tsx - Allocation service
app/services/allocation.ts - API client
app/services/api-client.ts - Allocation charts
app/components/legacy/AllocationChart/index.jsx - Range and summary charts
app/components/legacy/AllocationChart/RangeChart.jsx - Cost utilities
app/lib/legacy-util.ts
Cost Views
- Cloud cost route
app/routes/legacy/cloud.tsx - Cloud cost details
app/components/legacy/cloudCost/cloudCostDetails.jsx - Cloud cost service
app/services/cloud-cost.ts - External costs route
app/routes/legacy/external-costs.tsx - External services chart
app/components/external-services-chart-widget.tsx - External costs service
app/services/external-costs.ts
Dashboards And Reports
- Dashboard routes
app/routes/dashboard-list.tsx - Dashboard builder
app/components/dashboard-builder.tsx - Dashboard view
app/components/dashboard-view.tsx - Report routes
app/routes/report-builder.tsx - Report query
app/services/report-query.ts - Report results
app/components/report-results-view.tsx
Other components
- Cost analyst
- OpenCost API
Connections 19
- Cost analyst → App shell: opens UI
README.md - App shell → Allocation route: routes to
- App shell → Dashboard routes: routes to
- App shell → Report routes: routes to
- Allocation route → Allocation service: requests data
- Allocation service → API client: calls
app/services/allocation.ts - Allocation service → OpenCost API: fetches allocations
app/services/allocation.ts - Allocation route → Allocation charts: renders
- Allocation charts → Range and summary charts: selects chart
app/components/legacy/AllocationChart/index.jsx - Range and summary charts → Cost utilities: formats costs
app/components/legacy/AllocationChart/RangeChart.jsx - Cloud cost route → Cloud cost details: shows details
- Cloud cost details → Cloud cost service: fetches totals
app/components/legacy/cloudCost/cloudCostDetails.jsx - External costs route → External services chart: renders
- External services chart → External costs service: fetches costs
app/components/external-services-chart-widget.tsx - External services chart → Cost utilities: formats currency
app/components/external-services-chart-widget.tsx - Dashboard routes → Dashboard builder: builds dashboards
- Dashboard routes → Dashboard view: displays dashboards
- Report routes → Report query: queries reports
- Report routes → Report results: shows results