Team Merge_Conflicts ยท India Innovates Hackathon 2026
Restoring the Golden Hour โ one green signal at a time.
Live Demo ยท Architecture ยท Edge AI ยท Setup Guide
- Overview
- The Problem
- Our Solution
- System Architecture
- Key Features
- Edge AI Module
- Tech Stack
- Project Structure
- Getting Started
- Environment Variables
- Pages & Routes
- Green Corridor System
- Signal Control Logic
- City Coverage
- Firebase Setup
- Team
- License
SignalSync is a full-stack AI-powered traffic management platform that combines real-time computer vision (YOLOv8), dynamic signal control, and emergency green corridor management to tackle India's most critical urban mobility challenges.
Built by Team Merge_Conflicts for the India Innovates Hackathon 2026, SignalSync demonstrates how edge AI and connected infrastructure can save lives during the critical Golden Hour โ the 60-minute window where timely medical intervention can mean the difference between life and death.
๐ก Key Insight: Ambulances in Indian cities spend 10โ15% of their journey time stuck at red lights. SignalSync eliminates that delay entirely.
| Problem | Impact |
|---|---|
| ๐ฅ Red-light delays for ambulances | 10โ15% of Golden Hour lost idling at signals |
| ๐ฆ Fixed-timer traffic signals | Waste fuel on empty lanes, ignore real-time density |
| ๐ก๏ธ VVIP convoy security | Stopped convoys become static security targets |
| ๐ No real-time visibility | Traffic control rooms lack live intersection intelligence |
| ๐ No automated preemption | Signal override requires manual radio coordination |
SignalSync operates on three integrated pillars:
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ SIGNALSYNC โ
โโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ ๐ฏ AI VISION โ ๐ข GREEN WAVE โ ๐ LIVE DASHBOARD โ
โ โ โ โ
โ YOLOv8 detects โ Dispatcher โ City-wide traffic โ
โ vehicles at โ creates a โ control center with โ
โ every inter- โ zero-stop โ real-time node status, โ
โ section in โ signal priority โ active corridors, and โ
โ real-time โ path for โ AI-powered density โ
โ โ ambulances โ analytics โ
โโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ 4-cam pipeline โ GPS tracking โ Signal cycle control โ
โ N/S/E/W feeds โ Auto-terminate โ Manual + AI override โ
โ Edge processing โ Firebase sync โ Emergency detection โ
โโโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
graph TB
subgraph Edge["๐ฏ Edge AI Layer"]
V1[CAM: NORTH] --> YOLO[YOLOv8 Model]
V2[CAM: SOUTH] --> YOLO
V3[CAM: EAST] --> YOLO
V4[CAM: WEST] --> YOLO
YOLO --> SC[Signal Controller]
YOLO --> MJPEG[MJPEG Streamer :8001]
end
subgraph Cloud["โ๏ธ Cloud Layer"]
FB[(Firebase Firestore)]
AUTH[Firebase Auth]
end
subgraph Frontend["๐ฅ๏ธ Frontend Layer"]
HP[Landing Page]
DB[Live Dashboard]
PT[Green Corridor Portal]
IM[Intersection Modal]
end
SC --> FB
MJPEG --> IM
FB --> DB
FB --> PT
AUTH --> PT
Data Flow:
- Edge cameras feed video into YOLOv8 for real-time vehicle detection
- Signal Controller analyzes N/S vs E/W density โ dynamically assigns GREEN to the denser axis
- MJPEG Streamer serves annotated video feeds with bounding boxes to the dashboard
- Firebase Firestore syncs signal states, corridor data, and intersection stats in real-time
- Dashboard displays live feeds, signal status, and emergency override controls
- Visuo-inspired dark violet-black aesthetic with animated purple spotlight
- Animated intersection hero with traffic light cycling N/S โ E/W phases
- Problem statement, three-pillar architecture breakdown, user flow diagrams
- Multi-language support (English, Hindi, Kannada, Telugu, Tamil, Marathi, Bengali, Gujarati)
- City picker โ 8 major Indian cities with instant data refresh
- AI Camera Network โ 6 real named intersections per city with live YOLO density
- 4-Direction Intersection Modal โ click any camera to open the N/S/E/W quad-view with:
- Real-time YOLO bounding boxes on each direction's video feed
- Independent signal poles per direction (GREEN/YELLOW/RED)
- Live density percentage and vehicle count per direction
- Traffic status banners (FLOWING / STOPPED / CLEARING)
- Signal Control Panel โ traffic light status, countdown timer, N/S vs E/W density bar
- Manual Override Controls โ Force Green, Force Red, Reset Auto per intersection
- Emergency Detection โ Force Emergency button simulates ambulance detection cascade
- IoT Auto-Preemption โ GPS-based signal preemption when ambulance is within 500m
- Live Green Corridors โ polls Firestore + localStorage every 1.5s for active corridors
- System Log โ timestamped event log showing all signal changes and detections
- ๐ Use My Location โ one-tap GPS auto-fill using Browser Geolocation API
- Route Finder โ Google Directions API with live traffic-aware routing (departure-time +
BEST_GUESS) - Initiate Green Wave โ saves corridor to Firestore, auto-selects 5 intersections along the route
- CorridorStatusBox โ animated GREEN โ / PREP โฑ / QUEUED status per node
- Traffic signal overlays โ colored rings at each node on the Google Map
- Live GPS Tracking โ
watchPosition()tracks vehicle with pulsing blue dot, map auto-recenters - Auto-terminate โ corridor removed from Firestore + localStorage 2.5s after arrival
- Firebase Authentication (Email/Password)
- Role-based access control โ
adminrole unlocks full signal override panel
- Admin-only route guarded by Firestore role check
- Full signal override capabilities
The edge-sim/ directory contains the Python-based Edge AI processing pipeline โ the brain of SignalSync's real-time traffic intelligence.
| File | Purpose |
|---|---|
streamer.py |
4-direction pipelined YOLO streamer with MJPEG output and signal control |
runner.py |
Standalone YOLO runner that pushes emergency events to Firebase |
firebase_client.py |
Firebase Admin SDK client for pushing intersection stats and events |
yolov8n.pt |
Pre-trained YOLOv8n model weights |
โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ
โ 4 Video โโโโโโถโ YOLOv8 Inference โโโโโโถโ Frame Buffer โ
โ Sources โ โ (every 4th frame)โ โ (3.5s batches) โ
โ N/S/E/W โ โ โ โ โ
โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโฌโโโโโโโโโ
โ
โโโโโโโโโโโโโโโโโโโโ โ
โ Signal โโโโโโโโโโโโโโโโโ
โ Controller โ density stats
โ (1s tick) โ
โโโโโโโโโโฌโโโโโโโโโโ
โ
โโโโโโโโโโผโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ
โ MJPEG Stream โโโโโโถโ Dashboard โ
โ :8001 โ โ (Browser) โ
โโโโโโโโโโฌโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ
โ
โโโโโโโโโโผโโโโโโโโโโ
โ Firebase Push โ
โ (2s interval) โ
โโโโโโโโโโโโโโโโโโโโ
Each direction (NORTH, SOUTH, EAST, WEST) has its own dedicated video file and processing pipeline:
| Direction | Video Source | Axis |
|---|---|---|
| NORTH | demo.mp4 |
N/S |
| SOUTH | WhatsApp Video 1.mp4 |
N/S |
| EAST | WhatsApp Video 2.mp4 |
E/W |
| WEST | WhatsApp Video 3.mp4 |
E/W |
Each pipeline runs in its own thread with double-buffered frame processing for smooth, gap-free MJPEG streaming at 20fps.
| Endpoint | Method | Description |
|---|---|---|
/video_feed/{direction} |
GET | MJPEG stream for NORTH/SOUTH/EAST/WEST |
/signal_state |
GET | Current signal phase, mode, and axis densities |
/signal_override |
POST | Admin-only manual signal phase lock |
/stats |
GET | Per-direction YOLO detection stats |
/stats/{direction} |
GET | Stats for a single direction |
/health |
GET | Service health check with pipeline readiness |
| Layer | Technology | Purpose |
|---|---|---|
| Frontend | Next.js 16 (App Router) | React-based SSR/CSR application |
| Styling | Tailwind CSS 3 + Custom CSS tokens | Dark-mode design system with Visuo aesthetic |
| Maps | Google Maps JavaScript API | Maps, Directions, Places Autocomplete |
| GPS | Browser Geolocation API | Real-time vehicle tracking |
| Auth | Firebase Authentication | Email/Password login with role-based access |
| Database | Cloud Firestore | Real-time corridor sync and intersection stats |
| AI/ML | YOLOv8n (Ultralytics) | Real-time vehicle detection and classification |
| Video | OpenCV + MJPEG | 4-direction video processing and streaming |
| Backend | FastAPI + Uvicorn | Edge AI REST API and MJPEG streamer |
| IoT | Firebase Realtime Signals | GPS-based ambulance geofence preemption |
| i18n | Custom LanguageProvider | 8-language support (EN, HI, KN, TE, TA, MR, BN, GU) |
India_Innovates_Merge_Conflicts/
โ
โโโ README.md โ You are here
โโโ start-backend.ps1 โ One-click backend launcher (all 4 services)
โโโ start-frontend.ps1 โ Frontend dev server launcher
โโโ yolov8n.pt โ YOLO model weights
โ
โโโ edge-sim/ โ ๐ค Edge AI Processing Module
โ โโโ streamer.py # 4-direction YOLO streamer + signal controller
โ โโโ runner.py # Standalone YOLO runner โ Firebase events
โ โโโ firebase_client.py # Firebase Admin SDK push client
โ โโโ requirements.txt # Python dependencies
โ โโโ serviceAccountKey.json # ๐ Firebase service account (gitignored)
โ โโโ yolov8n.pt # YOLOv8n model weights
โ โโโ demo.mp4 # NORTH camera demo video
โ โโโ WhatsApp Video 1.mp4 # SOUTH camera demo video
โ โโโ WhatsApp Video 2.mp4 # EAST camera demo video
โ โโโ WhatsApp Video 3.mp4 # WEST camera demo video
โ
โโโ signal-sync/ โ ๐ฅ๏ธ Next.js Frontend Application
โโโ app/
โ โโโ layout.jsx # Root layout โ AuthProvider, fonts, global styles
โ โโโ globals.css # Design tokens, Visuo theme, animations
โ โโโ page.jsx # Landing page โ animated hero, problem, pillars
โ โโโ dashboard/
โ โ โโโ page.jsx # Live city dashboard โ AI cameras, corridors
โ โโโ portal/
โ โ โโโ page.jsx # Green corridor creation & GPS navigation
โ โโโ routes/
โ โ โโโ page.jsx # Standalone route finder
โ โโโ admin/
โ โ โโโ page.jsx # Admin panel (role-gated)
โ โโโ profile/
โ โ โโโ page.jsx # User profile page
โ โโโ auth/
โ โโโ login/page.jsx # Sign-in page
โ โโโ register/page.jsx # Registration page
โ
โโโ components/
โ โโโ YoloFailsafePanel.jsx # 6-camera AI grid with signal control
โ โโโ IntersectionModal.jsx # 4-direction N/S/E/W expanded view
โ โโโ DelhiMap.jsx # Google Maps with GPS, overlays, directions
โ โโโ CorridorStatusBox.jsx # Animated GREEN/PREP/QUEUED status
โ โโโ DemoCorridorStatus.jsx # Demo corridor animation
โ โโโ Navbar.jsx # Navigation bar
โ โโโ Chatbot.jsx # In-app chatbot
โ โโโ AuthProvider.jsx # Firebase auth context + Firestore profile
โ โโโ LanguageProvider.jsx # Multi-language context provider
โ โโโ LanguagePicker.jsx # Language selection dropdown
โ
โโโ lib/
โ โโโ firebase.js # Firebase app + Auth + Firestore init
โ โโโ firestore.js # Firestore helpers โ corridors, signals
โ โโโ cityNodes.js # Real intersection data for 8 cities
โ โโโ i18n.js # Translation strings (8 languages)
โ
โโโ public/
โ โโโ logo.png # SignalSync logo
โ โโโ cam-north.mp4 # Fallback video โ NORTH direction
โ โโโ cam-south.mp4 # Fallback video โ SOUTH direction
โ โโโ cam-east.mp4 # Fallback video โ EAST direction
โ โโโ cam-west.mp4 # Fallback video โ WEST direction
โ
โโโ .env.local # ๐ Environment variables (gitignored)
โโโ next.config.js
โโโ tailwind.config.js
โโโ postcss.config.js
โโโ package.json
| Requirement | Version | Installation |
|---|---|---|
| Node.js | โฅ 18 LTS | nodejs.org |
| Python | โฅ 3.10 | python.org |
| pip | Latest | Comes with Python |
| Google Cloud | โ | Maps JS API, Directions API, Places API enabled |
| Firebase | โ | Auth (Email/Password) + Cloud Firestore |
git clone https://github.com/Aniruddha1406/India_Innovates_Merge_Conflicts.git
cd India_Innovates_Merge_Conflictscd signal-sync
npm install
โ ๏ธ Ifnpm installfails with peer dependency errors, usenpm install --force
cd edge-sim
pip install -r requirements.txtRequired Python packages:
ultralytics(YOLOv8)opencv-pythonfastapiuvicornfirebase-admin
Create signal-sync/.env.local:
# โโ Google Maps โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
NEXT_PUBLIC_GOOGLE_MAPS_API_KEY=your_google_maps_api_key
# โโ Firebase (Client SDK) โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
NEXT_PUBLIC_FIREBASE_API_KEY=your_firebase_api_key
NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN=your_project.firebaseapp.com
NEXT_PUBLIC_FIREBASE_PROJECT_ID=your_project_id
NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET=your_project.appspot.com
NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID=your_sender_id
NEXT_PUBLIC_FIREBASE_APP_ID=your_app_idPlace your Firebase Admin SDK service account key at:
edge-sim/serviceAccountKey.json
๐ Both
.env.localandserviceAccountKey.jsonare gitignored. Never commit credentials.
Option A: One-click launch (Windows PowerShell)
# Terminal 1 โ All backend services
.\start-backend.ps1
# Terminal 2 โ Frontend dev server
.\start-frontend.ps1Option B: Manual launch
# Terminal 1 โ FastAPI Backend (port 5000)
cd backend
python -m uvicorn main:app --port 5000 --reload
# Terminal 2 โ YOLO Streamer (port 8001)
cd edge-sim
python streamer.py --video-north demo.mp4 --video-south "WhatsApp Video 1.mp4" --video-east "WhatsApp Video 2.mp4" --video-west "WhatsApp Video 3.mp4" --port 8001
# Terminal 3 โ YOLO Runner (Firebase events)
cd edge-sim
python runner.py --video demo.mp4 --headless
# Terminal 4 โ Next.js Frontend (port 3000)
cd signal-sync
npm run dev| Service | URL | Description |
|---|---|---|
| Frontend | http://localhost:3000 | SignalSync web application |
| YOLO Streamer | http://localhost:8001/health | Edge AI health check |
| YOLO Feeds | http://localhost:8001/video_feed/NORTH | Live MJPEG stream |
| Variable | Required | Description |
|---|---|---|
NEXT_PUBLIC_GOOGLE_MAPS_API_KEY |
โ | Google Maps JavaScript API key |
NEXT_PUBLIC_FIREBASE_API_KEY |
โ | Firebase project API key |
NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN |
โ | Firebase Auth domain |
NEXT_PUBLIC_FIREBASE_PROJECT_ID |
โ | Firebase project ID |
NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET |
โ | Firebase Storage bucket |
NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID |
โ | Firebase Cloud Messaging sender ID |
NEXT_PUBLIC_FIREBASE_APP_ID |
โ | Firebase app ID |
All
NEXT_PUBLIC_prefixed variables are exposed to the browser. Admin/secret keys go inserviceAccountKey.jsononly.
| Route | Page | Auth | Description |
|---|---|---|---|
/ |
Landing Page | No | Animated hero, problem statement, solution pillars, user flows |
/dashboard |
Live Dashboard | No | City-wide AI camera network, signal control, corridors |
/portal |
Green Corridor | Yes* | Create corridors, GPS tracking, real-time signal override |
/routes |
Route Finder | No | Standalone route search with city-bounded autocomplete |
/admin |
Admin Panel | Admin | Signal override, system management |
/profile |
User Profile | Yes | User account settings |
/auth/login |
Sign In | No | Email/password authentication |
/auth/register |
Sign Up | No | New account creation |
*Basic features accessible without auth; full corridor creation requires sign-in.
โ Operator opens /portal
โโโถ Selects city โ Enters origin & destination
โโโถ [Optional] Tap ๐ for GPS auto-fill
โก Clicks "Get Best Route"
โโโถ Google Directions API fetches traffic-aware route
โโโถ Live departure-time model with BEST_GUESS traffic
โข Clicks "Initiate Green Wave"
โโโถ pickCorridorNodes() selects 5 real intersections along the route
โโโถ Corridor saved to Firestore + localStorage
โโโถ Signal circle overlays appear on map (๐ข ๐ก ๐ด)
โฃ Demo ambulance drives the route on the map
โโโถ Each node triggers onNodeAdvance() callback
โโโถ CorridorStatusBox updates: GREEN โ PREP โ QUEUED cascade
โโโถ Dashboard polls localStorage every 1.5s and mirrors status
โค [Physical travel] Tap "Start Live GPS Tracking"
โโโถ watchPosition() tracks vehicle with pulsing blue dot
โโโถ Map auto-recenters at zoom level 15
โฅ Vehicle arrives at destination
โโโถ Auto-terminate fires after 2.5s grace period
โโโถ Corridor removed from Firestore + localStorage
โโโถ All signals return to normal cycle
| State | Visual | Description |
|---|---|---|
GREEN โ |
๐ข Green circle | Ambulance at intersection โ full green priority |
PREP โฑ |
๐ก Amber circle | Next intersection โ signal preparing to clear |
QUEUED |
๐ด Red circle | Downstream โ cross-traffic held at red |
โ CLEAR |
โช Dim green | Ambulance passed โ signal returned to normal |
The signal controller in streamer.py runs every 1 second and uses a hybrid approach:
IF avg(N/S density) > avg(E/W density) + 10%:
โ N/S axis gets GREEN, E/W gets RED
IF avg(E/W density) > avg(N/S density) + 10%:
โ E/W axis gets GREEN, N/S gets RED
GREEN (20s) โ YELLOW (3s buffer) โ RED (15s) โ swap axes โ repeat
Ambulance detected by YOLO โ ALL signals YELLOW (3s) โ
Detection node: GREEN (corridor clear)
All other nodes: RED (cross-traffic stopped)
โ Auto-clear after vehicle passes
IoT Geofence Preemption > Emergency YOLO Detection > Manual Override > Auto Cycle
SignalSync covers 8 major Indian cities with 17โ20 real named intersections per city:
| City | State | Sample Intersections |
|---|---|---|
| ๐๏ธ Delhi | Delhi NCR | Connaught Place, AIIMS, Karol Bagh, IGI Terminal 3, Lajpat Nagar |
| ๐ Mumbai | Maharashtra | Dadar TT Circle, BKC, Andheri Junction, Mahim Causeway, Borivali |
| ๐ณ Bengaluru | Karnataka | Silk Board Junction, Hebbal Flyover, Marathahalli, Whitefield |
| ๐ Hyderabad | Telangana | Hitech City, Jubilee Hills, Ameerpet, Gachibowli, Charminar |
| ๐๏ธ Chennai | Tamil Nadu | Anna Salai, T. Nagar Pondy Bazaar, Koyambedu Hub, Guindy |
| โฐ๏ธ Pune | Maharashtra | Shivajinagar, Swargate, Hadapsar, Hinjewadi Phase 1 |
| ๐ Kolkata | West Bengal | Esplanade Crossing, Park Street, Gariahat More, Howrah Station |
| ๐๏ธ Ahmedabad | Gujarat | ISCON Circle, Navrangpura, SG Highway, Shivranjani Cross Rd |
All intersection data with real GPS coordinates is stored in signal-sync/lib/cityNodes.js.
- Authentication โ Enable Email/Password sign-in method
- Cloud Firestore โ Create database in production mode
| Collection | Purpose |
|---|---|
users |
User profiles with role field |
corridors |
Active green corridor data |
edge_events |
YOLO emergency detection events |
intersection_stats |
Per-camera density and vehicle data |
signals |
Real-time signal state per intersection |
rules_version = '2';
service cloud.firestore {
match /databases/{database}/documents {
// Users โ only the owner can read/write their profile
match /users/{uid} {
allow read, write: if request.auth.uid == uid;
}
// Corridors โ authenticated users can create; owner/admin can modify
match /corridors/{corridorId} {
allow read: if true;
allow create: if request.auth != null;
allow update, delete: if request.auth != null &&
(resource.data.uid == request.auth.uid ||
get(/databases/$(database)/documents/users/$(request.auth.uid)).data.role == 'admin');
}
// Edge events & stats โ read-only for clients; server writes via Admin SDK
match /edge_events/{doc} {
allow read: if true;
}
match /intersection_stats/{doc} {
allow read: if true;
}
match /signals/{doc} {
allow read: if true;
}
}
}| Service | Number |
|---|---|
| ๐ Ambulance | 102 |
| ๐ Fire Brigade | 101 |
| ๐ฎ Police | 100 |
| ๐ฅ All Emergencies (GVK EMRI) | 108 |
Team Merge_Conflicts
India Innovates Hackathon 2026
| Area | Contribution |
|---|---|
| ๐ฅ๏ธ Full-Stack Development | Next.js 16 app, Firebase integration, Google Maps API |
| ๐ค AI/ML Engineering | YOLOv8 pipeline, 4-direction video processing, signal control |
| ๐จ UI/UX Design | Dark-mode Visuo design system, animations, responsive layout |
| ๐ Data Research | Real intersection GPS coordinates for 8 Indian cities |
| ๐๏ธ System Architecture | Green corridor algorithm, real-time signal sync, IoT preemption |
This project is licensed under the MIT License โ see the LICENSE file for details.
SignalSync ยท Restoring the Golden Hour
Built with โค๏ธ by Team Merge_Conflicts
India Innovates Hackathon ยท 2026