# shalusindhu637-ctrl/self-healing-network architecture

> Architecture diagram of the GitHub repository shalusindhu637-ctrl/self-healing-network, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-05). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/shalusindhu637-ctrl/self-healing-network
- Repository: https://github.com/shalusindhu637-ctrl/self-healing-network

## Overview

Self-Healing Network is a Flask-based network-health simulator and monitoring system. Users operate a browser dashboard to inspect topology and health, simulate or restore host and link failures, and trigger or configure recovery. The Flask application routes these actions to the detector, topology, and recovery logic; those components record operational state and events in SQLite. The README also identifies real-time dashboard monitoring as a product capability. Edges reflect shown calls and documented dashboard/API use; unsampled route details are not expanded.

Main entry points: [`SelfHealingNetwork/app.py`](https://github.com/shalusindhu637-ctrl/self-healing-network/blob/main/SelfHealingNetwork/app.py) (Flask API), [`SelfHealingNetwork/database.py`](https://github.com/shalusindhu637-ctrl/self-healing-network/blob/main/SelfHealingNetwork/database.py) (Data Access), [`SelfHealingNetwork/static/js/dashboard.js`](https://github.com/shalusindhu637-ctrl/self-healing-network/blob/main/SelfHealingNetwork/static/js/dashboard.js) (Web Dashboard), [`SelfHealingNetwork/network_topology.py`](https://github.com/shalusindhu637-ctrl/self-healing-network/blob/main/SelfHealingNetwork/network_topology.py) (Topology Manager)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_presentation["Dashboard"]
  node_dashboard["Web Dashboard<br/>[dashboard.js]"]
  node_page["Dashboard Page<br/>[index.html]"]
  node_styles["Dashboard Styles<br/>[style.css]"]
end

subgraph group_service["Web API"]
  node_flask["Flask API<br/>[app.py]"]
end

subgraph group_network["Network Operations"]
  node_detector["Failure Detector"]
  node_topology["Topology Manager"]
  node_recovery["Recovery Manager"]
end

subgraph group_storage["Persistence"]
  node_dbconfig["Database Config<br/>[db_config.py]"]
  node_database["Data Access<br/>[database.py]"]
  node_sqlite[("SQLite Store<br/>[database.py]")]
end

node_operator(("Operator"))

node_operator -->|"uses"| node_dashboard
node_page -.->|"loads"| node_dashboard
node_page -.->|"styles with"| node_styles
node_dashboard -->|"requests API"| node_flask
node_flask -.->|"serves dashboard"| node_dashboard
node_flask -->|"controls detection"| node_detector
node_flask -->|"serves topology"| node_topology
node_flask -.->|"triggers recovery"| node_recovery
node_detector -->|"updates failures"| node_topology
node_detector -->|"logs failures"| node_database
node_topology -->|"persists topology"| node_database
node_recovery -->|"checks routes"| node_topology
node_recovery -->|"logs outcomes"| node_database
node_database -->|"gets path"| node_dbconfig
node_database -->|"reads and writes"| node_sqlite
node_flask -.->|"queries records"| node_database

click node_dashboard "https://github.com/shalusindhu637-ctrl/self-healing-network/blob/main/SelfHealingNetwork/static/js/dashboard.js"
click node_page "https://github.com/shalusindhu637-ctrl/self-healing-network/blob/main/SelfHealingNetwork/templates/index.html"
click node_styles "https://github.com/shalusindhu637-ctrl/self-healing-network/blob/main/SelfHealingNetwork/static/css/style.css"
click node_flask "https://github.com/shalusindhu637-ctrl/self-healing-network/blob/main/SelfHealingNetwork/app.py"
click node_detector "https://github.com/shalusindhu637-ctrl/self-healing-network/blob/main/SelfHealingNetwork/failure_detector.py"
click node_topology "https://github.com/shalusindhu637-ctrl/self-healing-network/blob/main/SelfHealingNetwork/network_topology.py"
click node_recovery "https://github.com/shalusindhu637-ctrl/self-healing-network/blob/main/SelfHealingNetwork/recovery_manager.py"
click node_dbconfig "https://github.com/shalusindhu637-ctrl/self-healing-network/blob/main/SelfHealingNetwork/db_config.py"
click node_database "https://github.com/shalusindhu637-ctrl/self-healing-network/blob/main/SelfHealingNetwork/database.py"
click node_sqlite "https://github.com/shalusindhu637-ctrl/self-healing-network/blob/main/SelfHealingNetwork/database.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_dashboard,node_page,node_styles toneBlue
class node_flask toneAmber
class node_detector,node_topology,node_recovery toneMint
class node_dbconfig,node_database,node_sqlite toneRose
class node_operator toneIndigo
```

## Components

### Dashboard

- [Web Dashboard](https://github.com/shalusindhu637-ctrl/self-healing-network/blob/main/SelfHealingNetwork/static/js/dashboard.js): `SelfHealingNetwork/static/js/dashboard.js`
- [Dashboard Page](https://github.com/shalusindhu637-ctrl/self-healing-network/blob/main/SelfHealingNetwork/templates/index.html): `SelfHealingNetwork/templates/index.html`
- [Dashboard Styles](https://github.com/shalusindhu637-ctrl/self-healing-network/blob/main/SelfHealingNetwork/static/css/style.css): `SelfHealingNetwork/static/css/style.css`

### Web API

- [Flask API](https://github.com/shalusindhu637-ctrl/self-healing-network/blob/main/SelfHealingNetwork/app.py): `SelfHealingNetwork/app.py`

### Network Operations

- [Failure Detector](https://github.com/shalusindhu637-ctrl/self-healing-network/blob/main/SelfHealingNetwork/failure_detector.py): `SelfHealingNetwork/failure_detector.py`
- [Topology Manager](https://github.com/shalusindhu637-ctrl/self-healing-network/blob/main/SelfHealingNetwork/network_topology.py): `SelfHealingNetwork/network_topology.py`
- [Recovery Manager](https://github.com/shalusindhu637-ctrl/self-healing-network/blob/main/SelfHealingNetwork/recovery_manager.py): `SelfHealingNetwork/recovery_manager.py`

### Persistence

- [Database Config](https://github.com/shalusindhu637-ctrl/self-healing-network/blob/main/SelfHealingNetwork/db_config.py): `SelfHealingNetwork/db_config.py`
- [Data Access](https://github.com/shalusindhu637-ctrl/self-healing-network/blob/main/SelfHealingNetwork/database.py): `SelfHealingNetwork/database.py`
- [SQLite Store](https://github.com/shalusindhu637-ctrl/self-healing-network/blob/main/SelfHealingNetwork/database.py): `SelfHealingNetwork/database.py`

### Other components

- **Operator**

## Connections

- Operator → Web Dashboard: uses (evidence: `README.md`)
- Dashboard Page → Web Dashboard: loads
- Dashboard Page → Dashboard Styles: styles with
- Web Dashboard → Flask API: requests API (evidence: `SelfHealingNetwork/static/js/dashboard.js`)
- Flask API → Web Dashboard: serves dashboard
- Flask API → Failure Detector: controls detection (evidence: `SelfHealingNetwork/app.py`)
- Flask API → Topology Manager: serves topology (evidence: `SelfHealingNetwork/app.py`)
- Flask API → Recovery Manager: triggers recovery (evidence: `SelfHealingNetwork/app.py`)
- Failure Detector → Topology Manager: updates failures (evidence: `SelfHealingNetwork/failure_detector.py`)
- Failure Detector → Data Access: logs failures (evidence: `SelfHealingNetwork/failure_detector.py`)
- Topology Manager → Data Access: persists topology (evidence: `SelfHealingNetwork/network_topology.py`)
- Recovery Manager → Topology Manager: checks routes (evidence: `SelfHealingNetwork/recovery_manager.py`)
- Recovery Manager → Data Access: logs outcomes (evidence: `SelfHealingNetwork/recovery_manager.py`)
- Data Access → Database Config: gets path (evidence: `SelfHealingNetwork/database.py`)
- Data Access → SQLite Store: reads and writes (evidence: `SelfHealingNetwork/database.py`)
- Flask API → Data Access: queries records (evidence: `SelfHealingNetwork/app.py`)
