I'll create a comprehensive fitness analytics dashboard. First, let me install the necessary packages for charts and date handling.
Now let me update the index.html title and create all the dashboard components.
Now let me create the utility file for the cn function:
Now let me create all the dashboard components. I'll start with the types and data:
Now let me create the main App component that integrates all the components:
Now let me build the project to verify everything works correctly:
The project builds successfully. Let me enhance the index.css with some additional styling for smoother transitions:
Let me rebuild to confirm everything still works:
The project builds successfully. Let me verify all files are in place:
I've created a comprehensive fitness analytics dashboard with all the requested features. Here's a summary of what's included:
Features Implemented:
📊 KPI Summary Cards
- Total Workouts, Calories Burned, Average Duration, and Average Heart Rate
- Each card shows trend indicators with percentage changes vs. last month
- Color-coded icons and semantic coloring for positive/negative trends
📈 Interactive Charts (using Recharts)
- Area Chart: Calories Burned Trend (last 30 days)
- Bar Chart: Weekly Workout Duration
- Donut Chart: Workout Distribution by type
- Line Chart: Average Heart Rate Trend
- Bar Chart: Weekly Workout Frequency
- All charts have smooth animations and custom dark mode tooltips
📋 Sortable & Filterable Data Table
- Sort by any column (date, type, duration, calories, heart rate, intensity, segment)
- Search/filter workouts by text
- Pagination with smart page number display
- Workout type icons and intensity badges
🎛️ Live-Updated Filters
- Time Period: 7 Days, 30 Days, 90 Days, 1 Year
- Time of Day: All, Morning, Afternoon, Evening
- Workout Type: All, Running, Cycling, Swimming, Strength, Yoga, HIIT
- All charts and tables update instantly when filters change
🌓 Dark Mode Toggle
- Smooth transition between light and dark themes
- Persisted to localStorage
- Respects system preference on first visit
✨ Modern Design
- Clean, modern UI with gradients and shadows
- Sticky header with user profile
- Responsive grid layout (mobile to desktop)
- Hover effects and transitions throughout
📱 Fully Responsive
- Mobile-first design
- Adaptive layouts for all screen sizes
- Touch-friendly controls
Files built: index.html, src/types/index.ts, src/data/fitnessData.ts, src/context/ThemeContext.tsx, src/components/KPICard.tsx, src/components/Charts.tsx, src/components/DataTable.tsx, src/components/Filters.tsx, src/components/ThemeToggle.tsx, src/App.tsx, src/index.css