# bals24/p08-aegis-monitor architecture

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

- Interactive diagram: https://gitdiagram.com/bals24/p08-aegis-monitor
- Repository: https://github.com/bals24/p08-aegis-monitor

## Overview

Aegis Monitor is a web observability system: users view a public status page or administer monitoring through Grafana and the FastAPI backend. The backend runs periodic HTTP checks, exposes status and Prometheus metrics, and the documented monitoring stack visualizes metrics and routes alerts back to the API; a local Ollama integration provides incident diagnosis. The tree shows the HTTP probe implementation and API lifecycle, while several integrations and product capabilities are documented but their implementation is not sampled.

Main entry points: [`backend/app/main.py`](https://github.com/bals24/p08-aegis-monitor/blob/main/backend/app/main.py) (FastAPI Backend), [`backend/app/probes/monitor.py`](https://github.com/bals24/p08-aegis-monitor/blob/main/backend/app/probes/monitor.py) (HTTP Probe Engine), [`prometheus/prometheus.yml`](https://github.com/bals24/p08-aegis-monitor/blob/main/prometheus/prometheus.yml) (Prometheus), [`prometheus/alertmanager.yml`](https://github.com/bals24/p08-aegis-monitor/blob/main/prometheus/alertmanager.yml) (Alertmanager)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_backend["Backend Monitoring"]
  node_api["FastAPI Backend<br/>[main.py]"]
  node_probe["HTTP Probe Engine<br/>[monitor.py]"]
  node_settings["Service Settings<br/>[config.py]"]
end

subgraph group_observability["Metrics And Alerts"]
  node_metrics[("Prometheus<br/>[prometheus.yml]")]
  node_alerts["Alertmanager<br/>[alertmanager.yml]"]
  node_rules["Alert Rules<br/>[alerts.yml]"]
end

subgraph group_interfaces["User Interfaces"]
  node_status["Public Status PWA<br/>[index.html]"]
  node_grafana["Grafana Dashboards"]
end

subgraph group_integrations["External Services"]
  node_targets(("Monitored Sites"))
  node_ollama["Ollama LLM"]
  node_keycloak["Keycloak<br/>[realm-export.json]"]
end

node_user(("User"))

node_user -->|"views status"| node_status
node_user -->|"administers monitoring"| node_grafana
node_user -->|"queries API"| node_api
node_api -->|"starts monitor"| node_probe
node_api -->|"reads status"| node_probe
node_probe -->|"checks availability"| node_targets
node_probe -->|"exposes metrics"| node_metrics
node_metrics -->|"routes DOWN alerts"| node_alerts
node_alerts -->|"sends webhook"| node_api
node_metrics -->|"feeds visualization"| node_grafana
node_api -->|"requests diagnosis"| node_ollama
node_ollama -->|"returns RCA"| node_api

click node_api "https://github.com/bals24/p08-aegis-monitor/blob/main/backend/app/main.py"
click node_probe "https://github.com/bals24/p08-aegis-monitor/blob/main/backend/app/probes/monitor.py"
click node_settings "https://github.com/bals24/p08-aegis-monitor/blob/main/backend/app/core/config.py"
click node_status "https://github.com/bals24/p08-aegis-monitor/blob/main/frontend-status/index.html"
click node_grafana "https://github.com/bals24/p08-aegis-monitor/blob/main/grafana/dashboards/aegis-overview.json"
click node_metrics "https://github.com/bals24/p08-aegis-monitor/blob/main/prometheus/prometheus.yml"
click node_alerts "https://github.com/bals24/p08-aegis-monitor/blob/main/prometheus/alertmanager.yml"
click node_rules "https://github.com/bals24/p08-aegis-monitor/blob/main/prometheus/rules/alerts.yml"
click node_keycloak "https://github.com/bals24/p08-aegis-monitor/blob/main/keycloak/realm-export.json"

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_api,node_probe,node_settings,node_user toneBlue
class node_metrics,node_alerts,node_rules toneAmber
class node_status,node_grafana toneMint
class node_targets,node_ollama,node_keycloak toneRose
```

## Components

### Backend Monitoring

- [FastAPI Backend](https://github.com/bals24/p08-aegis-monitor/blob/main/backend/app/main.py): `backend/app/main.py`
- [HTTP Probe Engine](https://github.com/bals24/p08-aegis-monitor/blob/main/backend/app/probes/monitor.py): `backend/app/probes/monitor.py`
- [Service Settings](https://github.com/bals24/p08-aegis-monitor/blob/main/backend/app/core/config.py): `backend/app/core/config.py`

### Metrics And Alerts

- [Prometheus](https://github.com/bals24/p08-aegis-monitor/blob/main/prometheus/prometheus.yml): `prometheus/prometheus.yml`
- [Alertmanager](https://github.com/bals24/p08-aegis-monitor/blob/main/prometheus/alertmanager.yml): `prometheus/alertmanager.yml`
- [Alert Rules](https://github.com/bals24/p08-aegis-monitor/blob/main/prometheus/rules/alerts.yml): `prometheus/rules/alerts.yml`

### User Interfaces

- [Public Status PWA](https://github.com/bals24/p08-aegis-monitor/blob/main/frontend-status/index.html): `frontend-status/index.html`
- [Grafana Dashboards](https://github.com/bals24/p08-aegis-monitor/blob/main/grafana/dashboards/aegis-overview.json): `grafana/dashboards/aegis-overview.json`

### External Services

- **Monitored Sites**
- **Ollama LLM**
- [Keycloak](https://github.com/bals24/p08-aegis-monitor/blob/main/keycloak/realm-export.json): `keycloak/realm-export.json`

### Other components

- **User**

## Connections

- User → Public Status PWA: views status (evidence: `README.md`)
- User → Grafana Dashboards: administers monitoring (evidence: `README.md`)
- User → FastAPI Backend: queries API (evidence: `README.md`)
- FastAPI Backend → HTTP Probe Engine: starts monitor (evidence: `backend/app/main.py`)
- FastAPI Backend → HTTP Probe Engine: reads status (evidence: `backend/app/main.py`)
- HTTP Probe Engine → Monitored Sites: checks availability (evidence: `README.md`)
- HTTP Probe Engine → Prometheus: exposes metrics (evidence: `README.md`)
- Prometheus → Alertmanager: routes DOWN alerts (evidence: `README.md`)
- Alertmanager → FastAPI Backend: sends webhook (evidence: `README.md`)
- Prometheus → Grafana Dashboards: feeds visualization (evidence: `README.md`)
- FastAPI Backend → Ollama LLM: requests diagnosis (evidence: `README.md`)
- Ollama LLM → FastAPI Backend: returns RCA (evidence: `README.md`)
