I'll build an interactive analytics dashboard for "Oil Fart" (the card game) with KPIs, charts, filters, and a data table. Let me first explore the project structure.
Tailwind v4 with the Vite plugin. Let me check the existing files.
Now I'll install recharts for the charts (stable v2 API with built-in animations and tooltips).
Let me install recharts without a version spec.
Let me check the installed recharts version to use the right API.
Recharts v3 is installed. Now let me check the cn utility and set up the foundation files (styles, HTML shell, formatters, theme context).
Now I'll create the foundation: global styles (Tailwind v4 with dark variant + fonts + animations), the HTML shell with fonts/title, number formatting helpers, and the theme context.
Foundation is set. Now the heart of the app: a seeded data engine that generates 120 days of realistic game telemetry (per platform + game mode), a card collection, a player roster, and all the aggregation functions that power every view.
Quick fix for an unused variable in the engine.
Now the shared UI pieces: the chart card wrapper, KPI cards with sparklines, the sticky header with dark-mode toggle, and the live filter bar (date range presets + custom dates + platform/mode segment chips).
Now the header (brand, live badge, dark-mode toggle) and the filter bar (date presets, custom date range, platform + mode segment chips).
I need to fix the "All" reset chips in the FilterBar — they should clear the selection, not toggle the first item. Let me update that.
Now the charts. First a shared tooltip card, then the activity chart (composed line/area with series toggles and dual axes), the mode donut, the card-usage bar chart, and the rarity mix panel.
Now the donut chart (revenue by game mode), the horizontal bar chart (top cards), and the rarity mix panel.
Now the centerpiece table — sortable, searchable, tier-filterable, paginated leaderboard that reacts to the global filters.
Now the main App that wires everything together with live filter state.
All components are in place. Let me build to verify everything compiles.
The build succeeds. Now let me polish a few details for better UX: date inputs should reflect the active preset range, card bars should show emoji labels, the table sort arrow needs its group class, and I'll clean up a leftover variable in the engine.
Now update App to keep the date inputs in sync with the active preset range (and seed both values consistently when the user switches to a custom range).
Let me rebuild to confirm all the polish edits compile cleanly.
Build is green. One subtle robustness fix: React's useId() returns IDs containing colons (:r0:), which can break SVG gradient url(#...) references in some browsers. Let me sanitize those in the sparkline and activity chart.
Let me do a final review of the main files to catch any wiring issues before the last build.
Everything is wired correctly. Final build to confirm.
The FartMetrics dashboard is complete and builds cleanly. Here's what I built:
🎛️ Live filters (every view reacts instantly)
- Date range — 7D / 14D / 30D / 90D / All presets plus custom start→end date pickers that stay in sync with the active preset
- Segment filters — multi-select Platform chips (iOS, Android, Steam, Web) and Game Mode chips (Ranked, Casual, Blitz, Party) with colored dots and clear-to-All
📊 Views
- 4 KPI cards — Daily Active Players, Matches, Revenue, New Players — each with a gradient sparkline, animated delta chip (▲/▼ vs. previous equal-length period), and icon tile
- Game activity chart — composed area + line chart with toggleable series (players, matches, revenue, new players, win rate on a secondary % axis), dual axes, gradient fills, and hover tooltips
- Revenue by mode donut — animated slices with corner radius, center total, custom legend, and filtered modes that dim
- Top cards by play rate — horizontal bar chart color-coded by rarity, emoji-labeled ticks, rich tooltips (rarity, cost, plays, win rate)
- Rarity mix panel — animated share bars with play counts and avg win rate per rarity, plus a cheeky insight callout
- Player leaderboard — sortable columns (10 fields), live search, tier filter, pagination, medal ranks 🥇🥈🥉, win-rate bars, and an empty state
✨ Craft details
- Seeded data engine (120 days × 4 platforms × 4 modes) with growth trends, weekend seasonality, event spikes, and a 48-player roster — deterministic and realistic, so filters genuinely reshape every chart
- Dark mode toggle with persisted preference + system detection, smooth color transitions throughout
- Sticky glassy header with a pulsing "Live" badge, Space Grotesk display type + Inter, staggered fade-up entrances, slim scrollbars, and full responsiveness from mobile (stacked, scrollable table) to desktop (7-column grid hierarchy)
Files built: src/index.css, index.html, src/lib/format.ts, src/theme.tsx, src/data/engine.ts, src/components/ChartCard.tsx, src/components/KpiCard.tsx, src/components/Header.tsx, src/components/FilterBar.tsx, src/components/Tooltip.tsx, src/components/ActivityChart.tsx, src/components/ModeDonut.tsx, src/components/CardUsageChart.tsx, src/components/RarityMix.tsx, src/components/PlayerTable.tsx, src/App.tsx