A responsive food delivery dashboard built with Next.js and React, featuring a modern UI with interactive charts, metrics, and comprehensive testing.
- Responsive Design: Fully responsive layout that adapts from desktop to tablet to mobile
- Interactive Charts: Bar charts, donut charts, circular progress, and line charts
- Food Delivery Metrics: Revenue tracking, order analytics, rating system, and popular items
- Modern UI: Clean, professional design with Tailwind CSS matching GOODFOOD branding
- Component Architecture: Reusable React components with chart visualizations
- Data Management: Mock data for food delivery metrics and analytics
- Testing: Comprehensive test suite for the twoSum algorithm
dashboard_task_v2/
├── app/
│ ├── dashboard/
│ │ └── page.tsx # Main dashboard page
│ ├── layout.tsx # Root layout
│ ├── page.tsx # Home page (redirects to dashboard)
│ └── globals.css # Global styles
├── components/
│ ├── Header.js # GOODFOOD header with search and notifications
│ ├── Sidebar.js # Responsive sidebar with MENU and OTHERS sections
│ ├── BarChart.js # Revenue bar chart component
│ ├── DonutChart.js # Order time donut chart component
│ ├── CircularProgress.js # Rating circular progress component
│ └── LineChart.js # Order line chart component
├── data/
│ └── mock.js # Mock data for food delivery metrics
├── utils/
│ └── twoSum.js # Two Sum algorithm implementation
├── __tests__/
│ └── twoSum.test.js # Comprehensive test suite
└── package.json
Run the test suite to verify the twoSum algorithm:
npm testThe test suite includes:
- ✅ Positive test cases (basic functionality, negative numbers, duplicates)
- ✅ Negative test cases (no solution, empty input, invalid data)
- ✅ Edge cases (non-numeric values, large numbers, multiple solutions)
- GOODFOOD branding with purple logo
- Centralized search functionality
- User profile with "Delicious Burger" branding
- Notification bell with red indicator
- MENU section: Dashboard, Food Order, Manage Menu, Customer Review
- OTHERS section: Settings, Payment, Accounts, Help
- Mobile-friendly with overlay and smooth transitions
- Active state indicators with purple theme
- BarChart: Revenue visualization with dual data series
- DonutChart: Order time distribution with interactive segments
- CircularProgress: Rating system with multiple categories
- LineChart: Order trends with dual-line comparison
The dashboard is fully responsive with breakpoints:
- Desktop (1024px+): Full sidebar, multi-column layout
- Tablet (768px-1023px): Collapsible sidebar, adjusted grid
- Mobile (<768px): Hidden sidebar, single column, mobile menu
- Search Bar: Centralized search functionality in header
- Chart Visualizations: Interactive bar charts, donut charts, and line graphs
- Mobile Menu: Collapsible sidebar for mobile devices
- View Report Buttons: Interactive buttons for detailed analytics
- Hover Effects: Smooth transitions and interactive elements
The twoSum function finds two numbers in an array that add up to a target value:
twoSum([2, 7, 11, 15], 9) // Returns [0, 1]Features:
- O(n) time complexity using HashMap
- Input validation and error handling
- Handles edge cases (empty arrays, invalid inputs, non-numeric values)
The dashboard includes realistic food delivery data:
- Revenue Data: 12 days of sales data with dual comparison
- Order Time Data: Morning, afternoon, and evening distribution
- Rating Data: Hygiene, packaging, and food taste ratings
- Most Ordered Food: Popular menu items with prices
- Order Data: 6 days of order trends with comparison lines
The application is ready for deployment on platforms like Vercel:
npm run build
npm startTotal Time Taken: Approximately 60 minutes
Completed: October 2025
Repository: Ready for deployment
Breakdown:
- Project setup and structure: 5 minutes
- Component development: 25 minutes
- Chart visualizations: 20 minutes
- Responsive design implementation: 10 minutes
✅ Pixel-accurate GOODFOOD dashboard design
✅ Interactive chart visualizations
✅ Comprehensive component architecture
✅ Robust testing with 15 test cases
✅ Clean, maintainable code structure
✅ Mobile-first responsive approach
npm run dev- Start development servernpm run build- Build for productionnpm run start- Start production servernpm test- Run test suitenpm run lint- Run ESLint
- Built with Next.js 16 and React 19
- Styled with Tailwind CSS
- Tested with Jest
- Fully responsive and accessible
- Production-ready code with proper error handling
- Custom SVG chart components