Inspiration:
We've all seen an ambulance stuck in gridlock, sirens wailing helplessly while drivers struggle to move out of the way. In emergency response, the "Golden Hour" is critical; every minute of delay reduces survival chances by 7-10%.
I realized that the problem isn't just "traffic"—it's a lack of coordination. The ambulance is blind to the signal ahead, the traffic controller doesn't know the ambulance is coming, and the hospital is unprepared for the patient's arrival.
I built RapidResQ to break these silos. I wanted to create a system where the city itself clears the path for a life to be saved.
What it does:
RapidResQ is an integrated "Smart City" emergency ecosystem that connects three critical pillars in real-time:
Ambulance Command: Provides AI-driven route optimization and allows paramedics to send one-click "Green Corridor" requests. Traffic Control Center: A live admin dashboard where officials can monitor active ambulances and toggle traffic signals to Green instantly. Hospital Gateway: Gives doctors a heads-up on incoming patients (including vitals like Age/Condition) and lets them manage ICU bed availability.
How I built it
The project was built using a modern, performance-first stack:
Framework: Next.js 16 (App Router) for a blazing-fast interface. Styling: Tailwind CSS for a professional "command center" aesthetic. Maps: Leaflet.js with OpenStreetMap for live route visualization. Real-Time Sync: A custom Event-Driven Architecture using the browser's StorageEvent API to simulate sub-millisecond latency. The "Smart" Routing Engine: We utilized a weighted scoring model to determine the optimal path. The algorithm calculates a "Cost Score" for every possible route and selects the lowest one:
Optimal Path = Minimum of ( α × Distance + β × Traffic + γ × Signals )
Where:
Distance: Length of the route in km. Traffic: Real-time congestion score (0-10). Signals: Number of traffic lights on the path. Weights (α, β, γ): These factors adjust dynamically. For example, during a critical emergency, the "Traffic" weight increases effectively forcing the system to prefer longer but clearer roads.
Challenges we ran into:
Simulating Real-Time Sync: Since we wanted a standalone robust demo without a complex WebSocket backend, getting three different browser windows to "talk" instantly was tricky. We solved this by effectively turning localStorage into a real-time event bus. Map Polyline Complexity: Implementing custom route drawing on OpenStreetMap required manually calculating coordinate arrays rather than relying on expensive paid Directions APIs. Accomplishments that we're proud of The "Green Corridor" Handshake: Successfully implementing the flow where an ambulance requests a signal change, the Admin approves it, and the traffic light on the map actually flips from Red to Green in real-time across all screens. Zero-Latency UI: The interface is snappy and responsive, with complex animations (like the pulsing emergency mode) that run at a smooth 60fps. What we learned Event-Driven Thinking: We learned that "speed" isn't just about code performance, but about how fast information travels between users. Geospatial Data: We gained a deep understanding of how mapping libraries handle coordinates, layers, and rendering custom markers. The Power of UX: In high-stress situations (like an ambulance ride), clear buttons and bold colors aren't just "design"—they are functional features that prevent errors.
**What's next for RapidResQ:
IoT Integration: Connecting the Admin dashboard to actual traffic signal controllers via MQTT. Computer Vision: Using ambulance dashboard cameras to detect traffic density automatically. Public Notification: An app for civilian drivers that alerts them: "Ambulance approaching from behind! Move Left."
Built With
- css
- css3
- git
- html5
- leaflet.js
- next.js
- openstreetmap
- react
- tailwind
- typescript
Log in or sign up for Devpost to join the conversation.