gemini-2.5-flash) primary, OpenAI GPT (gpt-4o-mini) automatic fallback — configurable via AI_PROVIDER_PRIORITY. Each provider gets a 12s timeout; on failure/timeout/malformed output, the next provider is tried automatically. If both fail (or the network itself is too slow), the frontend falls back to a local offline triage engine — the tool never leaves the user with nothing.parseTriageJSON — the single choke point all AI output passes through, so safety rules hold no matter which provider answered.image_url) alongside the text description.needs_more_info is force-set to false for CRITICAL, regardless of what the model returns). Never diagnoses, never prescribes medicine or dosages.helmet for security headers + a scoped CSP (self + Google Fonts + cdnjs for the PDF library only)express-rate-limit on all /api routes (20 req/min/IP by default — generous, since this is an emergency tool)middlewares/validateTriage.js): strips control characters, caps text/history/image sizes, whitelists image MIME typeshttp://localhost:3000.NODE_ENV development or production development PORT Server port 3000 AI_PROVIDER_PRIORITY Fallback order, comma-separated gemini,openai AI_TIMEOUT_MS Per-provider timeout 12000 GEMINI_API_KEY Google AI Studio key — GEMINI_MODEL Gemini model name gemini-2.5-flash OPENAI_API_KEY OpenAI key — OPENAI_MODEL OpenAI model name gpt-4o-mini RATE_LIMIT_WINDOW_MS Rate limit window 60000 RATE_LIMIT_MAX Max requests/window/IP 20 MAX_BODY_SIZE Max JSON body size (photo uploads) 2mbnpm install — picks up helmet, express-rate-limit, morgan, compression.data/triage.db if you hit a schema error, or just run the app — data/db.js auto-migrates the confidence column onto existing tables without dropping data..env into the new .env.example shape (new vars: AI_TIMEOUT_MS, RATE_LIMIT_*, MAX_BODY_SIZE, NODE_ENV)./api/triage accepts a richer payload (vitals, medicalProfile, history, image) but { situation: "..." } alone still works exactly as before.npm installnpm startGET /health → {"status":"ok"}http://localhost:3000, describe a clearly critical situation (e.g. "chest pain, can't breathe") → confirm severity, confidence ring, reasoning chips, checklist, and the SOS countdown appearPosted Sep 3, 2026
Developed AI tool for emergency triage classification and guidance.