How pradhumnaadhikari/incidenthub-backend works
IncidentHub Backend is a small Express API for checking service health and creating, listing, retrieving, updating, and deleting incidents. The principal workflow is an HTTP request routed through the incident routes to a controller, which queries PostgreSQL and returns JSON. The database pool is configured from environment variables. The tree includes a SQL schema, but the available excerpts do not show its contents or how it is applied, so no schema-to-database relationship is asserted.
Main entry points: server.js Express server · incidents.js Incident routes · incidentsController.js Incident controller · db.js PostgreSQL pool
Components 7
HTTP API
- Express server
src/server.js - Incident routes
src/routes/incidents.js
Incident handling
- Incident controller
src/controllers/incidentsController.js
Persistence
- PostgreSQL pool
src/db.js - PostgreSQL
- Incident schema
database/schema.sql
Other components
- API client
Connections 5
- API client → Express server: sends HTTP
src/server.js - Express server → Incident routes: mounts routes
src/server.js - Incident routes → Incident controller: dispatches requests
src/routes/incidents.js - Incident controller → PostgreSQL pool: queries
src/controllers/incidentsController.js - PostgreSQL pool → PostgreSQL: connects via pool
src/db.js