# jivi001/network-analyzer architecture

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

- Interactive diagram: https://gitdiagram.com/jivi001/network-analyzer
- Repository: https://github.com/jivi001/network-analyzer

## Overview

my-sentinel is a terminal network-monitoring and security-analysis tool. Users choose live capture, Nmap scanning, or offline PCAP analysis; packet data is decoded, summarized and checked for threats, then presented and persisted for audit or export. The graph preserves the documented live-capture stages, scanning and forensic branches, plus storage and TUI layers. Edges use README statements and SOURCE INDEX references; unsampled implementation details and less-evidenced wiring are not inferred.

Main entry points: [`sentinel.py`](https://github.com/jivi001/network-analyzer/blob/main/sentinel.py) (CLI Controller), [`detection/pipeline.py`](https://github.com/jivi001/network-analyzer/blob/main/detection/pipeline.py) (Detection Pipeline), [`core/processor.py`](https://github.com/jivi001/network-analyzer/blob/main/core/processor.py) (Packet Decoder), [`tui/dashboard.py`](https://github.com/jivi001/network-analyzer/blob/main/tui/dashboard.py) (Live Dashboard)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Application and UI"]
  node_sentinel["CLI Controller<br/>[sentinel.py]"]
  node_menu["Mode Menu<br/>[menu.py]"]
  node_dashboard["Live Dashboard<br/>[dashboard.py]"]
  node_views["History and Result Views<br/>[history_view.py]"]
  node_console["Console Lifecycle<br/>[console.py]"]
end

subgraph group_capture["Capture and Analysis"]
  node_sniffer["Packet Sniffer<br/>[sniffer.py]"]
  node_queue["Bounded Packet Queue<br/>[sniffer.py]"]
  node_processor["Packet Decoder<br/>[processor.py]"]
  node_stats["Traffic Statistics<br/>[stats.py]"]
  node_models["Shared Data Models<br/>[models.py]"]
end

subgraph group_detection["Threat Detection"]
  node_pipeline["Detection Pipeline<br/>[pipeline.py]"]
  node_rules["Signature Rules<br/>[rule_engine.py]"]
  node_anomaly["Anomaly Detection<br/>[anomaly.py]"]
  node_arp["ARP Monitor<br/>[arp_monitor.py]"]
  node_alerts["Alert Manager<br/>[alerts.py]"]
end

subgraph group_scan["Scanning and Forensics"]
  node_scanner["Nmap Scanner<br/>[scanner.py]"]
  node_pcap["PCAP Loader<br/>[pcap_loader.py]"]
end

subgraph group_persistence["Audit and Export"]
  node_database[("SQLite Audit Store<br/>[database.py]")]
  node_exporter["Format Exporter<br/>[exporter.py]"]
  node_importer["Data Importer<br/>[importer.py]"]
end

node_user(("Operator"))
node_nic(("Network Interface"))
node_nmap(("Nmap"))

node_user -->|"starts"| node_sentinel
node_sentinel -->|"presents modes"| node_menu
node_menu -->|"opens capture"| node_dashboard
node_sentinel -->|"starts capture"| node_sniffer
node_nic -->|"supplies packets"| node_sniffer
node_sniffer -->|"enqueues packets"| node_queue
node_queue -->|"feeds worker"| node_processor
node_processor -->|"updates"| node_stats
node_processor -->|"evaluates packets"| node_pipeline
node_pipeline -->|"evaluates rules"| node_rules
node_pipeline -->|"checks anomalies"| node_anomaly
node_pipeline -->|"checks ARP"| node_arp
node_pipeline -->|"produces alerts"| node_alerts
node_dashboard -->|"shows metrics"| node_stats
node_dashboard -->|"shows alerts"| node_alerts
node_sentinel -->|"runs scans"| node_scanner
node_scanner -->|"executes scans"| node_nmap
node_sentinel -->|"loads captures"| node_pcap
node_pcap -->|"decodes packets"| node_processor
node_pcap -->|"aggregates traffic"| node_stats
node_sentinel -->|"persists audit"| node_database
node_sentinel -->|"exports results"| node_exporter
node_sentinel -.-> node_importer
node_sentinel -->|"shows history"| node_views
node_dashboard -->|"renders through"| node_console
node_processor -->|"uses packet model"| node_models
node_pipeline -->|"uses event models"| node_models
node_scanner -->|"returns scan models"| node_models
node_database -->|"stores records"| node_models

click node_sentinel "https://github.com/jivi001/network-analyzer/blob/main/sentinel.py"
click node_menu "https://github.com/jivi001/network-analyzer/blob/main/tui/menu.py"
click node_dashboard "https://github.com/jivi001/network-analyzer/blob/main/tui/dashboard.py"
click node_views "https://github.com/jivi001/network-analyzer/blob/main/tui/history_view.py"
click node_console "https://github.com/jivi001/network-analyzer/blob/main/utils/console.py"
click node_sniffer "https://github.com/jivi001/network-analyzer/blob/main/core/sniffer.py"
click node_queue "https://github.com/jivi001/network-analyzer/blob/main/core/sniffer.py"
click node_processor "https://github.com/jivi001/network-analyzer/blob/main/core/processor.py"
click node_stats "https://github.com/jivi001/network-analyzer/blob/main/core/stats.py"
click node_models "https://github.com/jivi001/network-analyzer/blob/main/storage/models.py"
click node_pipeline "https://github.com/jivi001/network-analyzer/blob/main/detection/pipeline.py"
click node_rules "https://github.com/jivi001/network-analyzer/blob/main/detection/rule_engine.py"
click node_anomaly "https://github.com/jivi001/network-analyzer/blob/main/detection/anomaly.py"
click node_arp "https://github.com/jivi001/network-analyzer/blob/main/detection/arp_monitor.py"
click node_alerts "https://github.com/jivi001/network-analyzer/blob/main/detection/alerts.py"
click node_scanner "https://github.com/jivi001/network-analyzer/blob/main/core/scanner.py"
click node_pcap "https://github.com/jivi001/network-analyzer/blob/main/core/pcap_loader.py"
click node_database "https://github.com/jivi001/network-analyzer/blob/main/storage/database.py"
click node_exporter "https://github.com/jivi001/network-analyzer/blob/main/storage/exporter.py"
click node_importer "https://github.com/jivi001/network-analyzer/blob/main/storage/importer.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_sentinel,node_menu,node_dashboard,node_views,node_console toneBlue
class node_sniffer,node_queue,node_processor,node_stats,node_models toneAmber
class node_pipeline,node_rules,node_anomaly,node_arp,node_alerts toneMint
class node_scanner,node_pcap toneRose
class node_database,node_exporter,node_importer,node_user,node_nic,node_nmap toneIndigo
```

## Components

### Application and UI

- [CLI Controller](https://github.com/jivi001/network-analyzer/blob/main/sentinel.py): `sentinel.py`
- [Mode Menu](https://github.com/jivi001/network-analyzer/blob/main/tui/menu.py): `tui/menu.py`
- [Live Dashboard](https://github.com/jivi001/network-analyzer/blob/main/tui/dashboard.py): `tui/dashboard.py`
- [History and Result Views](https://github.com/jivi001/network-analyzer/blob/main/tui/history_view.py): `tui/history_view.py`
- [Console Lifecycle](https://github.com/jivi001/network-analyzer/blob/main/utils/console.py): `utils/console.py`

### Capture and Analysis

- [Packet Sniffer](https://github.com/jivi001/network-analyzer/blob/main/core/sniffer.py): `core/sniffer.py`
- [Bounded Packet Queue](https://github.com/jivi001/network-analyzer/blob/main/core/sniffer.py): `core/sniffer.py`
- [Packet Decoder](https://github.com/jivi001/network-analyzer/blob/main/core/processor.py): `core/processor.py`
- [Traffic Statistics](https://github.com/jivi001/network-analyzer/blob/main/core/stats.py): `core/stats.py`
- [Shared Data Models](https://github.com/jivi001/network-analyzer/blob/main/storage/models.py): `storage/models.py`

### Threat Detection

- [Detection Pipeline](https://github.com/jivi001/network-analyzer/blob/main/detection/pipeline.py): `detection/pipeline.py`
- [Signature Rules](https://github.com/jivi001/network-analyzer/blob/main/detection/rule_engine.py): `detection/rule_engine.py`
- [Anomaly Detection](https://github.com/jivi001/network-analyzer/blob/main/detection/anomaly.py): `detection/anomaly.py`
- [ARP Monitor](https://github.com/jivi001/network-analyzer/blob/main/detection/arp_monitor.py): `detection/arp_monitor.py`
- [Alert Manager](https://github.com/jivi001/network-analyzer/blob/main/detection/alerts.py): `detection/alerts.py`

### Scanning and Forensics

- [Nmap Scanner](https://github.com/jivi001/network-analyzer/blob/main/core/scanner.py): `core/scanner.py`
- [PCAP Loader](https://github.com/jivi001/network-analyzer/blob/main/core/pcap_loader.py): `core/pcap_loader.py`

### Audit and Export

- [SQLite Audit Store](https://github.com/jivi001/network-analyzer/blob/main/storage/database.py): `storage/database.py`
- [Format Exporter](https://github.com/jivi001/network-analyzer/blob/main/storage/exporter.py): `storage/exporter.py`
- [Data Importer](https://github.com/jivi001/network-analyzer/blob/main/storage/importer.py): `storage/importer.py`

### Other components

- **Operator**
- **Network Interface**
- **Nmap**

## Connections

- Operator → CLI Controller: starts (evidence: `README.md`)
- CLI Controller → Mode Menu: presents modes (evidence: `README.md`)
- Mode Menu → Live Dashboard: opens capture (evidence: `README.md`)
- CLI Controller → Packet Sniffer: starts capture (evidence: `README.md`)
- Network Interface → Packet Sniffer: supplies packets (evidence: `README.md`)
- Packet Sniffer → Bounded Packet Queue: enqueues packets (evidence: `README.md`)
- Bounded Packet Queue → Packet Decoder: feeds worker (evidence: `README.md`)
- Packet Decoder → Traffic Statistics: updates (evidence: `README.md`)
- Packet Decoder → Detection Pipeline: evaluates packets (evidence: `README.md`)
- Detection Pipeline → Signature Rules: evaluates rules (evidence: `detection/pipeline.py`)
- Detection Pipeline → Anomaly Detection: checks anomalies (evidence: `detection/pipeline.py`)
- Detection Pipeline → ARP Monitor: checks ARP (evidence: `detection/pipeline.py`)
- Detection Pipeline → Alert Manager: produces alerts (evidence: `README.md`)
- Live Dashboard → Traffic Statistics: shows metrics (evidence: `README.md`)
- Live Dashboard → Alert Manager: shows alerts (evidence: `README.md`)
- CLI Controller → Nmap Scanner: runs scans (evidence: `README.md`)
- Nmap Scanner → Nmap: executes scans (evidence: `README.md`)
- CLI Controller → PCAP Loader: loads captures (evidence: `README.md`)
- PCAP Loader → Packet Decoder: decodes packets (evidence: `core/pcap_loader.py`)
- PCAP Loader → Traffic Statistics: aggregates traffic (evidence: `core/pcap_loader.py`)
- CLI Controller → SQLite Audit Store: persists audit (evidence: `README.md`)
- CLI Controller → Format Exporter: exports results (evidence: `README.md`)
- CLI Controller → Data Importer (evidence: `sentinel.py`)
- CLI Controller → History and Result Views: shows history (evidence: `README.md`)
- Live Dashboard → Console Lifecycle: renders through (evidence: `README.md`)
- Packet Decoder → Shared Data Models: uses packet model (evidence: `core/processor.py`)
- Detection Pipeline → Shared Data Models: uses event models (evidence: `detection/pipeline.py`)
- Nmap Scanner → Shared Data Models: returns scan models (evidence: `core/scanner.py`)
- SQLite Audit Store → Shared Data Models: stores records (evidence: `storage/database.py`)
