# yasemennnn/incident-monitoring architecture

> Architecture diagram of the GitHub repository yasemennnn/incident-monitoring, 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/yasemennnn/incident-monitoring
- Repository: https://github.com/yasemennnn/incident-monitoring

## Overview

This is a real-time incident monitoring system. Operational events flow from a .NET producer through Kafka into backend validation and persistence; a separate worker projects PostgreSQL snapshots into Redis for dashboard reads. Users browse event lists and details, service health, and dashboard summaries, and can change event status. The API also pushes event and summary updates over SignalR. The README documents the end-to-end flow; some subsystem links rely on that documentation because their source was not sampled.

Main entry points: [`backend/IncidentMonitoring.Core/Services/EventProcessor.cs`](https://github.com/yasemennnn/incident-monitoring/blob/main/backend/IncidentMonitoring.Core/Services/EventProcessor.cs) (Event processor), [`backend/IncidentMonitoring.Infrastructure/Redis/RedisProjectionWorker.cs`](https://github.com/yasemennnn/incident-monitoring/blob/main/backend/IncidentMonitoring.Infrastructure/Redis/RedisProjectionWorker.cs) (Projection worker), [`frontend/src/app/core/services/api.service.ts`](https://github.com/yasemennnn/incident-monitoring/blob/main/frontend/src/app/core/services/api.service.ts) (HTTP client), [`backend/IncidentMonitoring.Core/Services/EventService.cs`](https://github.com/yasemennnn/incident-monitoring/blob/main/backend/IncidentMonitoring.Core/Services/EventService.cs) (Event service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ingest["Event ingestion"]
  node_producer["Event producer<br/>[ProducerWorker.cs]"]
  node_kafka["Kafka events"]
  node_consumer["Kafka consumer"]
  node_dlq["Dead-letter topic"]
end

subgraph group_backend["Backend services"]
  node_processor["Event processor<br/>[EventProcessor.cs]"]
  node_validator["Event validation<br/>[EventValidator.cs]"]
  node_comparison["Duplicate comparison<br/>[EventComparison.cs]"]
  node_eventservice["Event service<br/>[EventService.cs]"]
  node_dashboardservice["Dashboard service"]
end

subgraph group_storage["Persistence and projection"]
  node_repository["Event repository<br/>[EventRepository.cs]"]
  node_postgres[("PostgreSQL")]
  node_projectionworker["Projection worker"]
  node_projection["Dashboard projection"]
  node_redis[("Redis dashboard")]
end

subgraph group_api["API and realtime"]
  node_eventscontroller["Events API"]
  node_dashboardcontroller["Dashboard API"]
  node_notifier["SignalR notifier"]
  node_hub["Incident hub<br/>[IncidentHub.cs]"]
end

subgraph group_frontend["Dashboard UI"]
  node_api_client["HTTP client<br/>[api.service.ts]"]
  node_realtime_client["Realtime client"]
  node_pages["Dashboard pages<br/>[dashboard-page.ts]"]
  node_eventpages["Event pages<br/>[events-page.ts]"]
  node_servicepage["Service status page<br/>[services-page.ts]"]
end

node_user(("Dashboard user"))
node_signalr(("SignalR clients"))

node_producer -->|"publishes events"| node_kafka
node_kafka -->|"delivers messages"| node_consumer
node_consumer -->|"processes message"| node_processor
node_consumer -->|"dead-letters failures"| node_dlq
node_processor -->|"validates event"| node_validator
node_processor -->|"classifies duplicates"| node_comparison
node_processor -->|"inserts or reads"| node_repository
node_repository -->|"reads and writes"| node_postgres
node_processor -->|"requests refresh"| node_projectionworker
node_processor -->|"publishes event"| node_notifier
node_eventscontroller -->|"delegates requests"| node_eventservice
node_eventservice -->|"reads and updates"| node_repository
node_eventservice -->|"requests refresh"| node_projectionworker
node_eventservice -->|"publishes update"| node_notifier
node_dashboardcontroller -->|"delegates requests"| node_dashboardservice
node_dashboardservice -->|"reads projection"| node_redis
node_projectionworker -->|"reads snapshot"| node_repository
node_projectionworker -->|"builds state"| node_projection
node_projectionworker -->|"writes projection"| node_redis
node_projectionworker -->|"publishes summary"| node_notifier
node_notifier -->|"sends updates"| node_hub
node_api_client -->|"calls event endpoints"| node_eventscontroller
node_api_client -->|"calls dashboard endpoints"| node_dashboardcontroller
node_realtime_client -->|"connects to"| node_hub
node_hub -->|"pushes updates"| node_signalr
node_user -->|"views dashboard"| node_pages
node_user -->|"browses incidents"| node_eventpages
node_user -->|"checks service health"| node_servicepage
node_pages -->|"loads summary"| node_api_client
node_eventpages -->|"loads and updates"| node_api_client
node_servicepage -->|"loads service status"| node_api_client

click node_producer "https://github.com/yasemennnn/incident-monitoring/blob/main/backend/IncidentMonitoring.Producer/ProducerWorker.cs"
click node_consumer "https://github.com/yasemennnn/incident-monitoring/blob/main/backend/IncidentMonitoring.Infrastructure/Kafka/KafkaConsumerService.cs"
click node_processor "https://github.com/yasemennnn/incident-monitoring/blob/main/backend/IncidentMonitoring.Core/Services/EventProcessor.cs"
click node_validator "https://github.com/yasemennnn/incident-monitoring/blob/main/backend/IncidentMonitoring.Core/Rules/EventValidator.cs"
click node_comparison "https://github.com/yasemennnn/incident-monitoring/blob/main/backend/IncidentMonitoring.Core/Rules/EventComparison.cs"
click node_eventservice "https://github.com/yasemennnn/incident-monitoring/blob/main/backend/IncidentMonitoring.Core/Services/EventService.cs"
click node_dashboardservice "https://github.com/yasemennnn/incident-monitoring/blob/main/backend/IncidentMonitoring.Core/Services/DashboardService.cs"
click node_repository "https://github.com/yasemennnn/incident-monitoring/blob/main/backend/IncidentMonitoring.Infrastructure/Data/EventRepository.cs"
click node_projectionworker "https://github.com/yasemennnn/incident-monitoring/blob/main/backend/IncidentMonitoring.Infrastructure/Redis/RedisProjectionWorker.cs"
click node_projection "https://github.com/yasemennnn/incident-monitoring/blob/main/backend/IncidentMonitoring.Core/Rules/DashboardProjection.cs"
click node_redis "https://github.com/yasemennnn/incident-monitoring/blob/main/backend/IncidentMonitoring.Infrastructure/Redis/RedisDashboardStore.cs"
click node_eventscontroller "https://github.com/yasemennnn/incident-monitoring/blob/main/backend/IncidentMonitoring.Api/Controllers/EventsController.cs"
click node_dashboardcontroller "https://github.com/yasemennnn/incident-monitoring/blob/main/backend/IncidentMonitoring.Api/Controllers/DashboardController.cs"
click node_notifier "https://github.com/yasemennnn/incident-monitoring/blob/main/backend/IncidentMonitoring.Api/Hubs/SignalREventNotifier.cs"
click node_hub "https://github.com/yasemennnn/incident-monitoring/blob/main/backend/IncidentMonitoring.Api/Hubs/IncidentHub.cs"
click node_api_client "https://github.com/yasemennnn/incident-monitoring/blob/main/frontend/src/app/core/services/api.service.ts"
click node_realtime_client "https://github.com/yasemennnn/incident-monitoring/blob/main/frontend/src/app/core/services/realtime.service.ts"
click node_pages "https://github.com/yasemennnn/incident-monitoring/blob/main/frontend/src/app/features/dashboard/dashboard-page.ts"
click node_eventpages "https://github.com/yasemennnn/incident-monitoring/blob/main/frontend/src/app/features/events/events-page.ts"
click node_servicepage "https://github.com/yasemennnn/incident-monitoring/blob/main/frontend/src/app/features/services/services-page.ts"

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_producer,node_kafka,node_consumer,node_dlq,node_user,node_signalr toneBlue
class node_processor,node_validator,node_comparison,node_eventservice,node_dashboardservice toneAmber
class node_repository,node_postgres,node_projectionworker,node_projection,node_redis toneMint
class node_eventscontroller,node_dashboardcontroller,node_notifier,node_hub toneRose
class node_api_client,node_realtime_client,node_pages,node_eventpages,node_servicepage toneIndigo
```

## Components

### Event ingestion

- [Event producer](https://github.com/yasemennnn/incident-monitoring/blob/main/backend/IncidentMonitoring.Producer/ProducerWorker.cs): `backend/IncidentMonitoring.Producer/ProducerWorker.cs`
- **Kafka events**
- [Kafka consumer](https://github.com/yasemennnn/incident-monitoring/blob/main/backend/IncidentMonitoring.Infrastructure/Kafka/KafkaConsumerService.cs): `backend/IncidentMonitoring.Infrastructure/Kafka/KafkaConsumerService.cs`
- **Dead-letter topic**

### Backend services

- [Event processor](https://github.com/yasemennnn/incident-monitoring/blob/main/backend/IncidentMonitoring.Core/Services/EventProcessor.cs): `backend/IncidentMonitoring.Core/Services/EventProcessor.cs`
- [Event validation](https://github.com/yasemennnn/incident-monitoring/blob/main/backend/IncidentMonitoring.Core/Rules/EventValidator.cs): `backend/IncidentMonitoring.Core/Rules/EventValidator.cs`
- [Duplicate comparison](https://github.com/yasemennnn/incident-monitoring/blob/main/backend/IncidentMonitoring.Core/Rules/EventComparison.cs): `backend/IncidentMonitoring.Core/Rules/EventComparison.cs`
- [Event service](https://github.com/yasemennnn/incident-monitoring/blob/main/backend/IncidentMonitoring.Core/Services/EventService.cs): `backend/IncidentMonitoring.Core/Services/EventService.cs`
- [Dashboard service](https://github.com/yasemennnn/incident-monitoring/blob/main/backend/IncidentMonitoring.Core/Services/DashboardService.cs): `backend/IncidentMonitoring.Core/Services/DashboardService.cs`

### Persistence and projection

- [Event repository](https://github.com/yasemennnn/incident-monitoring/blob/main/backend/IncidentMonitoring.Infrastructure/Data/EventRepository.cs): `backend/IncidentMonitoring.Infrastructure/Data/EventRepository.cs`
- **PostgreSQL**
- [Projection worker](https://github.com/yasemennnn/incident-monitoring/blob/main/backend/IncidentMonitoring.Infrastructure/Redis/RedisProjectionWorker.cs): `backend/IncidentMonitoring.Infrastructure/Redis/RedisProjectionWorker.cs`
- [Dashboard projection](https://github.com/yasemennnn/incident-monitoring/blob/main/backend/IncidentMonitoring.Core/Rules/DashboardProjection.cs): `backend/IncidentMonitoring.Core/Rules/DashboardProjection.cs`
- [Redis dashboard](https://github.com/yasemennnn/incident-monitoring/blob/main/backend/IncidentMonitoring.Infrastructure/Redis/RedisDashboardStore.cs): `backend/IncidentMonitoring.Infrastructure/Redis/RedisDashboardStore.cs`

### API and realtime

- [Events API](https://github.com/yasemennnn/incident-monitoring/blob/main/backend/IncidentMonitoring.Api/Controllers/EventsController.cs): `backend/IncidentMonitoring.Api/Controllers/EventsController.cs`
- [Dashboard API](https://github.com/yasemennnn/incident-monitoring/blob/main/backend/IncidentMonitoring.Api/Controllers/DashboardController.cs): `backend/IncidentMonitoring.Api/Controllers/DashboardController.cs`
- [SignalR notifier](https://github.com/yasemennnn/incident-monitoring/blob/main/backend/IncidentMonitoring.Api/Hubs/SignalREventNotifier.cs): `backend/IncidentMonitoring.Api/Hubs/SignalREventNotifier.cs`
- [Incident hub](https://github.com/yasemennnn/incident-monitoring/blob/main/backend/IncidentMonitoring.Api/Hubs/IncidentHub.cs): `backend/IncidentMonitoring.Api/Hubs/IncidentHub.cs`

### Dashboard UI

- [HTTP client](https://github.com/yasemennnn/incident-monitoring/blob/main/frontend/src/app/core/services/api.service.ts): `frontend/src/app/core/services/api.service.ts`
- [Realtime client](https://github.com/yasemennnn/incident-monitoring/blob/main/frontend/src/app/core/services/realtime.service.ts): `frontend/src/app/core/services/realtime.service.ts`
- [Dashboard pages](https://github.com/yasemennnn/incident-monitoring/blob/main/frontend/src/app/features/dashboard/dashboard-page.ts): `frontend/src/app/features/dashboard/dashboard-page.ts`
- [Event pages](https://github.com/yasemennnn/incident-monitoring/blob/main/frontend/src/app/features/events/events-page.ts): `frontend/src/app/features/events/events-page.ts`
- [Service status page](https://github.com/yasemennnn/incident-monitoring/blob/main/frontend/src/app/features/services/services-page.ts): `frontend/src/app/features/services/services-page.ts`

### Other components

- **Dashboard user**
- **SignalR clients**

## Connections

- Event producer → Kafka events: publishes events
- Kafka events → Kafka consumer: delivers messages
- Kafka consumer → Event processor: processes message
- Kafka consumer → Dead-letter topic: dead-letters failures
- Event processor → Event validation: validates event
- Event processor → Duplicate comparison: classifies duplicates
- Event processor → Event repository: inserts or reads
- Event repository → PostgreSQL: reads and writes
- Event processor → Projection worker: requests refresh
- Event processor → SignalR notifier: publishes event
- Events API → Event service: delegates requests
- Event service → Event repository: reads and updates
- Event service → Projection worker: requests refresh
- Event service → SignalR notifier: publishes update
- Dashboard API → Dashboard service: delegates requests
- Dashboard service → Redis dashboard: reads projection
- Projection worker → Event repository: reads snapshot
- Projection worker → Dashboard projection: builds state
- Projection worker → Redis dashboard: writes projection
- Projection worker → SignalR notifier: publishes summary
- SignalR notifier → Incident hub: sends updates
- HTTP client → Events API: calls event endpoints
- HTTP client → Dashboard API: calls dashboard endpoints
- Realtime client → Incident hub: connects to
- Incident hub → SignalR clients: pushes updates
- Dashboard user → Dashboard pages: views dashboard
- Dashboard user → Event pages: browses incidents
- Dashboard user → Service status page: checks service health
- Dashboard pages → HTTP client: loads summary
- Event pages → HTTP client: loads and updates
- Service status page → HTTP client: loads service status
