# vanbrown99/aitm-sentinel architecture

> Architecture diagram of the GitHub repository vanbrown99/aitm-sentinel, 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/vanbrown99/aitm-sentinel
- Repository: https://github.com/vanbrown99/aitm-sentinel

## Overview

AiTM Sentinel combines browser-origin telemetry, PCAP/Zeek network metadata, explainable detection and synthetic-data ML, then presents alerts and investigations through a dashboard and extension. The main server registers API routers; sampled detection code shows event correlation and rule evaluation. The graph preserves README-documented product branches, but several route-to-service links and unsampled subsystems are not evidenced in excerpts, so those connections are omitted.

Main entry points: [`extension/src/lib/pipeline.js`](https://github.com/vanbrown99/aitm-sentinel/blob/main/extension/src/lib/pipeline.js) (Page analysis pipeline), [`backend/app/services/detection_service.py`](https://github.com/vanbrown99/aitm-sentinel/blob/main/backend/app/services/detection_service.py) (Detection orchestration), [`frontend/js/main.js`](https://github.com/vanbrown99/aitm-sentinel/blob/main/frontend/js/main.js) (Dashboard shell), [`backend/app/services/auth_service.py`](https://github.com/vanbrown99/aitm-sentinel/blob/main/backend/app/services/auth_service.py) (Authentication service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_server["Backend platform"]
  node_server_app["Application server<br/>[main.py]"]
  node_api_routes["API routers"]
  node_auth_api["Authentication API<br/>[auth.py]"]
  node_auth_service["Authentication service<br/>[auth_service.py]"]
  node_security["Security controls<br/>[security.py]"]
  node_database[("Application database")]
  node_event_services["Event and alert services"]
  node_realtime["Live updates<br/>[realtime.py]"]
end

subgraph group_analysis["Detection and analysis"]
  node_detection_service["Detection orchestration"]
  node_rule_engine["Explainable rule engine<br/>[engine.py]"]
  node_domain_analysis["Domain intelligence<br/>[domain_analysis.py]"]
  node_network_analysis["PCAP and Zeek analysis"]
  node_ml_pipeline["Synthetic ML pipeline<br/>[pipeline.py]"]
  node_ml_serving["ML prediction and registry<br/>[predictor.py]"]
  node_lab["Simulation laboratory"]
end

subgraph group_dashboard["Analyst dashboard"]
  node_dashboard_shell["Dashboard shell<br/>[main.js]"]
  node_dashboard_pages["Analyst pages"]
  node_dashboard_api["Dashboard API client<br/>[api.js]"]
end

subgraph group_extension["Browser extension"]
  node_extension_background["Extension background<br/>[background.js]"]
  node_extension_pipeline["Page analysis pipeline<br/>[pipeline.js]"]
  node_extension_chain["Redirect-chain snapshot<br/>[chain.js]"]
  node_extension_checks["Local origin checks<br/>[localCheck.js]"]
  node_extension_api["Backend client<br/>[api.js]"]
  node_extension_warning["Warning presentation<br/>[warning.js]"]
end

node_analyst(("Analyst"))
node_browser_user(("Browser user"))

node_server_app -->|"registers"| node_api_routes
node_server_app -->|"starts live service"| node_realtime
node_auth_api -->|"calls"| node_auth_service
node_auth_service -->|"hashes passwords"| node_security
node_auth_service -->|"reads and writes users"| node_database
node_detection_service -->|"loads and persists events"| node_database
node_detection_service -->|"evaluates evidence"| node_rule_engine
node_rule_engine -->|"analyzes hosts"| node_domain_analysis
node_network_analysis -->|"submits observations"| node_detection_service
node_detection_service -->|"requests prediction"| node_ml_serving
node_ml_pipeline -->|"scores scenarios"| node_rule_engine
node_dashboard_shell -->|"loads pages"| node_dashboard_pages
node_dashboard_shell -->|"creates client"| node_dashboard_api
node_extension_background -->|"runs analysis"| node_extension_pipeline
node_extension_pipeline -->|"snapshots redirects"| node_extension_chain
node_extension_pipeline -->|"checks locally"| node_extension_checks
node_extension_pipeline -->|"submits browser data"| node_extension_api
node_extension_warning -->|"shows warning"| node_browser_user
node_analyst -.->|"uses dashboard"| node_dashboard_shell
node_browser_user -.->|"browses with"| node_extension_background
node_lab -.->|"stores simulated events"| node_database
node_realtime -.->|"pushes live updates"| node_dashboard_shell

click node_server_app "https://github.com/vanbrown99/aitm-sentinel/blob/main/backend/app/main.py"
click node_api_routes "https://github.com/vanbrown99/aitm-sentinel/tree/main/backend/app/api/routes"
click node_auth_api "https://github.com/vanbrown99/aitm-sentinel/blob/main/backend/app/api/routes/auth.py"
click node_auth_service "https://github.com/vanbrown99/aitm-sentinel/blob/main/backend/app/services/auth_service.py"
click node_security "https://github.com/vanbrown99/aitm-sentinel/blob/main/backend/app/core/security.py"
click node_database "https://github.com/vanbrown99/aitm-sentinel/tree/main/backend/app/models"
click node_event_services "https://github.com/vanbrown99/aitm-sentinel/tree/main/backend/app/services"
click node_detection_service "https://github.com/vanbrown99/aitm-sentinel/blob/main/backend/app/services/detection_service.py"
click node_rule_engine "https://github.com/vanbrown99/aitm-sentinel/blob/main/backend/app/detection/engine.py"
click node_domain_analysis "https://github.com/vanbrown99/aitm-sentinel/blob/main/backend/app/detection/domain_analysis.py"
click node_network_analysis "https://github.com/vanbrown99/aitm-sentinel/tree/main/backend/app/network"
click node_ml_pipeline "https://github.com/vanbrown99/aitm-sentinel/blob/main/backend/app/ml/pipeline.py"
click node_ml_serving "https://github.com/vanbrown99/aitm-sentinel/blob/main/backend/app/ml/predictor.py"
click node_lab "https://github.com/vanbrown99/aitm-sentinel/tree/main/backend/app/lab"
click node_realtime "https://github.com/vanbrown99/aitm-sentinel/blob/main/backend/app/services/realtime.py"
click node_dashboard_shell "https://github.com/vanbrown99/aitm-sentinel/blob/main/frontend/js/main.js"
click node_dashboard_pages "https://github.com/vanbrown99/aitm-sentinel/tree/main/frontend/js/pages"
click node_dashboard_api "https://github.com/vanbrown99/aitm-sentinel/blob/main/frontend/js/lib/api.js"
click node_extension_background "https://github.com/vanbrown99/aitm-sentinel/blob/main/extension/src/background.js"
click node_extension_pipeline "https://github.com/vanbrown99/aitm-sentinel/blob/main/extension/src/lib/pipeline.js"
click node_extension_chain "https://github.com/vanbrown99/aitm-sentinel/blob/main/extension/src/lib/chain.js"
click node_extension_checks "https://github.com/vanbrown99/aitm-sentinel/blob/main/extension/src/lib/localCheck.js"
click node_extension_api "https://github.com/vanbrown99/aitm-sentinel/blob/main/extension/src/lib/api.js"
click node_extension_warning "https://github.com/vanbrown99/aitm-sentinel/blob/main/extension/src/warning.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_server_app,node_api_routes,node_auth_api,node_auth_service,node_security,node_database,node_event_services,node_realtime,node_browser_user toneBlue
class node_detection_service,node_rule_engine,node_domain_analysis,node_network_analysis,node_ml_pipeline,node_ml_serving,node_lab toneAmber
class node_dashboard_shell,node_dashboard_pages,node_dashboard_api toneMint
class node_extension_background,node_extension_pipeline,node_extension_chain,node_extension_checks,node_extension_api,node_extension_warning toneRose
class node_analyst toneIndigo
```

## Components

### Backend platform

- [Application server](https://github.com/vanbrown99/aitm-sentinel/blob/main/backend/app/main.py): `backend/app/main.py`
- [API routers](https://github.com/vanbrown99/aitm-sentinel/tree/main/backend/app/api/routes): `backend/app/api/routes`
- [Authentication API](https://github.com/vanbrown99/aitm-sentinel/blob/main/backend/app/api/routes/auth.py): `backend/app/api/routes/auth.py`
- [Authentication service](https://github.com/vanbrown99/aitm-sentinel/blob/main/backend/app/services/auth_service.py): `backend/app/services/auth_service.py`
- [Security controls](https://github.com/vanbrown99/aitm-sentinel/blob/main/backend/app/core/security.py): `backend/app/core/security.py`
- [Application database](https://github.com/vanbrown99/aitm-sentinel/tree/main/backend/app/models): `backend/app/models`
- [Event and alert services](https://github.com/vanbrown99/aitm-sentinel/tree/main/backend/app/services): `backend/app/services`
- [Live updates](https://github.com/vanbrown99/aitm-sentinel/blob/main/backend/app/services/realtime.py): `backend/app/services/realtime.py`

### Detection and analysis

- [Detection orchestration](https://github.com/vanbrown99/aitm-sentinel/blob/main/backend/app/services/detection_service.py): `backend/app/services/detection_service.py`
- [Explainable rule engine](https://github.com/vanbrown99/aitm-sentinel/blob/main/backend/app/detection/engine.py): `backend/app/detection/engine.py`
- [Domain intelligence](https://github.com/vanbrown99/aitm-sentinel/blob/main/backend/app/detection/domain_analysis.py): `backend/app/detection/domain_analysis.py`
- [PCAP and Zeek analysis](https://github.com/vanbrown99/aitm-sentinel/tree/main/backend/app/network): `backend/app/network`
- [Synthetic ML pipeline](https://github.com/vanbrown99/aitm-sentinel/blob/main/backend/app/ml/pipeline.py): `backend/app/ml/pipeline.py`
- [ML prediction and registry](https://github.com/vanbrown99/aitm-sentinel/blob/main/backend/app/ml/predictor.py): `backend/app/ml/predictor.py`
- [Simulation laboratory](https://github.com/vanbrown99/aitm-sentinel/tree/main/backend/app/lab): `backend/app/lab`

### Analyst dashboard

- [Dashboard shell](https://github.com/vanbrown99/aitm-sentinel/blob/main/frontend/js/main.js): `frontend/js/main.js`
- [Analyst pages](https://github.com/vanbrown99/aitm-sentinel/tree/main/frontend/js/pages): `frontend/js/pages`
- [Dashboard API client](https://github.com/vanbrown99/aitm-sentinel/blob/main/frontend/js/lib/api.js): `frontend/js/lib/api.js`

### Browser extension

- [Extension background](https://github.com/vanbrown99/aitm-sentinel/blob/main/extension/src/background.js): `extension/src/background.js`
- [Page analysis pipeline](https://github.com/vanbrown99/aitm-sentinel/blob/main/extension/src/lib/pipeline.js): `extension/src/lib/pipeline.js`
- [Redirect-chain snapshot](https://github.com/vanbrown99/aitm-sentinel/blob/main/extension/src/lib/chain.js): `extension/src/lib/chain.js`
- [Local origin checks](https://github.com/vanbrown99/aitm-sentinel/blob/main/extension/src/lib/localCheck.js): `extension/src/lib/localCheck.js`
- [Backend client](https://github.com/vanbrown99/aitm-sentinel/blob/main/extension/src/lib/api.js): `extension/src/lib/api.js`
- [Warning presentation](https://github.com/vanbrown99/aitm-sentinel/blob/main/extension/src/warning.js): `extension/src/warning.js`

### Other components

- **Analyst**
- **Browser user**

## Connections

- Application server → API routers: registers (evidence: `backend/app/main.py`)
- Application server → Live updates: starts live service (evidence: `backend/app/main.py`)
- Authentication API → Authentication service: calls (evidence: `backend/app/api/routes/auth.py`)
- Authentication service → Security controls: hashes passwords (evidence: `backend/app/services/auth_service.py`)
- Authentication service → Application database: reads and writes users (evidence: `backend/app/services/auth_service.py`)
- Detection orchestration → Application database: loads and persists events (evidence: `backend/app/services/detection_service.py`)
- Detection orchestration → Explainable rule engine: evaluates evidence (evidence: `backend/app/services/detection_service.py`)
- Explainable rule engine → Domain intelligence: analyzes hosts (evidence: `backend/app/detection/engine.py`)
- PCAP and Zeek analysis → Detection orchestration: submits observations (evidence: `backend/app/services/network_service.py`)
- Detection orchestration → ML prediction and registry: requests prediction (evidence: `backend/app/services/detection_service.py`)
- Synthetic ML pipeline → Explainable rule engine: scores scenarios (evidence: `backend/app/ml/pipeline.py`)
- Dashboard shell → Analyst pages: loads pages (evidence: `frontend/js/main.js`)
- Dashboard shell → Dashboard API client: creates client (evidence: `frontend/js/main.js`)
- Extension background → Page analysis pipeline: runs analysis (evidence: `extension/src/background.js`)
- Page analysis pipeline → Redirect-chain snapshot: snapshots redirects (evidence: `extension/src/lib/pipeline.js`)
- Page analysis pipeline → Local origin checks: checks locally (evidence: `extension/src/lib/pipeline.js`)
- Page analysis pipeline → Backend client: submits browser data (evidence: `extension/src/lib/pipeline.js`)
- Warning presentation → Browser user: shows warning (evidence: `extension/src/warning.js`)
- Analyst → Dashboard shell: uses dashboard (evidence: `README.md`)
- Browser user → Extension background: browses with (evidence: `README.md`)
- Simulation laboratory → Application database: stores simulated events (evidence: `README.md`)
- Live updates → Dashboard shell: pushes live updates (evidence: `README.md`)
