Skip to content

Repository files navigation

🚑 LifeLane — Real-Time Emergency Vehicle Priority System

An intelligent emergency vehicle routing & traffic management platform for Chennai, India.

LifeLane Dashboard Python FastAPI License

🌐 Live Demo

🔗 View Live Dashboard →


✨ Features

🗺️ Real-Time Routing (OSRM Integration)

  • Routes follow real Chennai road network via OSRM API
  • Multiple alternative routes with exact kilometer distances
  • Traffic-aware ETA calculations
  • Fallback routing when OSRM is unavailable

🏥 Intelligent Hospital Selection

  • Composite scoring: distance + traffic + bed availability + wait time
  • Auto-recommends best hospital for each emergency
  • Manual override for drivers
  • Real-time bed availability tracking (ICU + Emergency)

📊 Live Data Integration

  • Time-of-day traffic patterns (rush hour simulation)
  • Dynamic hospital bed updates
  • Traffic signal preemption (auto-green within 500m)
  • Vehicle alert system for clearing ambulance paths

🎨 Production Dashboard

  • Dark-themed, responsive UI
  • 4-tab sidebar: Units | Hospitals | Routes | Alerts
  • Color-coded routes (Green/Yellow/Red for traffic)
  • Animated ambulance markers with pulse effects
  • Real-time stats in topbar

🏗️ Architecture

┌──────────────────────────────────────┐
│          Frontend (HTML/JS)          │
│   Leaflet Map + Simulation Engine    │
├──────────────────────────────────────┤
│         FastAPI Backend (Python)     │
│  OSRM Routing + Hospital Selection  │
│  WebSocket Broadcast + Simulation   │
├──────────────────────────────────────┤
│     PostgreSQL + Redis (Docker)      │
└──────────────────────────────────────┘

🚀 Quick Start

Local Development (with backend)

# Install Python dependencies
pip install -r backend/requirements.txt

# Run the server
python backend/app.py

# Open http://localhost:3000
# Login: admin / admin123

Docker Deployment

docker-compose up -d
# Open http://localhost:80

📡 API Endpoints

Endpoint Method Description
/api/auth/login POST JWT authentication
/api/hospitals GET All hospitals with bed data
/api/hospitals/select GET Smart hospital ranking
/api/route/calculate POST OSRM routing with alternatives
/api/ambulances GET Active ambulance positions
/api/traffic/live GET Live traffic data
/api/simulation/dispatch POST Dispatch new emergency
/ws WebSocket Real-time state broadcast

📂 Project Structure

LIFELANE/
├── backend/
│   ├── app.py              # FastAPI server + simulation
│   └── requirements.txt    # Python dependencies
├── frontend/
│   ├── index.html          # Dashboard (backend-connected)
│   └── login.html          # Login page
├── public/
│   └── index.html          # Standalone demo (Vercel)
├── database/               # PostgreSQL schema
├── nginx/                  # Reverse proxy config
├── docker-compose.yml      # Full stack deployment
├── vercel.json             # Vercel config
└── README.md

🛠️ Tech Stack

  • Frontend: HTML5, CSS3, JavaScript, Leaflet.js
  • Backend: Python 3.13, FastAPI, Uvicorn
  • Routing: OSRM (Open Source Routing Machine)
  • Real-time: WebSockets
  • Auth: JWT (python-jose)
  • Database: PostgreSQL 15 + Redis 7
  • Deploy: Vercel (frontend) + Docker (backend)

👥 Team

Built for smart city emergency management in Chennai, India.

📄 License

MIT License

About

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages