I'll build a comprehensive AI FinOps analytics dashboard. Let me start by exploring the project structure and then create all the files needed.
Now let me install recharts for charts and lucide-react for icons:
Now let me update the index.html title, then create all the source files. I'll start with the data layer, then components, then the main App.
Now let me create the data generation utility:
Now create the dark mode context:
Now let me create all the components. First, the FilterBar:
Now create the KPI cards:
Now the Token Usage Line Chart:
Now the Cost Bar Chart:
Now the Donut chart:
Now create the Team Cost Bar Chart:
Now the Data Table:
Now create the ThemeToggle component:
Now create a Header component:
Now update the main CSS file:
Now update the main App.tsx:
Now let's build the project to check for errors:
The project builds successfully. Let me verify it looks right by checking the built file:
The build is successful and the output is a single-file HTML with all code inlined. Let me check the src/main.tsx and src/utils/cn.ts files to ensure they're clean:
Everything looks good. The project builds successfully into a single-file HTML. Let me finalize by confirming the build once more:
The AI FinOps Analytics Dashboard is complete and builds successfully. Here's a summary of what was built:
Dashboard Features
📊 KPI Summary Cards (5 cards)
- Total Tokens - All model combined consumption with trend indicator
- Total Cost - Enterprise spend with % change arrow
- Total Requests - API call count
- Avg Latency - Response time across models
- Models Used - Number of unique frontier models in use
📈 Charts (4 interactive charts)
- Daily Token Usage (Area Chart) - Stacked area chart with toggleable model lines, smooth gradients, and hover tooltips showing exact values per model per day
- Daily Cost & Volume (Bar Chart) - Gradient bars with dual Y-axes (cost left, tokens right), hover shows both metrics
- Model Distribution (Donut Chart) - Interactive pie with hover glow effects, center label showing aggregate, and a legend with percentages
- Cost by Team (Horizontal Bar Chart) - Sorted cost breakdown per team with hover tooltips
🔍 Interactive Filters
- Date Range - 7/14/30/60/90 day selector
- Team Filter - Filter by engineering team
- Model Filter - Filter by specific model
- Reset Button - Appears when any filter is active
📋 Data Table
- 250+ realistic token usage records with sortable columns
- Live search across model, provider, team, application, and ID
- Full pagination with page controls
- Color-coded model badges
🎨 Design Features
- Dark/Light mode toggle with smooth Sun/Moon animation
- Persistent theme via localStorage
- Responsive layout - works on mobile through desktop
- Smooth CSS transitions on all state changes
- Sticky header with backdrop blur
- Animated entry (fade-in-up) for all sections
- Realistic sample data with growth trends and pricing models
Files built: index.html, src/utils/data.ts, src/contexts/ThemeContext.tsx, src/components/FilterBar.tsx, src/components/KPICards.tsx, src/components/TokenUsageLineChart.tsx, src/components/CostBarChart.tsx, src/components/ModelDonutChart.tsx, src/components/TeamCostChart.tsx, src/components/DataTable.tsx, src/components/ThemeToggle.tsx, src/components/Header.tsx, src/index.css, src/App.tsx