How phantomxreborn/nexus-dispatch works
Nexus Dispatch is a browser-based CAD system for managing emergency incidents, field units, dispatch decisions, and operational history. The documented dispatcher workflow is to review active incidents and unit availability, identify a nearby available unit, assign it, update unit/incident status, and later close the incident; the API also exposes logs and dispatch statistics. The sampled server implements these workflows directly and queries PostgreSQL through a pooled database module. The README describes a dashboard and role-based access; the provided tree includes its HTML entry point, but no frontend implementation excerpt was available, so those links are documented rather than source-verified.
Main entry points: server.js HTTP server · incidents.js Incident management · dispatch.js Logs and statistics · database.js Query pool
Components 14
Dispatch operations
- CAD dashboard
public/index.html - Incident management
server/routes/incidents.js - Unit tracking
server/routes/units.js - Logs and statistics
server/routes/dispatch.js
Application service
- HTTP server
server/server.js
Persistence
- Query pool
server/models/database.js - PostgreSQL
- Incidents
migrations/001_initial_schema.sql - Units
migrations/001_initial_schema.sql - Dispatch logs
migrations/001_initial_schema.sql - User accounts
migrations/001_initial_schema.sql
Authentication
- Token validation
server/middleware/auth.js - Login endpoint
server/server.js
Other components
- Dispatcher
Connections 22
- Dispatcher → CAD dashboard: uses
README.md - CAD dashboard → HTTP server: requests API
README.md - Dispatcher → HTTP server: calls API
README.md - HTTP server → Incident management: handles incidents
README.md - HTTP server → Unit tracking: handles units
README.md - HTTP server → Logs and statistics: handles dispatch
README.md - HTTP server → Query pool: queries
server/server.js - Incident management → Query pool: queries
server/routes/incidents.js - Unit tracking → Query pool: queries
server/routes/units.js - Logs and statistics → Query pool: queries
server/routes/dispatch.js - Query pool → PostgreSQL: executes SQL
server/models/database.js - HTTP server → Login endpoint: registers
server/server.js - Login endpoint → User accounts: checks credentials
server/server.js - Token validation → Login endpoint: validates tokens
- Incident management → Incidents: reads and writes
server/routes/incidents.js - Incident management → Units: assigns units
server/routes/incidents.js - Incident management → Dispatch logs: records actions
server/routes/incidents.js - Unit tracking → Units: reads and updates
server/routes/units.js - Unit tracking → Dispatch logs: records status
server/routes/units.js - Logs and statistics → Incidents: aggregates
server/routes/dispatch.js - Logs and statistics → Units: aggregates
server/routes/dispatch.js - Logs and statistics → Dispatch logs: reads history
server/routes/dispatch.js