Flipkart Gridlock Hackathon 2.0 - Prototype Round 2
Theme 2: Event-Driven Congestion (Planned & Unplanned)
- Host: Flipkart in partnership with Bengaluru Traffic Police (BTP) & MapmyIndia
- Phase: Prototype Round 2 (Virtual Round)
- Team: Solo Submission
- Theme Selected: THEME 2: Event-Driven Congestion (Planned & Unplanned)
Political rallies, festivals, sports events, construction activities, and sudden gatherings create localized traffic breakdowns. Currently, event impact is not quantified in advance, and resource deployment is entirely experience-driven without a unified post-event learning system.
NammaGrid leverages historical and real-time data to forecast event-related traffic impact and autonomously recommend optimal manpower, barricading, and diversion plans to the command center.
NammaGrid is a predictive traffic intelligence dashboard built specifically for the Bengaluru Traffic Police's traffic management system. It aggregates live simulated feeds (like BookMyShow data, weather APIs, and social media) and runs them through a custom machine learning pipeline to predict gridlock before it happens.
- Live Feed Aggregation: The system continuously monitors inputs for planned events (Cricket matches, rallies) and unplanned events (waterlogging, accidents).
- AI Inference Pipeline: A Scikit-Learn Random Forest model analyzes the event's location, crowd size, priority, and cause against historical Bengaluru traffic datasets.
- Fuzzy Logic Risk Assessment: The predicted delay is passed through a fuzzy logic system to determine the ripple effect, risk level, and required physical resources (officers and barricades).
- Dynamic Mapping: MapmyIndia (Mappls API) visualizes the exact blast radius of the congestion and automatically maps out an intelligent diversion route.
- Automated Advisory: The system generates a one-click WhatsApp/Twitter public advisory to alert commuters instantly.
- React 19 + Vite: High-performance rendering for the real-time command dashboard.
- Tailwind CSS v4: For the pristine, modern, Gridlock 2.0-inspired UI.
- Mappls API: Official MapmyIndia SDK integration for local geographical plotting and diversion routing.
- FastAPI: Asynchronous Python web framework for lightning-fast ML inference APIs.
- Scikit-Learn: Machine Learning library powering the
RandomForestRegressordelay prediction model. - Scikit-Fuzzy: Implements fuzzy logic to calculate qualitative metrics (Risk Level, Resource Allocation).
- Pandas / NumPy: High-performance data manipulation and mathematical scaling.
- NetworkX: Used for graph-based alternative route generation and node traversal.
GridlockRound2/
├── backend/ # Python FastAPI + ML Backend
│ ├── main.py # Core API Router, Mappls integration, and Fuzzy Logic engine
│ ├── ml_model.py # Scikit-Learn RandomForest Model training and prediction inference
│ ├── test_route.py # Unit tests for Mappls API and routing engine
│ └── requirements.txt # Python dependencies (fastapi, scikit-learn, networkx, etc.)
│
├── frontend/ # React UI Command Center
│ ├── index.html # Entry point with MapmyIndia SDK script injection
│ ├── src/
│ │ ├── App.jsx # Main Layout Controller (Sidebar + Main Panel View state)
│ │ ├── MapplsMap.jsx # React wrapper for MapmyIndia SDK (Heatmaps, Polylines, Markers)
│ │ ├── Analytics.jsx # Placeholder for broader city-wide analytics
│ │ ├── constants.js # Shared enums, API URLs, and UI Config
│ │ ├── components/
│ │ │ ├── LandingPage.jsx # Split-view hero page with scenario quick-launch
│ │ │ ├── Header.jsx # Global navigation and Features Modal
│ │ │ ├── LiveFeeds.jsx # Simulated API aggregator for incoming city events
│ │ │ ├── SidebarForm.jsx # Event parameter input panel (Cause, Crowd, Location)
│ │ │ └── ResultsPanel.jsx # Sticky dashboard for KPIs, ROI Analysis, and Map View
│ │ └── index.css # Global Tailwind styles & custom animations
│ │
│ ├── package.json # Node dependencies (React, Tailwind, Vite)
│ └── vite.config.js # Vite bundler configuration
│
└── README.md # Project Documentation
- Predictive ML Engine: Uses historical data to predict exactly how long an intersection will be blocked and calculates the geographical ripple effect.
- Resource Optimization: Tells the precinct exactly how many traffic officers and barricades to deploy based on event scale and predicted spillover.
- Live Heatmap Visualization: Draws a translucent, non-intrusive heatmap circle directly over the affected corridor on the Mappls map.
- ROI & Impact Analysis: Instantly calculates the total "Time Saved per Commuter" comparing the delay with and without AI-driven intervention.
- Automated Social Broadcasting: Floating action button that generates a pre-formatted, hashtag-ready traffic advisory for WhatsApp and Twitter.
- Node.js (v18+)
- Python (3.10+)
- Mappls API Key (Configure in
backend/.envandfrontend/index.html)
cd backend
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
pip install -r requirements.txt
uvicorn main:app --reload --port 8000cd frontend
npm install
npm run devThe application will launch on http://localhost:5173. Select a scenario from the landing page to trigger the predictive pipeline!
