TriageFlow Algeria is a full-stack emergency triage management system for Algerian hospitals. It implements the ESI 5-level triage model, real-time patient queues, role-based access control, patient history tracking, and multilingual support using React, Node.js, MySQL, and Socket.io.
# TriageFlow Algeria π
**Emergency Triage System for Algerian Hospitals**
A full-stack web application for hospital emergency triage, built on the ESI (Emergency Severity Index) 5-level system, adapted for the Algerian context.
---
## Features
- β
Patient registration with NNI lookup (returning patients auto-fill)
- β
ESI 1β5 triage algorithm (server-side, auditable)
- β
Real-time live queue with Socket.io
- β
Patient history with full visit records and vitals
- β
Role-based access: nurse / doctor / admin
- β
Trilingual UI: Arabic (RTL) / French / English
- β
Algerian fields: NNI, Wilaya, CNAS/CASNOS insurance
- β
Admin panel: daily stats, staff management, audit log
- β
Full audit trail on every action
---
## Tech Stack
| Layer | Tech |
|---|---|
| Frontend | React 18, Socket.io-client |
| Backend | Node.js, Express |
| Database | MySQL |
| Real-time | Socket.io |
| Auth | JWT + bcrypt |
---
## Setup
### Prerequisites
- Node.js 18+
- MySQL 8+
### 1. Database
```bash
mysql -u root -p 120 bpm
- SpOβ: 39.5Β°C
- Respiratory rate: 29 /min
---
## Project Structure
```
triageflow/
βββ server/
β βββ index.js # Express + Socket.io entry
β βββ db/
β β βββ schema.sql # Full MySQL schema
β β βββ connection.js # MySQL pool
β βββ middleware/
β β βββ auth.js # JWT + role guard
β βββ routes/
β β βββ auth.js
β β βββ patients.js
β β βββ visits.js
β β βββ triage.js # ESI algorithm lives here
β β βββ queue.js
β β βββ admin.js
β βββ socket/
β βββ queueEvents.js # Real-time events
βββ client/
βββ src/
βββ App.jsx # Layout + routing
βββ pages/
β βββ LoginPage.jsx
β βββ IntakePage.jsx
β βββ TriageForm.jsx
β βββ QueuePage.jsx
β βββ HistoryPage.jsx
β βββ AdminPage.jsx
βββ components/
β βββ LevelBadge.jsx
βββ context/
β βββ AuthContext.js
β βββ LanguageContext.js
βββ i18n/
βββ translations.js # AR / FR / EN
```
---
## Portfolio Notes
This project demon β¦