I'll create a comprehensive fitness analytics dashboard. Let me start by exploring the project structure and then build it out.
Now let me install the charting library and icons, then build the full dashboard.
Now let me update the index.html title and CSS, then build all the components.
Now let me create the data generation module:
Let me fix the unused imports:
Now let me create the dashboard context for shared state:
Now let me create the individual components. First the header:
Now the KPI cards:
Now the chart components. Let me create a shared chart wrapper first, then each chart:
Let me fix the Pie chart type issue - recharts v2 might not have activeIndex on Pie. Let me adjust:
Wait, the Cell import is at the bottom, let me fix that:
Now the data table component:
Let me fix that unused variable:
Now let me create the main App component that brings everything together:
Let me build to check for errors:
The build succeeded. Let me verify the structure is clean and make a small improvement - let me add a member plan distribution donut as well and verify the overall layout:
The project builds successfully! Let me also double-check the data generates properly by reviewing the data file once more for any issues:
Everything looks great. The build succeeded and all components are in place. Let me provide a summary of what was built:
FitPulse Analytics Dashboard — Complete Build Summary
Architecture
- React + TypeScript + Vite + Tailwind CSS v4 with Recharts for charting, Lucide React for icons, and date-fns for date handling.
Features Built
🎛 Global Controls (Header)
- Date-range filter — toggle between 7 Days, 30 Days, 90 Days, 12 Months — every chart & KPI updates live
- Segment filter — All Members, Premium, Standard, Trial — data multipliers change revenue, check-ins, member counts
- Dark mode toggle — smooth transition, persists across all views
- Mobile-responsive filter bar for small screens
📊 KPI Summary Cards (6 cards)
- Active Members, Total Check-ins, Revenue, Avg Session, New Signups, Retention Rate
- Each has a trend indicator (↗ green / ↘ red), color-coded icon, and hover scale animation
- Staggered fade-in on mount
📈 Charts (7 visualizations)
- Check-ins & Active Members — Dual area chart with gradient fills
- Revenue Breakdown — Interactive donut chart with active slice expansion, center total label, and percentage legend
- Revenue Trend — Bar chart with gradient fills
- New Signups & Session Duration — Composed chart (bars + line) with dual Y-axes
- Peak Hours — Color-coded bar chart (red = busy, orange = moderate, blue = normal)
- Class Attendance — Horizontal bar chart for 8 class types with capacity tooltips
- Member Retention — Line chart with reference line showing 12-month average
All charts have: custom dark/light tooltips, smooth animations, responsive containers.
📋 Member Data Table
- 50 realistic member records with names, emails, plans, check-ins, spend, status
- Search — filters by name, email, or ID
- Status filter — Active / Inactive / At Risk
- Plan filter — Premium / Standard / Trial
- Sortable columns — click any header to cycle asc → desc → none
- Pagination — 10 per page with page buttons
- Color-coded badges for plans and status
🎨 Visual Design
- Clean modern card-based layout with consistent rounded-2xl corners
- Dark mode: deep gray-950 background with translucent cards
- Light mode: clean white-on-gray-50
- Sticky header with backdrop blur
- Live data indicator with pulsing animation
- Smooth scroll with styled scrollbars
- Inter font family via Google Fonts
- Fully responsive grid: 1-col mobile → 2/3-col desktop
Files built: index.html, src/index.css, src/data/generateData.ts, src/context/DashboardContext.tsx, src/components/Header.tsx, src/components/KPICards.tsx, src/components/ChartCard.tsx, src/components/charts/CheckInsChart.tsx, src/components/charts/RevenueChart.tsx, src/components/charts/DonutChart.tsx, src/components/charts/PeakHoursChart.tsx, src/components/charts/ClassAttendanceChart.tsx, src/components/charts/RetentionChart.tsx, src/components/charts/SignupsChart.tsx, src/components/MemberTable.tsx, src/App.tsx