I'll build a fitness analytics dashboard with KPIs, charts, filters, and a data table. Let me first explore the project setup.
The project uses Tailwind CSS v4 with React 19. I'll build a fitness analytics dashboard ("Pulse") with Recharts for charts. Let me install dependencies and check a couple of config files.
Packages installed. Let me check the TypeScript config to understand strictness settings.
Now I'll create the foundation: global styles with Tailwind v4 dark-mode variant, updated page title, a cn utility, and the data layer (seeded realistic data generator + analytics aggregation).
Foundation is set. Now the core data layer — a seeded, realistic generator for daily metrics and workout sessions, plus date/number formatting utilities.
Data generator created. Now the analytics layer — windowing/filtering, KPI computation with trends, and all chart-series builders.
Quick fix — I forgot to import formatNumber in analytics.ts.
Now the shared UI primitives: sparkline, chart tooltip, card wrapper, and KPI card.
Shared primitives done. Now the Header (with dark mode toggle) and FilterBar (date-range + segment filters).
Let me fix the FilterBar to display the actual active date range (I referenced a prop I didn't pass).
Now the three main charts plus the leaderboard card and the sortable/filterable data table — all independent files, created in parallel.
All components are in place. Now the main App that wires state, filters, theme, and layout together.
A naming collision — my window variable shadows the global window object. Let me rename it.
Now updating the remaining references in the JSX.
All type errors resolved. Let me build the project to verify everything compiles.
Build succeeded. Let me do a final consistency check for any leftover shadowed references and verify the FilterBar file is clean.
Everything checks out. Let me make one small UX refinement to the shared tooltip — when a chart passes a label (like the donut's workout type), showing the row name again is redundant, so I'll hide it for single-entry payloads.
Actually, "Value" is a bit awkward — let me make it cleaner by omitting the name column entirely for single-entry tooltips with a header.
Let me simplify further — for single-entry tooltips, just show the value without a redundant label row.
Let me rebuild to confirm everything still compiles cleanly.
The build is successful. The fitness analytics dashboard is complete.
What I built — Pulse · Fitness Analytics Dashboard
Data layer (src/lib/data.ts, src/lib/analytics.ts)
- A seeded PRNG generates 180 days of realistic data across three membership plans (Free / Pro / Elite), with weekly seasonality (weekend step boosts, mid-week dips), a gradual improvement trend, seasonal sine variation, and per-member workout sessions (Running, Cycling, Strength, HIIT, Yoga, Swimming) with statuses. Data is deterministic across reloads and always ends "today."
- Aggregation layer computes date-windowed slices, previous-period comparisons, KPI deltas, and all chart series.
KPI summary cards — 5 cards (Steps, Calories, Workouts, Active Minutes, Avg Sleep) with trend badges (▲/▼/– vs. the previous equal-length period) and mini area sparklines, all animated.
Charts (Recharts, custom glassmorphic tooltips, 700ms eased transitions)
- Line/area combo — daily steps (gradient area) + calories (line) on dual axes, with a Daily/Cumulative toggle.
- Grouped bar chart — active minutes per week, colored by membership plan.
- Donut chart — calorie mix by workout type with interactive hover (dims other slices, syncs with its legend) and a center total.
Data table — sortable on all 8 columns (with direction indicators), text search, status filter chips with live counts, and pagination, all respecting the global filters.
Live filters — date-range pills (7D/30D/90D/6M) and segment pills update KPIs, every chart, the leaderboard, and the table simultaneously, with Recharts animating between states.
Design — Inter typography, indigo/violet accents, rounded-2xl cards, sticky blurred header, decorative top glow, and a persistent dark mode toggle (respects system preference, saved to localStorage) that re-themes charts via CSS variables. Fully responsive from mobile (2-col KPIs, scrollable table) to desktop (5-col KPI row, 3-col chart grid).
Files built: src/index.css, index.html, src/lib/cn.ts, src/lib/data.ts, src/lib/analytics.ts, src/components/Sparkline.tsx, src/components/ChartTooltip.tsx, src/components/ChartCard.tsx, src/components/KpiCard.tsx, src/components/Header.tsx, src/components/FilterBar.tsx, src/components/ActivityTrendChart.tsx, src/components/WeeklyBarChart.tsx, src/components/ActivityDonut.tsx, src/components/TopMembers.tsx, src/components/WorkoutsTable.tsx, src/App.tsx