# v-par23/incident-board-api architecture

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

- Interactive diagram: https://gitdiagram.com/v-par23/incident-board-api
- Repository: https://github.com/v-par23/incident-board-api

## Overview

Incident Board is a lightweight Node.js API for managing service incidents and powering an on-call summary. An HTTP client reaches the server, whose app handler routes requests to incident operations or the service-report logic; those services read and update an in-memory store, and the handler returns JSON. The documented workflow covers incident listing, creation, retrieval, updates and status transitions, plus per-service summaries. Demo data initializes the store at startup. Source excerpts establish the main calls; endpoint behavior and the client-facing workflow are also documented in the README.

Main entry points: [`src/app.ts`](https://github.com/v-par23/incident-board-api/blob/master/src/app.ts) (Request Handler), [`src/server.ts`](https://github.com/v-par23/incident-board-api/blob/master/src/server.ts) (HTTP Server), [`src/services/incidentService.ts`](https://github.com/v-par23/incident-board-api/blob/master/src/services/incidentService.ts) (Incident Operations), [`src/store/memoryStore.ts`](https://github.com/v-par23/incident-board-api/blob/master/src/store/memoryStore.ts) (Memory Store)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_http["HTTP API"]
  node_server["HTTP Server<br/>[server.ts]"]
  node_app["Request Handler<br/>[app.ts]"]
  node_router["Path Router<br/>[router.ts]"]
  node_errors["API Errors<br/>[errors.ts]"]
end

subgraph group_domain["Incident Domain"]
  node_incident_service["Incident Operations<br/>[incidentService.ts]"]
  node_domain_types["Domain Types<br/>[constants.ts]"]
end

subgraph group_reporting["On-call Reporting"]
  node_report_service["Service Summary"]
end

subgraph group_persistence["Persistence"]
  node_store[("Memory Store<br/>[memoryStore.ts]")]
  node_seed["Demo Data<br/>[seed.ts]"]
end

node_client(("HTTP Client"))

node_client -->|"sends HTTP requests"| node_server
node_server -->|"starts handler"| node_app
node_server -->|"initializes store"| node_store
node_server -->|"loads demo data"| node_seed
node_app -->|"matches routes"| node_router
node_app -->|"dispatches incident requests"| node_incident_service
node_app -->|"dispatches summary requests"| node_report_service
node_app -->|"handles API errors"| node_errors
node_app -->|"returns JSON"| node_client
node_incident_service -->|"reads and writes"| node_store
node_incident_service -->|"uses domain types"| node_domain_types
node_incident_service -->|"throws validation errors"| node_errors
node_report_service -->|"reads service incidents"| node_store
node_report_service -->|"throws not found"| node_errors
node_store -->|"stores domain records"| node_domain_types

click node_server "https://github.com/v-par23/incident-board-api/blob/master/src/server.ts"
click node_app "https://github.com/v-par23/incident-board-api/blob/master/src/app.ts"
click node_router "https://github.com/v-par23/incident-board-api/blob/master/src/router.ts"
click node_errors "https://github.com/v-par23/incident-board-api/blob/master/src/errors.ts"
click node_incident_service "https://github.com/v-par23/incident-board-api/blob/master/src/services/incidentService.ts"
click node_domain_types "https://github.com/v-par23/incident-board-api/blob/master/src/constants.ts"
click node_report_service "https://github.com/v-par23/incident-board-api/blob/master/src/services/serviceReportService.ts"
click node_store "https://github.com/v-par23/incident-board-api/blob/master/src/store/memoryStore.ts"
click node_seed "https://github.com/v-par23/incident-board-api/blob/master/src/data/seed.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_server,node_app,node_router,node_errors,node_client toneBlue
class node_incident_service,node_domain_types toneAmber
class node_report_service toneMint
class node_store,node_seed toneRose
```

## Components

### HTTP API

- [HTTP Server](https://github.com/v-par23/incident-board-api/blob/master/src/server.ts): `src/server.ts`
- [Request Handler](https://github.com/v-par23/incident-board-api/blob/master/src/app.ts): `src/app.ts`
- [Path Router](https://github.com/v-par23/incident-board-api/blob/master/src/router.ts): `src/router.ts`
- [API Errors](https://github.com/v-par23/incident-board-api/blob/master/src/errors.ts): `src/errors.ts`

### Incident Domain

- [Incident Operations](https://github.com/v-par23/incident-board-api/blob/master/src/services/incidentService.ts): `src/services/incidentService.ts`
- [Domain Types](https://github.com/v-par23/incident-board-api/blob/master/src/constants.ts): `src/constants.ts`

### On-call Reporting

- [Service Summary](https://github.com/v-par23/incident-board-api/blob/master/src/services/serviceReportService.ts): `src/services/serviceReportService.ts`

### Persistence

- [Memory Store](https://github.com/v-par23/incident-board-api/blob/master/src/store/memoryStore.ts): `src/store/memoryStore.ts`
- [Demo Data](https://github.com/v-par23/incident-board-api/blob/master/src/data/seed.ts): `src/data/seed.ts`

### Other components

- **HTTP Client**

## Connections

- HTTP Client → HTTP Server: sends HTTP requests (evidence: `README.md`)
- HTTP Server → Request Handler: starts handler (evidence: `src/server.ts`)
- HTTP Server → Memory Store: initializes store (evidence: `src/server.ts`)
- HTTP Server → Demo Data: loads demo data (evidence: `src/server.ts`)
- Request Handler → Path Router: matches routes (evidence: `src/app.ts`)
- Request Handler → Incident Operations: dispatches incident requests (evidence: `src/app.ts`)
- Request Handler → Service Summary: dispatches summary requests (evidence: `src/app.ts`)
- Request Handler → API Errors: handles API errors (evidence: `src/app.ts`)
- Request Handler → HTTP Client: returns JSON (evidence: `src/app.ts`)
- Incident Operations → Memory Store: reads and writes (evidence: `src/services/incidentService.ts`)
- Incident Operations → Domain Types: uses domain types (evidence: `src/services/incidentService.ts`)
- Incident Operations → API Errors: throws validation errors (evidence: `src/services/incidentService.ts`)
- Service Summary → Memory Store: reads service incidents (evidence: `src/services/serviceReportService.ts`)
- Service Summary → API Errors: throws not found (evidence: `src/services/serviceReportService.ts`)
- Memory Store → Domain Types: stores domain records (evidence: `src/store/memoryStore.ts`)
