An AI-powered emergency medical triage system designed for rural India.
Describe symptoms in any language β Get instant AI triage β Find the nearest hospital.
π Live Demo: swasthyapath-orcin.vercel.app
- π€ AI Triage β Claude AI analyzes symptoms in multiple languages and assesses severity (Critical / Urgent / Moderate)
- πΊοΈ Real GPS + Live Map β Finds nearest hospitals using real-time location with Leaflet maps
- π Ambulance Live Tracking β Patient and ambulance share live locations visible on the map in real time
- π¬ Doctor Chat β Real-time chat between patient and volunteer doctor via Socket.io rooms
- πΉ Video Call β WebRTC-powered video consultation between patient and doctor
- π©Ή First Aid Guide β Step-by-step offline first aid for 10 emergencies (Heart Attack, Snake Bite, Burns, Drowning, Choking, Fracture, Seizure, Bleeding, Unconscious, Road Accident)
- π My Triage History β Users can view their past triage records stored locally
- π Admin Dashboard β Protected admin login with full stats, severity breakdown, symptom trends and recent activity
- π΄ Offline Mode β Cached hospital data and First Aid Guide work without internet connection
- π Multi-language β Supports English, Hindi, Tamil, Telugu, Bengali, Marathi
- π SOS Button β One-tap emergency call with location sharing
- π± PWA Ready β Installable on mobile devices
| Technology | Purpose |
|---|---|
| React 18 + Vite | UI framework |
| Leaflet + React-Leaflet | Interactive maps |
| Socket.io Client | Real-time communication |
| WebRTC | Video calls |
| Technology | Purpose |
|---|---|
| Node.js + Express | REST API server |
| Socket.io | Real-time rooms & chat |
| Anthropic Claude AI | AI-powered symptom triage |
| MongoDB Atlas + Mongoose | Persistent database |
| Dotenv | Environment variables |
| Service | Purpose |
|---|---|
| Vercel | Frontend hosting |
| Render | Backend hosting |
| MongoDB Atlas | Cloud database |
| Service | URL |
|---|---|
| π Frontend | swasthyapath-orcin.vercel.app |
| βοΈ Backend API | swasthyapath-backend.onrender.com |
- Node.js v18+
- MongoDB Atlas account (free)
- Anthropic API key
git clone https://github.com/bm0213/Swasthyapath.git
cd Swasthyapathcd backend
npm installCreate a .env file inside backend/:
ANTHROPIC_API_KEY=your_anthropic_api_key
PORT=4000
MONGODB_URI=your_mongodb_atlas_connection_string
ADMIN_USERNAME=your_admin_username
ADMIN_PASSWORD=your_admin_passwordStart the backend:
npm run devcd ../frontend
npm installCreate a .env file inside frontend/:
VITE_BACKEND_URL=http://localhost:4000Start the frontend:
npm run devhttp://localhost:5173
Swasthyapath/
βββ backend/
β βββ routes/
β β βββ triage.js # AI triage endpoint
β β βββ admin.js # Admin stats + login endpoint
β β βββ hospitals.js # Hospital proxy endpoint
β βββ db.js # MongoDB connection + schemas
β βββ index.js # Express + Socket.io server
β βββ package.json
β
βββ frontend/
βββ src/
βββ components/
β βββ AdminLogin.jsx # Admin login page
β βββ UserHistory.jsx # User triage history
β βββ DoctorChat.jsx # Real-time chat + video call
β βββ VideoCall.jsx # WebRTC video call
β βββ HospitalMap.jsx # Leaflet map + ambulance tracking
β βββ HospitalList.jsx # Hospital results list
β βββ SymptomInput.jsx # Symptom input form
β βββ TriageResult.jsx # AI triage result display
β βββ SOSButton.jsx # Emergency SOS
β βββ ...
βββ pages/
β βββ AdminDashboard.jsx # Admin stats dashboard (protected)
β βββ FirstAid.jsx # Offline first aid guide
β βββ Settings.jsx
βββ utils/
β βββ triage.js # Claude AI API call
β βββ socket.js # Socket.io client
β βββ location.js # GPS utilities
β βββ fetchHospitals.js # Hospital fetch via backend proxy
β βββ ...
βββ App.jsx # Main app component
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/triage |
Submit symptoms for AI triage |
| POST | /api/admin/login |
Admin login |
| GET | /api/admin/stats |
Get admin dashboard stats |
| GET | /api/hospitals/nearby |
Fetch nearby hospitals via proxy |
{
"symptoms": "Patient has severe chest pain and difficulty breathing",
"location": { "lat": 13.0827, "lng": 80.2707 }
}{
"severity": "critical",
"severityLabel": "Critical Emergency",
"summary": "Symptoms suggest a possible cardiac event.",
"facilities": ["ICU", "Cardiology", "Ventilator"],
"doNow": "Keep the patient calm and seated upright. Call 112 immediately."
}| Event | Direction | Description |
|---|---|---|
join_room |
Client β Server | Join a chat room |
send_message |
Client β Server | Send a chat message |
ambulance_location |
Client β Server | Share ambulance GPS |
patient_location |
Client β Server | Share patient GPS |
call_request |
Client β Server | Request video call |
call_accepted |
Client β Server | Accept video call |
call_declined |
Client β Server | Decline video call |
call_ended |
Client β Server | End video call |
webrtc_offer/answer/ice |
Client β Server | WebRTC signaling |
- Fork the repository
- Create a feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is open source and available under the MIT License.
bm0213 β GitHub
Made with β€οΈ for rural India's emergency healthcare