Skip to content

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.

License

Notifications You must be signed in to change notification settings

mrbrightsides/mbg-dashboard

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

3 Commits
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

MBG Dashboard ๐Ÿฑ

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.

Built with Next.js TypeScript License: MIT


๐ŸŒŸ Overview

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

๐Ÿš€ Key Features

๐Ÿ“Š Multi-Role System

  • 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

๐Ÿ—บ๏ธ Real-Time Tracking

  • Live delivery maps with GPS tracking
  • Geofencing alerts when drivers enter school zones
  • Route visualization and optimization
  • Status updates across all stakeholders

โ›“๏ธ Blockchain Transparency

  • Immutable delivery records
  • Complete audit trails
  • Hash verification for data integrity
  • Government compliance ready

๐Ÿค– AI-Powered Features

  • 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

๐Ÿ“ฑ Mobile-First Design

  • Progressive Web App (PWA) support
  • Offline capability
  • Touch-optimized controls
  • Installable on any device

๐Ÿ’ฌ Multi-Channel Notifications

  • Push notifications
  • WhatsApp integration
  • In-app messaging
  • Email alerts (coming soon)

๐Ÿ“ธ Verification Systems

  • QR code generation and scanning
  • Photo verification of deliveries
  • Digital signatures
  • Timestamp tracking

๐ŸŒ Accessibility

  • Bilingual support (Bahasa Indonesia & English)
  • Weather monitoring and alerts
  • Responsive design for all screen sizes
  • WCAG accessibility standards

๐Ÿ› ๏ธ Technology Stack

Frontend

  • Framework: Next.js 14 (App Router)
  • Language: TypeScript 5
  • Styling: Tailwind CSS
  • UI Components: shadcn/ui, Radix UI
  • State Management: React Context API

Maps & Location

  • react-leaflet: Interactive maps
  • Geolocation API: GPS tracking
  • Geofencing: Zone-based alerts

Data Visualization

  • Recharts: Charts and analytics
  • React: Real-time data updates

QR & Scanning

  • qrcode.react: QR code generation
  • html5-qrcode: Camera scanning

PWA & Offline

  • Service Workers: Offline support
  • Web App Manifest: Installation
  • IndexedDB: Local storage

Voice & AI

  • Web Speech API: Voice recognition
  • Speech Synthesis: Text-to-speech
  • Custom AI: Chatbot logic

๐Ÿ“ฆ Installation

Prerequisites

  • Node.js 18+
  • npm or yarn

Setup

  1. Clone the repository

    git clone https://github.com/mrbrightsides/mbg-dashboard.git
    cd mbg-dashboard
  2. Install dependencies

    npm install
  3. Run development server

    npm run dev
  4. Open in browser

    http://localhost:3000
    

๐ŸŽฏ Usage

Quick Login (Demo Mode)

The application includes quick login buttons for testing:

  • Admin โ†’ Full system access
  • Driver (Agus) โ†’ Delivery management view
  • School (SDN 01) โ†’ Meal tracking view

Manual Login

Enter credentials:

  • Username: admin / driver / school
  • Password: Any password (demo mode)

๐Ÿ“ฑ Features by Role

๐Ÿ›๏ธ Admin Dashboard (14 Tabs)

  1. Overview - KPIs, delivery statistics
  2. Live Map - Real-time GPS tracking
  3. Analytics - Charts and insights
  4. History - Searchable records with CSV export
  5. Notifications - Push notification management
  6. Route AI - AI-powered route optimization
  7. Performance - Driver leaderboard and metrics
  8. Predictions - 7-day demand forecasting
  9. Weather - Regional weather monitoring
  10. AI Chat - Intelligent chatbot assistant
  11. Voice - Voice command interface
  12. Blockchain - Immutable ledger explorer
  13. WhatsApp - Message broadcasting system
  14. Geofencing - Zone monitoring and alerts

๐Ÿšš Driver Dashboard (6 Tabs)

  1. My Deliveries - Assigned routes and tasks
  2. Route Map - Visual route planning
  3. Photo Verification - Camera capture for proof
  4. Notifications - Real-time updates
  5. Weather - Current conditions for route
  6. Voice - Hands-free controls while driving

๐Ÿซ School Dashboard (2 Tabs)

  1. Delivery Schedule - Incoming meal tracker
  2. Verify Delivery - QR code scanner

๐ŸŒ API Integration

Proxy Endpoint

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
  }),
});

๐Ÿ—๏ธ Project Structure

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

๐ŸŽจ Design System

Color Palette

  • 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

Typography

  • Headings: Bold, gradient text effects
  • Body: Clear hierarchy with proper contrast
  • Accessibility: WCAG AA compliant

๐Ÿ“Š Data Model

Core Entities

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 };
}

๐Ÿ” Security

  • 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

๐ŸŒ Internationalization

Supported languages:

  • ๐Ÿ‡ฎ๐Ÿ‡ฉ Bahasa Indonesia
  • ๐Ÿ‡ฌ๐Ÿ‡ง English

250+ translated strings across the entire application.


๐Ÿ“ˆ Performance

  • Bundle Size: ~460 KB (optimized)
  • Build Time: ~45 seconds
  • Lighthouse Score: 90+ (target)
  • Mobile Performance: Optimized with lazy loading

๐Ÿš€ Deployment

Vercel (Recommended)

  1. Push code to GitHub
  2. Import project in Vercel
  3. Deploy automatically

Docker

docker build -t mbg-dashboard .
docker run -p 3000:3000 mbg-dashboard

Manual

npm run build
npm start

๐Ÿค Contributing

Contributions are welcome! Please follow these steps:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/AmazingFeature)
  3. Commit changes (git commit -m 'Add AmazingFeature')
  4. Push to branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

๐Ÿ“ License

This project is licensed under the MIT License - see the LICENSE file for details.


๐Ÿ™ Acknowledgments

  • Indonesian Government for the MBG program initiative
  • Schools and drivers who inspired this solution
  • Open source community for amazing tools and libraries

๐Ÿ“ž Contact & Credits

Built with ๐Ÿ’š by


๐ŸŽฏ Roadmap

Phase 5 (Future)

  • 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

๐Ÿ’ก Impact

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 ๐Ÿ‡ฎ๐Ÿ‡ฉ

About

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.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages