Let me start by installing the charting library and setting up the project.
Now let me create all the files for the dashboard. I'll start with the data layer and types.
Now let me create all the UI components.
Now let me create the data table component.
Now let me create the main App component and the index files.
Now let me update the HTML title and add custom CSS.
Let me build the project to check for errors.
The dashboard builds successfully. Here's a summary of what was created:
🚰 Agua + Pura Admin Analytics Dashboard
Files Created
| File | Purpose |
|---|
src/data/dashboard-data.ts | Realistic sample data generator with 90 days of daily revenue, segment data, monthly comparisons, and 50+ order records |
src/components/KpiCards.tsx | 6 KPI summary cards (Revenue, Orders, Customers, AOV, Satisfaction, Churn) with trend indicators and hover shimmer effects |
src/components/LineChartCard.tsx | Area/line chart with 3 toggleable series (Revenue, Orders, Customers), gradient fills, and custom hover tooltips |
src/components/BarChartCard.tsx | Grouped/stacked bar chart for monthly revenue by product line (Bottled, Dispensed, Wholesale) with toggleable view mode |
src/components/DonutChartCard.tsx | Donut chart with active sector expansion on hover, interactive legend, and percentage breakdowns |
src/components/DataTable.tsx | Fully sortable & filterable table with status badges, live count, and filtered indicator |
src/components/FilterBar.tsx | Date-range selector (7/30/90 days, year), multi-select segment dropdown with checkboxes, and search input |
src/App.tsx | Main layout with dark mode toggle, sticky nav with "Live" ping indicator, and auto-refresh every 45s |
src/index.css | Custom scrollbars, Recharts tooltip fixes, and smooth transition helpers |
Features
- Dark mode toggle with sun/moon icon switch, persisted across all components
- Live data refresh — regenerates sample data every 45 seconds and on filter change
- Segment filters that scale chart data and filter the data table in real-time
- Date range filter that updates KPIs, charts, and table simultaneously
- Sortable table with clickable column headers, ascending/descending toggles
- 3 chart types: Area (line), Bar (grouped/stacked), Donut — all with hover tooltips and smooth animations
- Responsive grid — 1 column on mobile → 2 cols on tablet → up to 6 KPI cards on desktop
- Clean modern UI with gradient accents, subtle shadows, and consistent spacing
Files built: src/data/dashboard-data.ts, src/components/FilterBar.tsx, src/components/KpiCards.tsx, src/components/LineChartCard.tsx, src/components/BarChartCard.tsx, src/components/DonutChartCard.tsx, src/components/DataTable.tsx, src/App.tsx, index.html, src/index.css