# lwambisrat/devops-lab-engineering-lab architecture

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

- Interactive diagram: https://gitdiagram.com/lwambisrat/devops-lab-engineering-lab
- Repository: https://github.com/lwambisrat/devops-lab-engineering-lab

## Overview

Regional Health is a hands-on reliability and capacity-engineering lab, not just a healthcare API. The learner selects an incident, reproduces its traffic, then investigates database behavior and service metrics to diagnose and verify a fix. The API supports patient lookup, admissions, exports, health/readiness checks, and audit-store probing. The README documents the MySQL, MongoDB, Prometheus, and Grafana environment; API-to-database calls are visible in the sampled server source. Infrastructure and seed subsystems are included, but their runtime wiring was not sampled.

Main entry points: [`api/server.js`](https://github.com/lwambisrat/devops-lab-engineering-lab/blob/main/api/server.js) (API Runtime), [`api/database.js`](https://github.com/lwambisrat/devops-lab-engineering-lab/blob/main/api/database.js) (Connection Factories), [`load-tests`](https://github.com/lwambisrat/devops-lab-engineering-lab/tree/main/load-tests) (Load Scenarios), [`monitoring/prometheus.yml`](https://github.com/lwambisrat/devops-lab-engineering-lab/blob/main/monitoring/prometheus.yml) (Prometheus)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_lab["Incident Lab"]
  node_tickets["Incident Queue"]
  node_load["Load Scenarios"]
  node_journal["Investigation Journal<br/>[LAB_JOURNAL.md]"]
  node_provision["Cloud Provisioning"]
end

subgraph group_api["Healthcare API"]
  node_server["API Runtime<br/>[server.js]"]
  node_patient["Patient Queries<br/>[server.js]"]
  node_admissions["Bed Admissions<br/>[server.js]"]
  node_export["Patient Export<br/>[server.js]"]
  node_health["Health and Readiness<br/>[server.js]"]
  node_metrics["API Metrics<br/>[server.js]"]
  node_secrets["Credential Loading<br/>[secrets.js]"]
end

subgraph group_data["Data Services"]
  node_dbfactory["Connection Factories<br/>[database.js]"]
  node_mysql[("MySQL Store")]
  node_mongo[("Mongo Audit Store")]
  node_seed["Data Seeding"]
end

subgraph group_observability["Observability"]
  node_prometheus["Prometheus<br/>[prometheus.yml]"]
  node_grafana["Grafana Dashboards"]
end

node_learner(("On-call Learner"))

node_learner -->|"selects ticket"| node_tickets
node_learner -->|"runs scenario"| node_load
node_load -->|"sends traffic"| node_server
node_learner -->|"records findings"| node_journal
node_server -->|"loads credentials"| node_secrets
node_server -->|"initializes connections"| node_dbfactory
node_patient -->|"queries patients"| node_mysql
node_admissions -->|"updates beds"| node_mysql
node_export -->|"reads batches"| node_mysql
node_health -->|"checks readiness"| node_dbfactory
node_dbfactory -->|"creates pool"| node_mysql
node_dbfactory -->|"connects lazily"| node_mongo
node_server -->|"pings audit store"| node_mongo
node_prometheus -->|"scrapes metrics"| node_metrics
node_learner -->|"investigates metrics"| node_prometheus
node_learner -->|"reviews dashboards"| node_grafana
node_learner -->|"inspects database"| node_mysql

click node_tickets "https://github.com/lwambisrat/devops-lab-engineering-lab/tree/main/incidents"
click node_load "https://github.com/lwambisrat/devops-lab-engineering-lab/tree/main/load-tests"
click node_journal "https://github.com/lwambisrat/devops-lab-engineering-lab/blob/main/LAB_JOURNAL.md"
click node_server "https://github.com/lwambisrat/devops-lab-engineering-lab/blob/main/api/server.js"
click node_patient "https://github.com/lwambisrat/devops-lab-engineering-lab/blob/main/api/server.js"
click node_admissions "https://github.com/lwambisrat/devops-lab-engineering-lab/blob/main/api/server.js"
click node_export "https://github.com/lwambisrat/devops-lab-engineering-lab/blob/main/api/server.js"
click node_health "https://github.com/lwambisrat/devops-lab-engineering-lab/blob/main/api/server.js"
click node_metrics "https://github.com/lwambisrat/devops-lab-engineering-lab/blob/main/api/server.js"
click node_secrets "https://github.com/lwambisrat/devops-lab-engineering-lab/blob/main/api/secrets.js"
click node_dbfactory "https://github.com/lwambisrat/devops-lab-engineering-lab/blob/main/api/database.js"
click node_prometheus "https://github.com/lwambisrat/devops-lab-engineering-lab/blob/main/monitoring/prometheus.yml"
click node_grafana "https://github.com/lwambisrat/devops-lab-engineering-lab/tree/main/monitoring/grafana"
click node_seed "https://github.com/lwambisrat/devops-lab-engineering-lab/tree/main/data-seed"
click node_provision "https://github.com/lwambisrat/devops-lab-engineering-lab/tree/main/terraform"

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_tickets,node_load,node_journal,node_provision toneBlue
class node_server,node_patient,node_admissions,node_export,node_health,node_metrics,node_secrets toneAmber
class node_dbfactory,node_mysql,node_mongo,node_seed toneMint
class node_prometheus,node_grafana toneRose
class node_learner toneIndigo
```

## Components

### Incident Lab

- [Incident Queue](https://github.com/lwambisrat/devops-lab-engineering-lab/tree/main/incidents): `incidents`
- [Load Scenarios](https://github.com/lwambisrat/devops-lab-engineering-lab/tree/main/load-tests): `load-tests`
- [Investigation Journal](https://github.com/lwambisrat/devops-lab-engineering-lab/blob/main/LAB_JOURNAL.md): `LAB_JOURNAL.md`
- [Cloud Provisioning](https://github.com/lwambisrat/devops-lab-engineering-lab/tree/main/terraform): `terraform`

### Healthcare API

- [API Runtime](https://github.com/lwambisrat/devops-lab-engineering-lab/blob/main/api/server.js): `api/server.js`
- [Patient Queries](https://github.com/lwambisrat/devops-lab-engineering-lab/blob/main/api/server.js): `api/server.js`
- [Bed Admissions](https://github.com/lwambisrat/devops-lab-engineering-lab/blob/main/api/server.js): `api/server.js`
- [Patient Export](https://github.com/lwambisrat/devops-lab-engineering-lab/blob/main/api/server.js): `api/server.js`
- [Health and Readiness](https://github.com/lwambisrat/devops-lab-engineering-lab/blob/main/api/server.js): `api/server.js`
- [API Metrics](https://github.com/lwambisrat/devops-lab-engineering-lab/blob/main/api/server.js): `api/server.js`
- [Credential Loading](https://github.com/lwambisrat/devops-lab-engineering-lab/blob/main/api/secrets.js): `api/secrets.js`

### Data Services

- [Connection Factories](https://github.com/lwambisrat/devops-lab-engineering-lab/blob/main/api/database.js): `api/database.js`
- **MySQL Store**
- **Mongo Audit Store**
- [Data Seeding](https://github.com/lwambisrat/devops-lab-engineering-lab/tree/main/data-seed): `data-seed`

### Observability

- [Prometheus](https://github.com/lwambisrat/devops-lab-engineering-lab/blob/main/monitoring/prometheus.yml): `monitoring/prometheus.yml`
- [Grafana Dashboards](https://github.com/lwambisrat/devops-lab-engineering-lab/tree/main/monitoring/grafana): `monitoring/grafana`

### Other components

- **On-call Learner**

## Connections

- On-call Learner → Incident Queue: selects ticket (evidence: `README.md`)
- On-call Learner → Load Scenarios: runs scenario (evidence: `README.md`)
- Load Scenarios → API Runtime: sends traffic (evidence: `README.md`)
- On-call Learner → Investigation Journal: records findings (evidence: `README.md`)
- API Runtime → Credential Loading: loads credentials (evidence: `api/server.js`)
- API Runtime → Connection Factories: initializes connections (evidence: `api/server.js`)
- Patient Queries → MySQL Store: queries patients (evidence: `api/server.js`)
- Bed Admissions → MySQL Store: updates beds (evidence: `api/server.js`)
- Patient Export → MySQL Store: reads batches (evidence: `api/server.js`)
- Health and Readiness → Connection Factories: checks readiness (evidence: `api/server.js`)
- Connection Factories → MySQL Store: creates pool (evidence: `api/database.js`)
- Connection Factories → Mongo Audit Store: connects lazily (evidence: `api/database.js`)
- API Runtime → Mongo Audit Store: pings audit store (evidence: `api/server.js`)
- Prometheus → API Metrics: scrapes metrics (evidence: `README.md`)
- On-call Learner → Prometheus: investigates metrics (evidence: `README.md`)
- On-call Learner → Grafana Dashboards: reviews dashboards (evidence: `README.md`)
- On-call Learner → MySQL Store: inspects database (evidence: `README.md`)
