# anushkabadakh/incident-pulselive architecture

> Architecture diagram of the GitHub repository anushkabadakh/incident-pulselive, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/anushkabadakh/incident-pulselive
- Repository: https://github.com/anushkabadakh/incident-pulselive

## Overview

Incident PulseLive lets employees report incidents, engineers assign and update them, and managers monitor operational status. The React dashboard uses REST for incident actions and queries; backend controllers dispatch to separate CQRS command and query handlers. Commands mutate the incident domain, persist through a repository adapter, and publish notifications; dashboard updates also arrive over WebSockets. The README documents authentication and live updates, while sampled source confirms selected handlers and adapters; unsampled frontend wiring is represented only where documented.

Main entry points: [`backend/src/main/java/com/eaton/incidentmanagement/application/command`](https://github.com/anushkabadakh/incident-pulselive/tree/main/backend/src/main/java/com/eaton/incidentmanagement/application/command) (Command handlers), [`frontend/src/pages/Dashboard.jsx`](https://github.com/anushkabadakh/incident-pulselive/blob/main/frontend/src/pages/Dashboard.jsx) (Dashboard), [`backend/src/main/java/com/eaton/incidentmanagement/presentation/controller/IncidentController.java`](https://github.com/anushkabadakh/incident-pulselive/blob/main/backend/src/main/java/com/eaton/incidentmanagement/presentation/controller/IncidentController.java) (Incident API), [`frontend/src/App.jsx`](https://github.com/anushkabadakh/incident-pulselive/blob/main/frontend/src/App.jsx) (React app)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["React dashboard"]
  node_app["React app<br/>[App.jsx]"]
  node_dashboard["Dashboard<br/>[Dashboard.jsx]"]
  node_createform["Create incident"]
  node_incidentlist["Incident list<br/>[IncidentList.jsx]"]
  node_metrics["Dashboard metrics"]
  node_api["REST client<br/>[api.js]"]
  node_websocketclient["WebSocket client<br/>[websocket.js]"]
end

subgraph group_presentation["REST presentation"]
  node_incidentcontroller["Incident API"]
  node_authcontroller["Login API"]
  node_exceptionhandler["API errors"]
end

subgraph group_application["Incident application"]
  node_commands["Command handlers"]
  node_queries["Query handler"]
  node_dto["Incident DTO<br/>[IncidentDto.java]"]
  node_notificationport["Notification port"]
end

subgraph group_domain["Incident domain"]
  node_incident["Incident aggregate<br/>[Incident.java]"]
  node_repositoryport["Repository port"]
end

subgraph group_infrastructure["Infrastructure"]
  node_repositoryadapter["Repository adapter"]
  node_jparepository["JPA repository"]
  node_notificationservice["WebSocket publisher"]
  node_jwt["JWT service<br/>[JwtService.java]"]
  node_security["Security config"]
end

node_employee(("Employee"))
node_engineer(("Engineer"))
node_manager(("Manager"))
node_database[("MySQL")]
node_stomp["STOMP topics"]

node_employee -->|"uses"| node_app
node_engineer -->|"uses"| node_app
node_manager -->|"uses"| node_app
node_app -->|"renders"| node_dashboard
node_dashboard -->|"shows"| node_createform
node_dashboard -->|"shows"| node_incidentlist
node_dashboard -->|"shows"| node_metrics
node_createform -->|"submits via"| node_api
node_incidentlist -->|"loads via"| node_api
node_metrics -->|"loads via"| node_api
node_api -->|"HTTP requests"| node_incidentcontroller
node_websocketclient -->|"subscribes"| node_stomp
node_notificationservice -->|"publishes"| node_stomp
node_incidentcontroller -->|"dispatches writes"| node_commands
node_incidentcontroller -->|"dispatches reads"| node_queries
node_authcontroller -->|"generates token"| node_jwt
node_security -->|"validates token"| node_jwt
node_commands -->|"reads and saves"| node_repositoryport
node_commands -->|"changes state"| node_incident
node_commands -->|"maps result"| node_dto
node_commands -->|"notifies"| node_notificationport
node_queries -->|"reads incidents"| node_repositoryport
node_queries -->|"maps results"| node_dto
node_repositoryadapter -->|"implements"| node_repositoryport
node_repositoryadapter -->|"delegates storage"| node_jparepository
node_jparepository -->|"reads and writes"| node_database
node_notificationservice -->|"implements"| node_notificationport
node_exceptionhandler -->|"formats errors"| node_incidentcontroller

click node_app "https://github.com/anushkabadakh/incident-pulselive/blob/main/frontend/src/App.jsx"
click node_dashboard "https://github.com/anushkabadakh/incident-pulselive/blob/main/frontend/src/pages/Dashboard.jsx"
click node_createform "https://github.com/anushkabadakh/incident-pulselive/blob/main/frontend/src/components/CreateIncidentForm.jsx"
click node_incidentlist "https://github.com/anushkabadakh/incident-pulselive/blob/main/frontend/src/components/IncidentList.jsx"
click node_metrics "https://github.com/anushkabadakh/incident-pulselive/blob/main/frontend/src/components/DashboardMetrics.jsx"
click node_api "https://github.com/anushkabadakh/incident-pulselive/blob/main/frontend/src/services/api.js"
click node_websocketclient "https://github.com/anushkabadakh/incident-pulselive/blob/main/frontend/src/services/websocket.js"
click node_incidentcontroller "https://github.com/anushkabadakh/incident-pulselive/blob/main/backend/src/main/java/com/eaton/incidentmanagement/presentation/controller/IncidentController.java"
click node_authcontroller "https://github.com/anushkabadakh/incident-pulselive/blob/main/backend/src/main/java/com/eaton/incidentmanagement/presentation/controller/AuthController.java"
click node_exceptionhandler "https://github.com/anushkabadakh/incident-pulselive/blob/main/backend/src/main/java/com/eaton/incidentmanagement/presentation/exception/GlobalExceptionHandler.java"
click node_commands "https://github.com/anushkabadakh/incident-pulselive/tree/main/backend/src/main/java/com/eaton/incidentmanagement/application/command"
click node_queries "https://github.com/anushkabadakh/incident-pulselive/blob/main/backend/src/main/java/com/eaton/incidentmanagement/application/query/IncidentQueryHandler.java"
click node_dto "https://github.com/anushkabadakh/incident-pulselive/blob/main/backend/src/main/java/com/eaton/incidentmanagement/application/dto/IncidentDto.java"
click node_notificationport "https://github.com/anushkabadakh/incident-pulselive/blob/main/backend/src/main/java/com/eaton/incidentmanagement/application/dto/NotificationPort.java"
click node_incident "https://github.com/anushkabadakh/incident-pulselive/blob/main/backend/src/main/java/com/eaton/incidentmanagement/domain/entity/Incident.java"
click node_repositoryport "https://github.com/anushkabadakh/incident-pulselive/blob/main/backend/src/main/java/com/eaton/incidentmanagement/domain/entity/IncidentRepository.java"
click node_repositoryadapter "https://github.com/anushkabadakh/incident-pulselive/blob/main/backend/src/main/java/com/eaton/incidentmanagement/infrastructure/persistence/IncidentRepositoryImpl.java"
click node_jparepository "https://github.com/anushkabadakh/incident-pulselive/blob/main/backend/src/main/java/com/eaton/incidentmanagement/infrastructure/persistence/IncidentJpaSpringRepository.java"
click node_notificationservice "https://github.com/anushkabadakh/incident-pulselive/blob/main/backend/src/main/java/com/eaton/incidentmanagement/infrastructure/websocket/WebSocketNotificationService.java"
click node_jwt "https://github.com/anushkabadakh/incident-pulselive/blob/main/backend/src/main/java/com/eaton/incidentmanagement/infrastructure/security/JwtService.java"
click node_security "https://github.com/anushkabadakh/incident-pulselive/blob/main/backend/src/main/java/com/eaton/incidentmanagement/infrastructure/config/SecurityConfig.java"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_app,node_dashboard,node_createform,node_incidentlist,node_metrics,node_api,node_websocketclient toneBlue
class node_incidentcontroller,node_authcontroller,node_exceptionhandler,node_database toneAmber
class node_commands,node_queries,node_dto,node_notificationport toneMint
class node_incident,node_repositoryport toneRose
class node_repositoryadapter,node_jparepository,node_notificationservice,node_jwt,node_security,node_employee,node_engineer,node_manager,node_stomp toneIndigo
```

## Components

### React dashboard

- [React app](https://github.com/anushkabadakh/incident-pulselive/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Dashboard](https://github.com/anushkabadakh/incident-pulselive/blob/main/frontend/src/pages/Dashboard.jsx): `frontend/src/pages/Dashboard.jsx`
- [Create incident](https://github.com/anushkabadakh/incident-pulselive/blob/main/frontend/src/components/CreateIncidentForm.jsx): `frontend/src/components/CreateIncidentForm.jsx`
- [Incident list](https://github.com/anushkabadakh/incident-pulselive/blob/main/frontend/src/components/IncidentList.jsx): `frontend/src/components/IncidentList.jsx`
- [Dashboard metrics](https://github.com/anushkabadakh/incident-pulselive/blob/main/frontend/src/components/DashboardMetrics.jsx): `frontend/src/components/DashboardMetrics.jsx`
- [REST client](https://github.com/anushkabadakh/incident-pulselive/blob/main/frontend/src/services/api.js): `frontend/src/services/api.js`
- [WebSocket client](https://github.com/anushkabadakh/incident-pulselive/blob/main/frontend/src/services/websocket.js): `frontend/src/services/websocket.js`

### REST presentation

- [Incident API](https://github.com/anushkabadakh/incident-pulselive/blob/main/backend/src/main/java/com/eaton/incidentmanagement/presentation/controller/IncidentController.java): `backend/src/main/java/com/eaton/incidentmanagement/presentation/controller/IncidentController.java`
- [Login API](https://github.com/anushkabadakh/incident-pulselive/blob/main/backend/src/main/java/com/eaton/incidentmanagement/presentation/controller/AuthController.java): `backend/src/main/java/com/eaton/incidentmanagement/presentation/controller/AuthController.java`
- [API errors](https://github.com/anushkabadakh/incident-pulselive/blob/main/backend/src/main/java/com/eaton/incidentmanagement/presentation/exception/GlobalExceptionHandler.java): `backend/src/main/java/com/eaton/incidentmanagement/presentation/exception/GlobalExceptionHandler.java`

### Incident application

- [Command handlers](https://github.com/anushkabadakh/incident-pulselive/tree/main/backend/src/main/java/com/eaton/incidentmanagement/application/command): `backend/src/main/java/com/eaton/incidentmanagement/application/command`
- [Query handler](https://github.com/anushkabadakh/incident-pulselive/blob/main/backend/src/main/java/com/eaton/incidentmanagement/application/query/IncidentQueryHandler.java): `backend/src/main/java/com/eaton/incidentmanagement/application/query/IncidentQueryHandler.java`
- [Incident DTO](https://github.com/anushkabadakh/incident-pulselive/blob/main/backend/src/main/java/com/eaton/incidentmanagement/application/dto/IncidentDto.java): `backend/src/main/java/com/eaton/incidentmanagement/application/dto/IncidentDto.java`
- [Notification port](https://github.com/anushkabadakh/incident-pulselive/blob/main/backend/src/main/java/com/eaton/incidentmanagement/application/dto/NotificationPort.java): `backend/src/main/java/com/eaton/incidentmanagement/application/dto/NotificationPort.java`

### Incident domain

- [Incident aggregate](https://github.com/anushkabadakh/incident-pulselive/blob/main/backend/src/main/java/com/eaton/incidentmanagement/domain/entity/Incident.java): `backend/src/main/java/com/eaton/incidentmanagement/domain/entity/Incident.java`
- [Repository port](https://github.com/anushkabadakh/incident-pulselive/blob/main/backend/src/main/java/com/eaton/incidentmanagement/domain/entity/IncidentRepository.java): `backend/src/main/java/com/eaton/incidentmanagement/domain/entity/IncidentRepository.java`

### Infrastructure

- [Repository adapter](https://github.com/anushkabadakh/incident-pulselive/blob/main/backend/src/main/java/com/eaton/incidentmanagement/infrastructure/persistence/IncidentRepositoryImpl.java): `backend/src/main/java/com/eaton/incidentmanagement/infrastructure/persistence/IncidentRepositoryImpl.java`
- [JPA repository](https://github.com/anushkabadakh/incident-pulselive/blob/main/backend/src/main/java/com/eaton/incidentmanagement/infrastructure/persistence/IncidentJpaSpringRepository.java): `backend/src/main/java/com/eaton/incidentmanagement/infrastructure/persistence/IncidentJpaSpringRepository.java`
- [WebSocket publisher](https://github.com/anushkabadakh/incident-pulselive/blob/main/backend/src/main/java/com/eaton/incidentmanagement/infrastructure/websocket/WebSocketNotificationService.java): `backend/src/main/java/com/eaton/incidentmanagement/infrastructure/websocket/WebSocketNotificationService.java`
- [JWT service](https://github.com/anushkabadakh/incident-pulselive/blob/main/backend/src/main/java/com/eaton/incidentmanagement/infrastructure/security/JwtService.java): `backend/src/main/java/com/eaton/incidentmanagement/infrastructure/security/JwtService.java`
- [Security config](https://github.com/anushkabadakh/incident-pulselive/blob/main/backend/src/main/java/com/eaton/incidentmanagement/infrastructure/config/SecurityConfig.java): `backend/src/main/java/com/eaton/incidentmanagement/infrastructure/config/SecurityConfig.java`

### Other components

- **Employee**
- **Engineer**
- **Manager**
- **MySQL**
- **STOMP topics**

## Connections

- Employee → React app: uses
- Engineer → React app: uses
- Manager → React app: uses
- React app → Dashboard: renders
- Dashboard → Create incident: shows
- Dashboard → Incident list: shows
- Dashboard → Dashboard metrics: shows
- Create incident → REST client: submits via
- Incident list → REST client: loads via
- Dashboard metrics → REST client: loads via
- REST client → Incident API: HTTP requests
- WebSocket client → STOMP topics: subscribes
- WebSocket publisher → STOMP topics: publishes
- Incident API → Command handlers: dispatches writes
- Incident API → Query handler: dispatches reads
- Login API → JWT service: generates token
- Security config → JWT service: validates token
- Command handlers → Repository port: reads and saves
- Command handlers → Incident aggregate: changes state
- Command handlers → Incident DTO: maps result
- Command handlers → Notification port: notifies
- Query handler → Repository port: reads incidents
- Query handler → Incident DTO: maps results
- Repository adapter → Repository port: implements
- Repository adapter → JPA repository: delegates storage
- JPA repository → MySQL: reads and writes
- WebSocket publisher → Notification port: implements
- API errors → Incident API: formats errors
