# jiyongham/prevnetion-tracker architecture

> Architecture diagram of the GitHub repository jiyongham/prevnetion-tracker, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-29). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/jiyongham/prevnetion-tracker
- Repository: https://github.com/jiyongham/prevnetion-tracker

## Overview

prevention-tracker is an internal FastAPI service for consolidating four infrastructure-prevention domains into dashboards, evidence-backed completion totals, and weekly Teams reports. Users review and edit target records; domain services combine spreadsheet targets, ticket/asset/CI evidence, and SQLite overrides, then expose reports, reminders, and exports. DR, capacity, EoS, and kernel patching retain distinct completion rules; kernel automation is documented as unfinished. README documents the major capabilities; source excerpts are partial, so uncertain route-to-service wiring is omitted.

Main entry points: [`app/services/eos_data.py`](https://github.com/jiyongham/prevnetion-tracker/blob/main/app/services/eos_data.py) (EoS evaluation), [`app/services/dr_data.py`](https://github.com/jiyongham/prevnetion-tracker/blob/main/app/services/dr_data.py) (DR evaluation), [`app/services/capacity.py`](https://github.com/jiyongham/prevnetion-tracker/blob/main/app/services/capacity.py) (Capacity evaluation), [`app/main.py`](https://github.com/jiyongham/prevnetion-tracker/blob/main/app/main.py) (FastAPI app)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web portal"]
  node_app["FastAPI app<br/>[main.py]"]
  node_dr_routes["DR routes<br/>[dr.py]"]
  node_capacity_routes["Capacity routes<br/>[capacity.py]"]
  node_eos_routes["EoS routes<br/>[eos.py]"]
  node_kernel_routes["Kernel routes<br/>[kernel.py]"]
end

subgraph group_domains["Domain processing"]
  node_dr["DR evaluation<br/>[dr_data.py]"]
  node_capacity["Capacity evaluation<br/>[capacity.py]"]
  node_eos["EoS evaluation<br/>[eos_data.py]"]
  node_kernel["Kernel tracking<br/>[kernel.py]"]
  node_matching["Ticket matching<br/>[matcher.py]"]
  node_ai["AI assistance<br/>[ai_diagnose.py]"]
end

subgraph group_integrations["Data integrations"]
  node_excel["Excel targets<br/>[excel_loader.py]"]
  node_jira["JIRA tickets<br/>[jira_client.py]"]
  node_insight["Insight assets<br/>[insight_client.py]"]
  node_polestar["Polestar CI<br/>[polestar_client.py]"]
  node_confluence["Confluence plans"]
  node_agent["Agent gateway<br/>[agent_client.py]"]
end

subgraph group_operations["Reporting and state"]
  node_sqlite[("SQLite records<br/>[db.py]")]
  node_reports["Report generation<br/>[report.py]"]
  node_reminders["Reminder drafting<br/>[reminder.py]"]
  node_scheduler["Job scheduler<br/>[scheduler.py]"]
  node_teams_client["Teams delivery<br/>[teams_client.py]"]
end

node_user(("Portal user"))
node_teams(("Microsoft Teams"))

node_user -->|"requests"| node_dr_routes
node_user -->|"requests"| node_capacity_routes
node_user -->|"requests"| node_eos_routes
node_user -->|"requests"| node_kernel_routes
node_app -->|"starts"| node_scheduler
node_app -->|"initializes"| node_sqlite
node_app -->|"prewarms"| node_dr
node_app -->|"prewarms"| node_capacity
node_app -->|"prewarms"| node_eos
node_dr_routes -->|"loads and evaluates"| node_dr
node_dr_routes -->|"reads and writes"| node_sqlite
node_dr_routes -->|"requests report"| node_reports
node_capacity_routes -->|"evaluates"| node_capacity
node_eos_routes -->|"evaluates"| node_eos
node_kernel_routes -->|"serves tracking"| node_kernel
node_dr -->|"loads targets"| node_excel
node_capacity -->|"loads targets"| node_excel
node_eos -->|"loads targets"| node_excel
node_dr -->|"gets tickets"| node_jira
node_capacity -->|"gets tickets"| node_jira
node_eos -->|"gets tickets"| node_jira
node_dr -->|"gets asset evidence"| node_insight
node_eos -->|"gets asset evidence"| node_insight
node_capacity -->|"matches tickets"| node_matching
node_dr -->|"matches tickets"| node_matching
node_eos -->|"matches tickets"| node_matching
node_eos -->|"checks CI state"| node_polestar
node_eos -->|"loads plans"| node_confluence
node_eos -->|"records observations"| node_sqlite
node_capacity -->|"reads overrides"| node_sqlite
node_dr -->|"reads overrides"| node_sqlite
node_ai -.->|"requests interpretation"| node_agent
node_dr_routes -.->|"diagnoses unmatched"| node_ai
node_reports -->|"stores snapshots"| node_sqlite
node_scheduler -->|"dispatches scheduled reports"| node_reports
node_scheduler -->|"dispatches reminders"| node_reminders
node_reminders -->|"sends drafts"| node_teams_client
node_reports -->|"sends reports"| node_teams_client
node_teams_client -->|"posts messages"| node_teams

click node_app "https://github.com/jiyongham/prevnetion-tracker/blob/main/app/main.py"
click node_dr_routes "https://github.com/jiyongham/prevnetion-tracker/blob/main/app/web/routes/dr.py"
click node_capacity_routes "https://github.com/jiyongham/prevnetion-tracker/blob/main/app/web/routes/capacity.py"
click node_eos_routes "https://github.com/jiyongham/prevnetion-tracker/blob/main/app/web/routes/eos.py"
click node_kernel_routes "https://github.com/jiyongham/prevnetion-tracker/blob/main/app/web/routes/kernel.py"
click node_dr "https://github.com/jiyongham/prevnetion-tracker/blob/main/app/services/dr_data.py"
click node_capacity "https://github.com/jiyongham/prevnetion-tracker/blob/main/app/services/capacity.py"
click node_eos "https://github.com/jiyongham/prevnetion-tracker/blob/main/app/services/eos_data.py"
click node_kernel "https://github.com/jiyongham/prevnetion-tracker/blob/main/app/services/kernel.py"
click node_matching "https://github.com/jiyongham/prevnetion-tracker/blob/main/app/services/matcher.py"
click node_ai "https://github.com/jiyongham/prevnetion-tracker/blob/main/app/services/ai_diagnose.py"
click node_excel "https://github.com/jiyongham/prevnetion-tracker/blob/main/app/core/excel_loader.py"
click node_jira "https://github.com/jiyongham/prevnetion-tracker/blob/main/app/core/jira_client.py"
click node_insight "https://github.com/jiyongham/prevnetion-tracker/blob/main/app/core/insight_client.py"
click node_polestar "https://github.com/jiyongham/prevnetion-tracker/blob/main/app/core/polestar_client.py"
click node_confluence "https://github.com/jiyongham/prevnetion-tracker/blob/main/app/core/confluence_client.py"
click node_agent "https://github.com/jiyongham/prevnetion-tracker/blob/main/app/core/agent_client.py"
click node_sqlite "https://github.com/jiyongham/prevnetion-tracker/blob/main/app/models/db.py"
click node_reports "https://github.com/jiyongham/prevnetion-tracker/blob/main/app/services/report.py"
click node_reminders "https://github.com/jiyongham/prevnetion-tracker/blob/main/app/services/reminder.py"
click node_scheduler "https://github.com/jiyongham/prevnetion-tracker/blob/main/app/core/scheduler.py"
click node_teams_client "https://github.com/jiyongham/prevnetion-tracker/blob/main/app/core/teams_client.py"

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_app,node_dr_routes,node_capacity_routes,node_eos_routes,node_kernel_routes,node_user toneBlue
class node_dr,node_capacity,node_eos,node_kernel,node_matching,node_ai toneAmber
class node_excel,node_jira,node_insight,node_polestar,node_confluence,node_agent toneMint
class node_sqlite,node_reports,node_reminders,node_scheduler,node_teams_client toneRose
class node_teams toneIndigo
```

## Components

### Web portal

- [FastAPI app](https://github.com/jiyongham/prevnetion-tracker/blob/main/app/main.py): `app/main.py`
- [DR routes](https://github.com/jiyongham/prevnetion-tracker/blob/main/app/web/routes/dr.py): `app/web/routes/dr.py`
- [Capacity routes](https://github.com/jiyongham/prevnetion-tracker/blob/main/app/web/routes/capacity.py): `app/web/routes/capacity.py`
- [EoS routes](https://github.com/jiyongham/prevnetion-tracker/blob/main/app/web/routes/eos.py): `app/web/routes/eos.py`
- [Kernel routes](https://github.com/jiyongham/prevnetion-tracker/blob/main/app/web/routes/kernel.py): `app/web/routes/kernel.py`

### Domain processing

- [DR evaluation](https://github.com/jiyongham/prevnetion-tracker/blob/main/app/services/dr_data.py): `app/services/dr_data.py`
- [Capacity evaluation](https://github.com/jiyongham/prevnetion-tracker/blob/main/app/services/capacity.py): `app/services/capacity.py`
- [EoS evaluation](https://github.com/jiyongham/prevnetion-tracker/blob/main/app/services/eos_data.py): `app/services/eos_data.py`
- [Kernel tracking](https://github.com/jiyongham/prevnetion-tracker/blob/main/app/services/kernel.py): `app/services/kernel.py`
- [Ticket matching](https://github.com/jiyongham/prevnetion-tracker/blob/main/app/services/matcher.py): `app/services/matcher.py`
- [AI assistance](https://github.com/jiyongham/prevnetion-tracker/blob/main/app/services/ai_diagnose.py): `app/services/ai_diagnose.py`

### Data integrations

- [Excel targets](https://github.com/jiyongham/prevnetion-tracker/blob/main/app/core/excel_loader.py): `app/core/excel_loader.py`
- [JIRA tickets](https://github.com/jiyongham/prevnetion-tracker/blob/main/app/core/jira_client.py): `app/core/jira_client.py`
- [Insight assets](https://github.com/jiyongham/prevnetion-tracker/blob/main/app/core/insight_client.py): `app/core/insight_client.py`
- [Polestar CI](https://github.com/jiyongham/prevnetion-tracker/blob/main/app/core/polestar_client.py): `app/core/polestar_client.py`
- [Confluence plans](https://github.com/jiyongham/prevnetion-tracker/blob/main/app/core/confluence_client.py): `app/core/confluence_client.py`
- [Agent gateway](https://github.com/jiyongham/prevnetion-tracker/blob/main/app/core/agent_client.py): `app/core/agent_client.py`

### Reporting and state

- [SQLite records](https://github.com/jiyongham/prevnetion-tracker/blob/main/app/models/db.py): `app/models/db.py`
- [Report generation](https://github.com/jiyongham/prevnetion-tracker/blob/main/app/services/report.py): `app/services/report.py`
- [Reminder drafting](https://github.com/jiyongham/prevnetion-tracker/blob/main/app/services/reminder.py): `app/services/reminder.py`
- [Job scheduler](https://github.com/jiyongham/prevnetion-tracker/blob/main/app/core/scheduler.py): `app/core/scheduler.py`
- [Teams delivery](https://github.com/jiyongham/prevnetion-tracker/blob/main/app/core/teams_client.py): `app/core/teams_client.py`

### Other components

- **Portal user**
- **Microsoft Teams**

## Connections

- Portal user → DR routes: requests
- Portal user → Capacity routes: requests
- Portal user → EoS routes: requests
- Portal user → Kernel routes: requests
- FastAPI app → Job scheduler: starts
- FastAPI app → SQLite records: initializes
- FastAPI app → DR evaluation: prewarms
- FastAPI app → Capacity evaluation: prewarms
- FastAPI app → EoS evaluation: prewarms
- DR routes → DR evaluation: loads and evaluates
- DR routes → SQLite records: reads and writes
- DR routes → Report generation: requests report
- Capacity routes → Capacity evaluation: evaluates
- EoS routes → EoS evaluation: evaluates
- Kernel routes → Kernel tracking: serves tracking
- DR evaluation → Excel targets: loads targets
- Capacity evaluation → Excel targets: loads targets
- EoS evaluation → Excel targets: loads targets
- DR evaluation → JIRA tickets: gets tickets
- Capacity evaluation → JIRA tickets: gets tickets
- EoS evaluation → JIRA tickets: gets tickets
- DR evaluation → Insight assets: gets asset evidence
- EoS evaluation → Insight assets: gets asset evidence
- Capacity evaluation → Ticket matching: matches tickets
- DR evaluation → Ticket matching: matches tickets
- EoS evaluation → Ticket matching: matches tickets
- EoS evaluation → Polestar CI: checks CI state
- EoS evaluation → Confluence plans: loads plans
- EoS evaluation → SQLite records: records observations
- Capacity evaluation → SQLite records: reads overrides
- DR evaluation → SQLite records: reads overrides
- AI assistance → Agent gateway: requests interpretation
- DR routes → AI assistance: diagnoses unmatched
- Report generation → SQLite records: stores snapshots
- Job scheduler → Report generation: dispatches scheduled reports
- Job scheduler → Reminder drafting: dispatches reminders
- Reminder drafting → Teams delivery: sends drafts
- Report generation → Teams delivery: sends reports
- Teams delivery → Microsoft Teams: posts messages
