I'll create a comprehensive interactive analytics dashboard for a dog-focused pet business. Let me start by exploring the project structure and planning the implementation.
Good, I have a clear picture of the project. Let me install the needed charting and utility packages.
Now I'll build the full dashboard. Let me start with the data layer, then contexts, then components, and finally the App.
Now let me create the context providers for theme and filters:
Now let me create all the dashboard components. I'll build them in parallel:
Now let me create the chart components:
Now create the bar chart component:
Now the sortable, filterable data table:
Now let me create an additional engagement metrics chart:
Now let me write the main App component that brings everything together:
Let me add some global styles for smooth transitions and custom scrollbar:
Now let's build to check for any compilation errors:
The project builds successfully. Let me verify all files are in place:
The PawPulse Analytics Dashboard is built and compiles cleanly. Here's what was created:
Architecture
src/data/sampleData.ts — Generates 6 months of realistic daily data with seasonal waves, weekend dips, and upward trends. Includes breed popularity, service revenue splits, and 50 detailed dog records.
src/context/ThemeContext.tsx — Dark mode toggle persisted to localStorage, with system preference detection.
src/context/FilterContext.tsx — Date range (7d/30d/90d/6m/all) and segment (Premium/Standard/New Users/etc.) filters that flow live to every view.
Components (8 files)
| Component | What it does |
|---|
| Header | Sticky nav bar with logo, notification bell, animated sun/moon dark-mode toggle, user avatar |
| Filters | Dropdown selectors for date range and segment with a reset button when filters are active |
| KPICards | 6 cards (Revenue, Registrations, Subscriptions, Bookings, Conversion Rate, Active Users) each with trend badges showing % change vs previous period |
| RevenueLineChart | Dual-axis area chart (Revenue + Dog Registrations) with gradient fills, custom hover tooltip |
| ServiceDonutChart | Donut chart breaking revenue across 7 service categories, with hover dimming, center label, and full legend with $/percentage |
| BreedBarChart | Horizontal-sorted bar chart of 10 breeds by registrations with multi-detail tooltip (health score, spend, satisfaction) |
| EngagementChart | Composed chart mixing bars (bookings) + lines (conversion %, session duration) for engagement metrics |
| DataTable | Sortable by any column, searchable, filterable by status, paginated with page-size selector and health score progress bars |
Visual & UX
- Fully responsive (mobile → 1440px desktop)
- Dark mode toggle with smooth transitions across all components
- Consistent rounded-2xl card style, subtle borders, hover lift/shadow effects
- Charts use Recharts with 800ms ease animations
- Color palette: indigo primary, cyan/amber/emerald/purple/pink accents
Files built: index.html, src/data/sampleData.ts, src/context/ThemeContext.tsx, src/context/FilterContext.tsx, src/components/Header.tsx, src/components/Filters.tsx, src/components/KPICards.tsx, src/components/RevenueLineChart.tsx, src/components/ServiceDonutChart.tsx, src/components/BreedBarChart.tsx, src/components/DataTable.tsx, src/components/EngagementChart.tsx, src/App.tsx, src/index.css