Let me build this comprehensive dashboard. I'll start by installing the required packages and then create all the components.
Now let me update the index.html title and create all the component files. I'll start with the data layer and work up.
Now let me create the main App.tsx that ties everything together into a complete dashboard:
Now let me update the CSS with proper dark mode configuration and some additional styles:
Let me build the project to check for any issues:
The build succeeded. Let me verify all files are in place and review the final structure:
Everything is properly connected. The project builds successfully. Here's a summary of what was built:
AdPulse — Advertising Analytics Dashboard
Architecture
- 11 files across a clean structure: data layer, hooks, reusable components, and a main orchestrating
App.tsx
Features Delivered
📊 KPI Summary Cards (6 cards)
- Impressions, Clicks, Conversions, Total Spend, Avg. CTR, and Avg. ROAS
- Each shows a trend badge with % change (up/down/neutral) using color-coded pills (green/red/gray)
- Hover lift animation with gradient overlays
📈 Charts (4 chart types)
- Area/Line Chart — Performance over time (impressions, clicks, conversions) with gradient fills
- Bar Chart — Weekly Spend vs Revenue comparison with rounded bar tops
- Donut Chart — Revenue by channel segment with center hole
- Horizontal Bar Chart — ROAS by channel with color-coded bars
- All charts have custom styled tooltips, smooth entry animations (staggered), and responsive containers
📋 Data Table
- Full-text search across campaign names and platforms
- Status filter pills (All/Active/Paused/Completed)
- Column sorting (click any header) with directional arrows
- Pagination with page numbers
- ROAS color-coding (green ≥4x, indigo ≥2.5x, red <2.5x)
- Status badges with semantic colors
🔍 Filters
- Date Range toggle: 7D, 14D, 30D, 90D, 6M, All — filters all charts + KPIs live
- Segment toggle: All, Search, Display, Social, Video, Email — filters all views live
🌓 Dark Mode
- Toggle in the header with animated sun/moon indicator
- Persisted to localStorage, respects
prefers-color-scheme
- Smooth 200ms transitions on all theme-sensitive elements
🎨 Design
- Clean slate/indigo color palette with accent colors
- Card-based layout with rounded-2xl corners, subtle borders, and shadows
- Responsive grid: 1-col → 2-col → 6-col for KPIs, stacked → side-by-side for charts
- Sticky header with frosted glass effect (backdrop-blur)
- "Live Data" indicator with pulsing dot
Files built: index.html, src/data/sampleData.ts, src/hooks/useDarkMode.ts, src/components/KPICard.tsx, src/components/Charts.tsx, src/components/DataTable.tsx, src/components/Filters.tsx, src/components/DarkModeToggle.tsx, src/App.tsx, src/index.css