Real-time ambulance dispatch and emergency response optimization platform with live tracking, ETA prediction, hospital fleet management, and intelligent nearest-unit assignment.
- Client: React, Vite, TypeScript, TailwindCSS, Mappls Web Maps, Recharts, Socket.io-client
- Server: Node.js, Express, TypeScript, PostgreSQL, Socket.io
- Monorepo: npm workspaces, concurrently
-
Clone the repository:
git clone https://github.com/CtrlAltDuo/CodeBlue.git cd CodeBlue -
Install dependencies:
npm install
-
Database Setup: Ensure you have a PostgreSQL instance running. Execute the schema script located at
server/src/db/schema.sqlto initialize your database tables. -
Environment variables: Create
.envfiles in bothclientandserverfolders using the examples provided.client/.env:VITE_MAPPLS_API_KEY=your_mappls_key_here VITE_API_URL=http://localhost:5000
server/.env:DATABASE_URL=postgres://user:password@localhost:5432/codeblue JWT_SECRET=your_jwt_secret MAPPLS_API_KEY=your_mappls_key_here PORT=5000 CLIENT_URL=http://localhost:5173
-
Run development servers:
npm run dev
- Citizen: Accessible at
/citizen. Request emergency services, track ambulance ETA, and view live location via Mappls SDK. No login required. - Admin: Accessible at
/admin-map(Dispatch map with hotspot toggle) and/analytics(Performance charts, 30-day volume, utilization metrics). - Hospital Staff: Accessible at
/hospital. Manage hospital ambulances and view dispatch status. - Driver: Accessible at
/driver. Interface for accepting calls and navigating.
You can verify the backend is running and connected to the database by visiting: GET http://localhost:5000/health