ResQ is a real-time emergency coordination prototype designed to reduce critical delays in hospital response systems, especially in low-resource healthcare settings. It addresses the "third delay", the delay in receiving timely and appropriate care after a patient arrives at a health facility
# ResQ
ResQ is a real-time emergency coordination platform for heaalth facility teams. It is built to reduce the "third delay" by improving how staff detect, broadcast, assign, and resolve emergencies after a patient reaches a facility.
## What This App Includes
- Real-time emergency alerts with severity and workflow status tracking.
- Role-aware dashboards for operations and administration.
- Patient registration flow tied to triage context and room assignment.
- Duty assignment management for shifts.
- Firebase Authentication with Google sign-in.
- Firestore-backed live updates and offline-friendly behavior.
- AI voice alert generation (Gemini TTS) for broadcast workflows.
- Lightweight health endpoint at `/api/health`.
## Tech Stack
- Next.js 15 (App Router)
- React 19
- TypeScript
- Tailwind CSS 4
- Firebase Auth + Firestore
- Sonner (toasts), Lucide (icons), Motion (animation)
- Google GenAI SDK (`@google/genai`) for voice alerts
## Prerequisites
- Node.js 20+ recommended
- npm 10+
- A Firebase project with Auth and Firestore enabled
- A Gemini API key if you want text-to-speech voice alerts
## Local Development
1. Install dependencies:
```bash
npm install
```
2. Create `.env.local` and add:
```bash
NEXT_PUBLIC_GEMINI_API_KEY=your_gemini_api_key
NEXT_PUBLIC_AUTH_ALLOWED_DOMAINS=localhost,127.0.0.1,your-deployed-hostname
```
3. Start the dev server:
```bash
npm run dev
```
4. Open:
```text
localhost
```
## Scripts
- `npm run dev` - start development server
- `npm run build` - build for production
- `npm run start` - run production server
- `npm run lint` - run TypeScript type check (`tsc --noEmit`)
## Firebase Configuration Notes
The app currently imports Firebase config from `firebase-applet-config.json` directly in `src/firebase.ts`.
- If you use a different Firebase project, replace values in `firebase-applet-config.json`.
- For Google sign-in, add every de …