AI-powered medical triage assistant. Describe a situation, get a severity assessment, first-aid guidance, and one-tap emergency actions.
A full-stack emergency-response web app: an AI triage engine (OpenAI) analyzes medical situations described in chat, classifies severity, and — when it's an emergency — arms a dashboard with one-tap actions: call an ambulance, alert emergency contacts, find the nearest hospital, and share your location.
- 🩺 AI triage — chat describes the situation, the model returns follow-up questions or a severity classification with risk score (0–100)
- 🚨 Emergency mode — auto-activates on
EMERGENCYseverity with a dedicated dashboard - 🆘 One-tap actions — call ambulance (
tel:108), call a contact, find nearest hospital (Google Maps), SMS location alert - 🩹 First-aid quick guides — keyword-triggered cards for heart attack, stroke, choking, severe bleeding, burns
- 👤 Onboarding + profile — name, age, blood group, emergency contacts (persisted in
localStorage) - 📱 Responsive — mobile-first chat UI
# 1. Install dependencies
npm install
# 2. Set your OpenAI key
cp .env.example .env # add OPENAI_API_KEY=sk-...
# 3. Run (client + server together)
npm run devUser message ──▶ POST /api/analyze ──▶ OpenAI Responses API
│ medical triage system prompt
▼
JSON: follow-up questions
OR: { severity, risk_score, advice, disclaimer }
- Follow-up questions are shown when symptoms are unclear
- Severity + risk score + advice render as the bot reply
EMERGENCYseverity flips the app into emergency mode automatically- API failure falls back to "contact emergency services"
mini_ashptal/
├── src/
│ ├── App.jsx # routing + profile gate
│ └── pages/
│ ├── Onboarding.jsx # profile + emergency contacts
│ └── EmergencyDashboard.jsx # triage chat + emergency actions
├── server/
│ ├── index.js # Express API
│ └── openai.js # OpenAI Responses integration
├── api/ # serverless handlers (analyze, health)
└── FUNCTIONALITY.md # detailed behavior spec
MIT