# shyber/devops-lab-nodejs architecture

> Architecture diagram of the GitHub repository shyber/devops-lab-nodejs, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/shyber/devops-lab-nodejs
- Repository: https://github.com/shyber/devops-lab-nodejs

## Overview

CIRS is a locally hosted incident-reporting web application: users sign in, submit and manage incident reports, and analysts triage, assign, comment on, and advance them through a workflow. SQLite persists accounts, incidents, categories, assignments, comments, and history; role and ownership checks govern access. The graph also preserves documented account/category management, metrics, and the static UI. Some route-to-service links are supported by the SOURCE INDEX; unsampled frontend/API wiring is shown only as unverified.

Main entry points: [`src/data/cirsStore.js`](https://github.com/shyber/devops-lab-nodejs/blob/main/src/data/cirsStore.js) (CIRS data access), [`src/app.js`](https://github.com/shyber/devops-lab-nodejs/blob/main/src/app.js) (Express app and router loader), [`src/security/auth.js`](https://github.com/shyber/devops-lab-nodejs/blob/main/src/security/auth.js) (Sessions and accounts), [`src/data/workflow.js`](https://github.com/shyber/devops-lab-nodejs/blob/main/src/data/workflow.js) (Workflow rules and comments)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web and API"]
  node_frontend["Static CIRS UI<br/>[app.js]"]
  node_server["Express app and router loader<br/>[app.js]"]
  node_entry["Server startup<br/>[index.js]"]
  node_validation["Input and workflow validation<br/>[validation.js]"]
  node_errors["API error responses<br/>[errorHandler.js]"]
  node_appinfo["Application information<br/>[appInfo.js]"]
  node_info["Information endpoint<br/>[info.route.js]"]
end

subgraph group_identity["Identity and Access"]
  node_login["Login and logout routes<br/>[auth.route.js]"]
  node_auth["Sessions and accounts<br/>[auth.js]"]
  node_access["Incident ownership checks<br/>[access.js]"]
  node_accounts["Account administration<br/>[users.route.js]"]
end

subgraph group_incident["Incident Operations"]
  node_incidents["Incident reports and CRUD<br/>[incidents.route.js]"]
  node_workflow["Triage, comments, history<br/>[workflow.route.js]"]
  node_workflow_service["Workflow rules and comments<br/>[workflow.js]"]
  node_analysts["Analyst directory<br/>[analysts.route.js]"]
  node_assignments["Incident assignments"]
  node_categories["Category administration"]
  node_metrics["Operational metrics<br/>[metrics.route.js]"]
end

subgraph group_persistence["Persistence"]
  node_store["CIRS data access<br/>[cirsStore.js]"]
  node_database[("SQLite schema and connection<br/>[db.js]")]
end

node_user(("Campus user or analyst"))
node_cirsdata["Practice data module<br/>[cirsData.js]"]

node_user -->|"uses"| node_frontend
node_frontend -.->|"uses API"| node_server
node_entry -->|"starts"| node_server
node_server -->|"loads routes"| node_login
node_server -->|"handles errors"| node_errors
node_server -->|"guards API"| node_auth
node_login -->|"authenticates"| node_auth
node_accounts -->|"manages accounts"| node_auth
node_incidents -->|"reads and writes"| node_store
node_incidents -->|"checks ownership"| node_access
node_workflow -->|"checks ownership"| node_access
node_workflow -->|"applies workflow"| node_workflow_service
node_workflow_service -->|"reads incidents"| node_store
node_workflow_service -->|"stores comments"| node_database
node_analysts -->|"manages analysts"| node_store
node_assignments -->|"updates assignments"| node_store
node_categories -->|"reads categories"| node_store
node_metrics -->|"queries metrics"| node_store
node_auth -->|"persists sessions"| node_database
node_store -->|"persists CIRS data"| node_database
node_auth -->|"validates values"| node_validation
node_workflow_service -->|"checks transitions"| node_validation
node_info -->|"reads metadata"| node_appinfo

click node_frontend "https://github.com/shyber/devops-lab-nodejs/blob/main/public/app.js"
click node_server "https://github.com/shyber/devops-lab-nodejs/blob/main/src/app.js"
click node_entry "https://github.com/shyber/devops-lab-nodejs/blob/main/src/index.js"
click node_login "https://github.com/shyber/devops-lab-nodejs/blob/main/src/routes/auto/auth.route.js"
click node_auth "https://github.com/shyber/devops-lab-nodejs/blob/main/src/security/auth.js"
click node_access "https://github.com/shyber/devops-lab-nodejs/blob/main/src/security/access.js"
click node_accounts "https://github.com/shyber/devops-lab-nodejs/blob/main/src/routes/auto/users.route.js"
click node_incidents "https://github.com/shyber/devops-lab-nodejs/blob/main/src/routes/auto/incidents.route.js"
click node_workflow "https://github.com/shyber/devops-lab-nodejs/blob/main/src/routes/auto/workflow.route.js"
click node_workflow_service "https://github.com/shyber/devops-lab-nodejs/blob/main/src/data/workflow.js"
click node_analysts "https://github.com/shyber/devops-lab-nodejs/blob/main/src/routes/auto/analysts.route.js"
click node_assignments "https://github.com/shyber/devops-lab-nodejs/blob/main/src/routes/auto/assignments.route.js"
click node_categories "https://github.com/shyber/devops-lab-nodejs/blob/main/src/routes/auto/categories.route.js"
click node_metrics "https://github.com/shyber/devops-lab-nodejs/blob/main/src/routes/auto/metrics.route.js"
click node_store "https://github.com/shyber/devops-lab-nodejs/blob/main/src/data/cirsStore.js"
click node_database "https://github.com/shyber/devops-lab-nodejs/blob/main/src/data/db.js"
click node_validation "https://github.com/shyber/devops-lab-nodejs/blob/main/src/utils/validation.js"
click node_errors "https://github.com/shyber/devops-lab-nodejs/blob/main/src/utils/errorHandler.js"
click node_appinfo "https://github.com/shyber/devops-lab-nodejs/blob/main/src/utils/appInfo.js"
click node_info "https://github.com/shyber/devops-lab-nodejs/blob/main/src/routes/auto/info.route.js"
click node_cirsdata "https://github.com/shyber/devops-lab-nodejs/blob/main/cirsData.js"

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_frontend,node_server,node_entry,node_validation,node_errors,node_appinfo,node_info,node_user toneBlue
class node_login,node_auth,node_access,node_accounts toneAmber
class node_incidents,node_workflow,node_workflow_service,node_analysts,node_assignments,node_categories,node_metrics toneMint
class node_store,node_database toneRose
class node_cirsdata toneTeal
```

## Components

### Web and API

- [Static CIRS UI](https://github.com/shyber/devops-lab-nodejs/blob/main/public/app.js): `public/app.js`
- [Express app and router loader](https://github.com/shyber/devops-lab-nodejs/blob/main/src/app.js): `src/app.js`
- [Server startup](https://github.com/shyber/devops-lab-nodejs/blob/main/src/index.js): `src/index.js`
- [Input and workflow validation](https://github.com/shyber/devops-lab-nodejs/blob/main/src/utils/validation.js): `src/utils/validation.js`
- [API error responses](https://github.com/shyber/devops-lab-nodejs/blob/main/src/utils/errorHandler.js): `src/utils/errorHandler.js`
- [Application information](https://github.com/shyber/devops-lab-nodejs/blob/main/src/utils/appInfo.js): `src/utils/appInfo.js`
- [Information endpoint](https://github.com/shyber/devops-lab-nodejs/blob/main/src/routes/auto/info.route.js): `src/routes/auto/info.route.js`

### Identity and Access

- [Login and logout routes](https://github.com/shyber/devops-lab-nodejs/blob/main/src/routes/auto/auth.route.js): `src/routes/auto/auth.route.js`
- [Sessions and accounts](https://github.com/shyber/devops-lab-nodejs/blob/main/src/security/auth.js): `src/security/auth.js`
- [Incident ownership checks](https://github.com/shyber/devops-lab-nodejs/blob/main/src/security/access.js): `src/security/access.js`
- [Account administration](https://github.com/shyber/devops-lab-nodejs/blob/main/src/routes/auto/users.route.js): `src/routes/auto/users.route.js`

### Incident Operations

- [Incident reports and CRUD](https://github.com/shyber/devops-lab-nodejs/blob/main/src/routes/auto/incidents.route.js): `src/routes/auto/incidents.route.js`
- [Triage, comments, history](https://github.com/shyber/devops-lab-nodejs/blob/main/src/routes/auto/workflow.route.js): `src/routes/auto/workflow.route.js`
- [Workflow rules and comments](https://github.com/shyber/devops-lab-nodejs/blob/main/src/data/workflow.js): `src/data/workflow.js`
- [Analyst directory](https://github.com/shyber/devops-lab-nodejs/blob/main/src/routes/auto/analysts.route.js): `src/routes/auto/analysts.route.js`
- [Incident assignments](https://github.com/shyber/devops-lab-nodejs/blob/main/src/routes/auto/assignments.route.js): `src/routes/auto/assignments.route.js`
- [Category administration](https://github.com/shyber/devops-lab-nodejs/blob/main/src/routes/auto/categories.route.js): `src/routes/auto/categories.route.js`
- [Operational metrics](https://github.com/shyber/devops-lab-nodejs/blob/main/src/routes/auto/metrics.route.js): `src/routes/auto/metrics.route.js`

### Persistence

- [CIRS data access](https://github.com/shyber/devops-lab-nodejs/blob/main/src/data/cirsStore.js): `src/data/cirsStore.js`
- [SQLite schema and connection](https://github.com/shyber/devops-lab-nodejs/blob/main/src/data/db.js): `src/data/db.js`

### Other components

- **Campus user or analyst**
- [Practice data module](https://github.com/shyber/devops-lab-nodejs/blob/main/cirsData.js): `cirsData.js`

## Connections

- Campus user or analyst → Static CIRS UI: uses (evidence: `README.md`)
- Static CIRS UI → Express app and router loader: uses API
- Server startup → Express app and router loader: starts (evidence: `src/index.js`)
- Express app and router loader → Login and logout routes: loads routes (evidence: `src/app.js`)
- Express app and router loader → API error responses: handles errors (evidence: `src/app.js`)
- Express app and router loader → Sessions and accounts: guards API (evidence: `src/app.js`)
- Login and logout routes → Sessions and accounts: authenticates (evidence: `src/routes/auto/auth.route.js`)
- Account administration → Sessions and accounts: manages accounts (evidence: `src/routes/auto/users.route.js`)
- Incident reports and CRUD → CIRS data access: reads and writes (evidence: `src/routes/auto/incidents.route.js`)
- Incident reports and CRUD → Incident ownership checks: checks ownership (evidence: `src/routes/auto/incidents.route.js`)
- Triage, comments, history → Incident ownership checks: checks ownership (evidence: `src/routes/auto/workflow.route.js`)
- Triage, comments, history → Workflow rules and comments: applies workflow (evidence: `src/routes/auto/workflow.route.js`)
- Workflow rules and comments → CIRS data access: reads incidents (evidence: `src/data/workflow.js`)
- Workflow rules and comments → SQLite schema and connection: stores comments (evidence: `src/data/workflow.js`)
- Analyst directory → CIRS data access: manages analysts (evidence: `src/routes/auto/analysts.route.js`)
- Incident assignments → CIRS data access: updates assignments (evidence: `src/routes/auto/assignments.route.js`)
- Category administration → CIRS data access: reads categories (evidence: `src/routes/auto/categories.route.js`)
- Operational metrics → CIRS data access: queries metrics (evidence: `src/routes/auto/metrics.route.js`)
- Sessions and accounts → SQLite schema and connection: persists sessions (evidence: `src/security/auth.js`)
- CIRS data access → SQLite schema and connection: persists CIRS data (evidence: `src/data/cirsStore.js`)
- Sessions and accounts → Input and workflow validation: validates values (evidence: `src/security/auth.js`)
- Workflow rules and comments → Input and workflow validation: checks transitions (evidence: `src/data/workflow.js`)
- Information endpoint → Application information: reads metadata (evidence: `src/routes/auto/info.route.js`)
