LifeLine+ β Real-time Emergency Response Platform for India
βββ βββββββββββββββββββ βββ βββββββ βββββββββββ+
βββ βββββββββββββββββββ βββ ββββββββ βββββββββββ+
βββ βββββββββ ββββββ βββ βββββββββ βββββββββ +
βββ βββββββββ ββββββ βββ βββββββββββββββββββ +
ββββββββββββββ ββββββββ ββββββββββββββ ββββββββββββββ+
ββββββββββββββ ββββββββ ββββββββββββββ βββββββββββββ+
"Saving minutes. Saving lives."
LifeLine+ is a production-ready full-stack emergency response platform built for India. It accelerates crisis coordination in hospitality and public spaces by combining real-time ambulance tracking, smart hospital discovery, traffic-aware routing, police alerts, doctor bookings, and AI-powered emergency verification β all in one unified mobile-first experience.
The platform is successfully deployed on two different cloud stacks:
- Frontend: LifeLine+
- Backend: LifeLine+ Backend
- Frontend (Vercel): LifeLine+ (Vercel)
- Backend (Render): LifeLine+ (Render)
[Rapid Crisis Response] Accelerated Emergency Response and Crisis Coordination in Hospitality
This project is our submission for the Google Solution Challenge 2026, hosted on the Hack2Skill platform.
Emergency response often breaks down because nearby services, traffic-aware routes, ambulance availability, police coordination, and verified civilian help are disconnected. LifeLine+ turns those fragmented steps into one live, mobile-first emergency workflow.
| Area | Implementation |
|---|---|
| π Smart Discovery | Browser geolocation + Google Places API for hospitals, doctors, police, and pharmacies |
| πΊοΈ Maps | Google Maps JS API, markers, route polylines, traffic layer, dark mode, 2D/tilted satellite 3D toggle |
| π Emergency Flow | Auto-select nearest open hospital, fetch alternate Directions API routes, rank fastest by traffic ETA |
| π Ambulance Booking | Stable zone-based ambulance fleet, 5-minute production acceptance window, Socket.io live GPS simulation |
| π Civilian Mode | Gemini validates vehicle number, purpose, and contact before temporary emergency activation |
| π Police Alerts | Google Places police station detection around route points, alert broadcast through Socket.io |
| π₯ Doctors | Google Places-backed nearby doctor/clinic discovery, specialty filter, slots, booking confirmation |
| π Auth | Firebase Google sign-in primary flow + email/name localStorage fallback session |
| β‘ UX | Blinkit/Uber-inspired card UI, sticky bottom nav, floating SOS, voice trigger, PWA support |
| Layer | Tools |
|---|---|
| Frontend | React 18, Vite, React Router, Tailwind CSS, Vite PWA, Firebase Web SDK |
| Maps | Google Maps JavaScript API, Places API, Directions API, Distance Matrix API |
| Realtime | Socket.io client/server |
| Backend | Node.js, Express, Helmet, CORS, Compression, Morgan |
| AI | Gemini 1.5 Flash through backend API |
| Persistence | Optional Firebase Admin Firestore writes with in-memory fallback |
| Deploy | Successfully deployed on Google Cloud Run and Vercel+Render |
Life_Line/
βββ backend/
β βββ lib/
β β βββ firebaseAdmin.js
β β βββ googleMaps.js
β βββ routes/
β β βββ ambulance.js
β β βββ booking.js
β β βββ police.js
β β βββ routes.js
β β βββ services.js
β β βββ verify.js
β βββ sockets/
β β βββ handlers.js
β βββ .env
β βββ .env.example
β βββ package.json
β βββ server.js
βββ frontend/
β βββ public/
β β βββ lifeline.svg
β βββ src/
β β βββ components/
β β βββ context/
β β βββ hooks/
β β βββ lib/
β β βββ pages/
β β βββ App.jsx
β β βββ index.css
β β βββ main.jsx
β βββ .env
β βββ .env.example
β βββ package.json
β βββ vite.config.js
βββ ARCHITECTURE.md
βββ CORE_LOGIC.md
βββ INSTRUCTIONS.md
βββ LICENSE
βββ README.md
cd backend
cp .env.example .env
npm install
npm run devBackend runs on http://localhost:5000.
cd frontend
cp .env.example .env
npm install
npm run devFrontend runs on http://localhost:5173.
curl http://localhost:5000/api/healthPrivate secrets belong only in .env. The committed .env.example files use placeholders.
PORT=5000
GOOGLE_MAPS_API_KEY=your_google_maps_api_key
GEMINI_API_KEY=your_gemini_api_key
FIREBASE_PROJECT_ID=your_firebase_project_id
FIREBASE_PRIVATE_KEY="-----BEGIN PRIVATE KEY-----\nyour_key\n-----END PRIVATE KEY-----\n"
FIREBASE_CLIENT_EMAIL=your_service_account_email
FRONTEND_URL=http://localhost:5173
NODE_ENV=development
DRIVER_RESPONSE_TIMEOUT_MS=5000VITE_GOOGLE_MAPS_API_KEY=your_google_maps_api_key
VITE_GEMINI_API_KEY=your_gemini_api_key
VITE_FIREBASE_API_KEY=your_firebase_web_api_key
VITE_FIREBASE_AUTH_DOMAIN=your_project.firebaseapp.com
VITE_FIREBASE_PROJECT_ID=your_project_id
VITE_FIREBASE_STORAGE_BUCKET=your_project.firebasestorage.app
VITE_FIREBASE_MESSAGING_SENDER_ID=000000000000
VITE_FIREBASE_APP_ID=1:000000000000:web:0000000000000000000000
VITE_FIREBASE_MEASUREMENT_ID=G-XXXXXXXXXX
VITE_BACKEND_URL=http://localhost:5000| Method | Endpoint | Purpose |
|---|---|---|
GET |
/api/health |
Server, Firebase, Maps, Gemini status |
GET |
/api/nearest-services |
Google Places nearby hospitals, police, doctors, pharmacies |
GET |
/api/nearest-services/details/:placeId |
Place details |
GET |
/api/routes/emergency |
Directions API routes with traffic ETA |
GET |
/api/routes/traffic |
Distance Matrix traffic probe |
GET |
/api/ambulance-request/nearby |
Nearby ambulances from live fleet state |
POST |
/api/ambulance-request/request |
Create emergency ambulance request |
GET |
/api/ambulance-request/request/:requestId |
Request status |
POST |
/api/ambulance-request/location-update |
Driver GPS update |
POST |
/api/verify/civilian |
Gemini civilian emergency verification |
POST |
/api/verify/chat |
Gemini emergency assistant through backend |
GET |
/api/booking/doctors |
Places-backed doctor discovery |
GET |
/api/booking/slots/:doctorId |
Appointment slots |
POST |
/api/booking/appointment |
Book doctor appointment |
GET |
/api/police/stations |
Nearby police stations from Places API |
POST |
/api/police/alert |
Police alert with route context |
cd frontend
npm run buildSet every VITE_* variable in Vercel Project Settings before deploying.
cd backend
npm startSet backend env variables in Render. Use NODE_ENV=production for the real 5-minute ambulance response window.
Recommended checks before deployment:
cd backend && npm start
cd frontend && npm run buildManual flow to validate:
- Open
http://localhost:5173. - Allow location access.
- Sign in with Firebase Google or email fallback.
- Open Emergency Mode.
- Confirm nearest hospital route and route alternatives.
- Book ambulance and watch Socket.io tracking updates.
- Test Civilian Mode and police alert activation.
- Book a doctor appointment.
LifeLine+ is fully deployable on Google Cloud Run with auto-scaling, HTTPS, and full WebSocket support.
- Install Google Cloud SDK
- Authenticate:
gcloud auth login - Set project:
gcloud config set project YOUR_PROJECT_ID
# Build and deploy backend
gcloud run deploy lifeline-backend \
--source ./backend \
--platform managed \
--region asia-south1 \
--allow-unauthenticated \
--set-env-vars "GOOGLE_MAPS_API_KEY=your_key,GEMINI_API_KEY=your_key,FIREBASE_PROJECT_ID=your_id,FRONTEND_URL=https://your-frontend-url.run.app,NODE_ENV=production"# Build and deploy frontend
gcloud run deploy lifeline-frontend \
--source ./frontend \
--platform managed \
--region asia-south1 \
--allow-unauthenticated \
--set-env-vars "VITE_BACKEND_URL=https://your-backend-url.run.app"Backend:
GOOGLE_MAPS_API_KEY- Google Maps API keyGEMINI_API_KEY- Gemini AI API keyFIREBASE_PROJECT_ID- Firebase project IDFIREBASE_PRIVATE_KEY- Firebase service account private keyFIREBASE_CLIENT_EMAIL- Firebase service account emailFRONTEND_URL- Frontend Cloud Run URL (for CORS)NODE_ENV=production- Production mode
Frontend:
VITE_BACKEND_URL- Backend Cloud Run URL
Both services include health check endpoints:
- Backend:
https://your-backend-url.run.app/health - Frontend:
https://your-frontend-url.run.app/health
| File | Purpose |
|---|---|
| INSTRUCTIONS.md | File-by-file working principles and runbook |
| ARCHITECTURE.md | Mermaid architecture diagrams |
| CORE_LOGIC.md | Emergency pipelines and process flows |
| LICENSE | Project license |
We are the LifeLine+ team, participating in the Google Solution Challenge 2026 hosted by Hack2Skill.
Note: This project was built for hackathon purposes as part of the Google Solution Challenge 2026.
| Member | Role |
|---|---|
| Babin Bid | Team Lead, Full Stack Developer |
| Atanu Saha | Frontend Developer |
| Rohit Kumar Adak | Idea Provider, Tech Architect & Backend Developer |
| Sagnik Bachhar | Researcher |
LifeLine+ is built for rapid coordination, but life-threatening emergencies should still call official Indian emergency numbers such as 108 or 112 immediately.
Faster response. Safer India.
This project is licensed under the LICENSE file.