Makan Bergizi Gratis - Smart Distribution & Monitoring System
A comprehensive web application designed to transform the distribution and monitoring of Indonesia's Free Nutritious Meals (Makan Bergizi Gratis) program. This platform ensures transparency, efficiency, and accountability in getting meals from kitchens to students across the nation.
The MBG Dashboard addresses critical challenges in Indonesia's school meal distribution:
- Distribution chaos โ Real-time tracking and coordination
- Lack of monitoring โ Live dashboards with full visibility
- Supply chain opacity โ End-to-end transparency with blockchain
- Manual processes โ Automated workflows and AI optimization
- Admin Dashboard: Full oversight, analytics, and system management
- Driver Dashboard: Route optimization, delivery tracking, and mobile tools
- School Dashboard: Meal tracking, QR verification, and scheduling
- Live delivery maps with GPS tracking
- Geofencing alerts when drivers enter school zones
- Route visualization and optimization
- Status updates across all stakeholders
- Immutable delivery records
- Complete audit trails
- Hash verification for data integrity
- Government compliance ready
- Route Optimization: Reduce fuel costs and delivery time
- Demand Forecasting: Predict meal requirements 7 days ahead
- AI Chatbot: Intelligent Q&A assistant
- Voice Commands: Hands-free operation for drivers
- Progressive Web App (PWA) support
- Offline capability
- Touch-optimized controls
- Installable on any device
- Push notifications
- WhatsApp integration
- In-app messaging
- Email alerts (coming soon)
- QR code generation and scanning
- Photo verification of deliveries
- Digital signatures
- Timestamp tracking
- Bilingual support (Bahasa Indonesia & English)
- Weather monitoring and alerts
- Responsive design for all screen sizes
- WCAG accessibility standards
- Framework: Next.js 14 (App Router)
- Language: TypeScript 5
- Styling: Tailwind CSS
- UI Components: shadcn/ui, Radix UI
- State Management: React Context API
- react-leaflet: Interactive maps
- Geolocation API: GPS tracking
- Geofencing: Zone-based alerts
- Recharts: Charts and analytics
- React: Real-time data updates
- qrcode.react: QR code generation
- html5-qrcode: Camera scanning
- Service Workers: Offline support
- Web App Manifest: Installation
- IndexedDB: Local storage
- Web Speech API: Voice recognition
- Speech Synthesis: Text-to-speech
- Custom AI: Chatbot logic
- Node.js 18+
- npm or yarn
-
Clone the repository
git clone https://github.com/mrbrightsides/mbg-dashboard.git cd mbg-dashboard -
Install dependencies
npm install
-
Run development server
npm run dev
-
Open in browser
http://localhost:3000
The application includes quick login buttons for testing:
- Admin โ Full system access
- Driver (Agus) โ Delivery management view
- School (SDN 01) โ Meal tracking view
Enter credentials:
- Username: admin / driver / school
- Password: Any password (demo mode)
- Overview - KPIs, delivery statistics
- Live Map - Real-time GPS tracking
- Analytics - Charts and insights
- History - Searchable records with CSV export
- Notifications - Push notification management
- Route AI - AI-powered route optimization
- Performance - Driver leaderboard and metrics
- Predictions - 7-day demand forecasting
- Weather - Regional weather monitoring
- AI Chat - Intelligent chatbot assistant
- Voice - Voice command interface
- Blockchain - Immutable ledger explorer
- WhatsApp - Message broadcasting system
- Geofencing - Zone monitoring and alerts
- My Deliveries - Assigned routes and tasks
- Route Map - Visual route planning
- Photo Verification - Camera capture for proof
- Notifications - Real-time updates
- Weather - Current conditions for route
- Voice - Hands-free controls while driving
- Delivery Schedule - Incoming meal tracker
- Verify Delivery - QR code scanner
All external API calls use the proxy endpoint at /api/proxy:
const response = await fetch('/api/proxy', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
protocol: 'https',
origin: 'api.example.com',
path: '/endpoint',
method: 'GET',
headers: {},
// body: {} // optional
}),
});mbg-dashboard/
โโโ src/
โ โโโ app/
โ โ โโโ about/ # About page
โ โ โโโ admin/ # Admin dashboard
โ โ โโโ driver/ # Driver dashboard
โ โ โโโ school/ # School dashboard
โ โ โโโ api/ # API routes
โ โ โโโ layout.tsx # Root layout
โ โ โโโ page.tsx # Login page
โ โโโ components/
โ โ โโโ ui/ # shadcn/ui components
โ โ โโโ AdminDashboard.tsx
โ โ โโโ DriverDashboard.tsx
โ โ โโโ SchoolDashboard.tsx
โ โ โโโ DashboardLayout.tsx
โ โ โโโ Footer.tsx
โ โ โโโ [feature-components]/
โ โโโ contexts/
โ โ โโโ AuthContext.tsx
โ โ โโโ LanguageContext.tsx
โ โ โโโ DeliveryContext.tsx
โ โโโ lib/
โ โโโ utils.ts
โโโ public/
โ โโโ manifest.json # PWA manifest
โ โโโ service-worker.js # Service worker
โโโ README.md
โโโ package.json
โโโ tsconfig.json
- Primary: Green 600 โ Emerald 600 (MBG brand)
- Accents: Blue, Purple, Pink, Cyan
- Status Colors:
- ๐ข Green: Delivered / Success
- ๐ก Yellow: In Transit / Warning
- ๐ด Red: Failed / Error
- ๐ต Blue: Pending / Info
- Headings: Bold, gradient text effects
- Body: Clear hierarchy with proper contrast
- Accessibility: WCAG AA compliant
interface User {
id: string;
name: string;
role: 'admin' | 'driver' | 'school';
region: string;
}
interface Delivery {
id: string;
schoolId: string;
driverId: string;
status: 'pending' | 'in_transit' | 'delivered' | 'failed';
mealCount: number;
scheduledTime: string;
actualTime?: string;
location?: { lat: number; lng: number };
}
interface School {
id: string;
name: string;
address: string;
region: string;
studentCount: number;
location: { lat: number; lng: number };
}- Role-based access control (RBAC)
- Client-side authentication (demo mode)
- Blockchain verification for data integrity
- Secure API proxy for external calls
- Input validation and sanitization
Supported languages:
- ๐ฎ๐ฉ Bahasa Indonesia
- ๐ฌ๐ง English
250+ translated strings across the entire application.
- Bundle Size: ~460 KB (optimized)
- Build Time: ~45 seconds
- Lighthouse Score: 90+ (target)
- Mobile Performance: Optimized with lazy loading
- Push code to GitHub
- Import project in Vercel
- Deploy automatically
docker build -t mbg-dashboard .
docker run -p 3000:3000 mbg-dashboardnpm run build
npm startContributions are welcome! Please follow these steps:
- Fork the repository
- Create a feature branch (
git checkout -b feature/AmazingFeature) - Commit changes (
git commit -m 'Add AmazingFeature') - Push to branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Indonesian Government for the MBG program initiative
- Schools and drivers who inspired this solution
- Open source community for amazing tools and libraries
Built with ๐ by
- GitHub: @mrbrightsides
- Website: rantai.elpeef.com
- Telegram integration
- SMS fallback notifications
- Biometric verification
- AI computer vision for food quality
- Parent portal
- Nutrition tracking per student
- Waste management tracking
- Integration with government systems
This platform aims to:
- โ Ensure 100% transparency in meal distribution
- โ Serve 50,000+ students across Indonesia
- โ Reduce waste and delays through optimization
- โ Provide accountability via blockchain
- โ Empower government and NGOs with data-driven decisions
Made with โค๏ธ for Indonesia's children ๐ฎ๐ฉ