A modern, responsive React dashboard for visualizing business metrics, revenue trends, user behavior, and marketing performance.
- Revenue Trends - Interactive line charts showing revenue over time
- Conversion Funnel - Visual funnel chart tracking user journey
- Feature Usage Heatmap - Color-coded grid showing feature popularity
- Usage Metrics - Login frequency and feature adoption by tier
- Campaign Performance - Top marketing campaigns with ROI
- Acquisition Channels - Pie chart of user acquisition sources
- Cohort Analysis - Retention rates by signup cohort
- Interactive Filters - Filter by date range and subscription tier
- Responsive Design - Works on desktop, tablet, and mobile
- Loading States - Smooth loading indicators
- Error Handling - User-friendly error messages
- Node.js (v14 or higher)
- npm (comes with Node.js)
- Backend API running (see
analytics-dashboard-apiREADME)
- Clone the repository
git clone <your-repo-url>
cd analytics-dashboard- Install dependencies
npm install-
Set up environment variables
Create a
.envfile in the root directory:
REACT_APP_API_URL=http://localhost:3001/api
- Start the development server
npm startThe app will open at http://localhost:3000
npm start- Start the development servernpm run build- Create production buildnpm test- Run testsnpm run eject- Eject from Create React App (one-way operation)
src/
βββ components/
β βββ charts/
β β βββ RevenueTrends.js # Revenue line chart
β β βββ FunnelChart.js # Conversion funnel
β β βββ ChurnTable.js # Cohort analysis table
β β βββ FeatureHeatmap.js # Feature usage heatmap
β β βββ UsageMetrics.js # Usage statistics
β β βββ CampaignPerformance.js # Campaign table
β β βββ AcquisitionChannels.js # Channel pie chart
β βββ filters/
β β βββ DashboardFilters.js # Date and tier filters
β βββ layout/
β β βββ Header.js # App header
β β βββ MetricCard.js # Summary metric card
β βββ Loading.js # Loading spinner
βββ services/
β βββ api.js # API service layer
βββ App.js # Main app component
βββ App.css # App styles
βββ index.css # Global styles
Four key metrics displayed at the top:
- Total Revenue
- Total Users
- Engagement Rate
- Features Tracked
Line chart showing monthly revenue over time with filtering support.
Horizontal bar chart showing the conversion rates through:
- Visits β Signup β Trial β Purchase β Upgrade
Color-coded grid showing feature popularity:
- π΅ Blue = Low usage
- π‘ Orange = Medium usage
- π΄ Red = High usage
- Login frequency by subscription tier
- Top 5 most-used features
Table showing top 10 campaigns by revenue with ROI calculations.
Pie chart and table breaking down users by acquisition channel.
Table showing retention rates by signup month and subscription tier.
Primary colors are defined in component styles:
- Blue:
#3b82f6 - Purple:
#8b5cf6 - Pink:
#ec4899 - Orange:
#f59e0b - Green:
#10b981
Change the backend API URL in .env:
REACT_APP_API_URL=https://your-api-url.com/api
The dashboard is fully responsive with breakpoints:
- Desktop: 1400px max-width
- Tablet: Grid layouts adapt with
auto-fit - Mobile: Single column layouts on small screens
Uses Recharts for all visualizations. Change chart types and configurations in individual chart components.
Uses date-fns for date operations.
Verify:
- Backend is running on port 3001
.envfile has correctREACT_APP_API_URL- CORS is enabled on backend
Check:
- Data is loading from API (open browser dev tools)
- No console errors
- Components are receiving correct props
Ensure:
- Date format is YYYY-MM-DD
- Backend API supports date filtering
- Filter state is updating correctly
npm run buildThis creates an optimized production build in the build/ folder.
- Push code to GitHub
- Import project in Vercel
- Set environment variable:
REACT_APP_API_URL - Deploy!
- Push code to GitHub
- Connect repository in Netlify
- Build command:
npm run build - Publish directory:
build - Add environment variable:
REACT_APP_API_URL
- react - UI library
- recharts - Charting library
- axios - HTTP client
- date-fns - Date utilities
This project is for educational/portfolio purposes.