# ganesh030106/nxt_firewall architecture

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

- Interactive diagram: https://gitdiagram.com/ganesh030106/nxt_firewall
- Repository: https://github.com/ganesh030106/nxt_firewall

## Overview

Sentinel-X is a network-defense and endpoint-protection command center. Its principal workflow is packet capture, firewall analysis and policy enforcement, followed by persistent event logging and live dashboard updates; administrators can review telemetry and submit feedback or change rules. Separate protections cover phishing, DNS, host files, USB, integrity, and proactive scanning, with forensic capture and reports as supporting capabilities. The README documents the decoupled Next.js/Flask interface. Some capabilities are represented from README descriptions and indexed module names; their internal wiring is not inferred where source excerpts do not show it.

Main entry points: [`backend/app.py`](https://github.com/ganesh030106/nxt_firewall/blob/main/backend/app.py) (Flask API), [`backend/src/firewall.py`](https://github.com/ganesh030106/nxt_firewall/blob/main/backend/src/firewall.py) (Firewall Engine), [`frontend/src/app/page.tsx`](https://github.com/ganesh030106/nxt_firewall/blob/main/frontend/src/app/page.tsx) (Next.js Dashboard), [`frontend/src/components/PhishingScan.tsx`](https://github.com/ganesh030106/nxt_firewall/blob/main/frontend/src/components/PhishingScan.tsx) (Phishing Scan UI)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ingest["Traffic Defense"]
  node_engine["Firewall Engine<br/>[firewall.py]"]
  node_traffic_ai["Traffic Forecasting<br/>[dl_traffic.py]"]
  node_dns["DNS Security<br/>[dns_security.py]"]
  node_dpi["Payload Inspection<br/>[dpi.py]"]
  node_geo["Geo Filtering<br/>[geo.py]"]
  node_trust["Zero-Trust Scoring<br/>[zero_trust.py]"]
  node_intel["Threat Feeds<br/>[threat_intel.py]"]
  node_phishing["Phishing Analysis<br/>[phising.py]"]
  node_sequence["Sequence Classifier"]
end

subgraph group_host["Host Protection"]
  node_ransom["Ransomware Guardian<br/>[ransomware.py]"]
  node_malware["Malware Scanner<br/>[malware_scanner.py]"]
  node_usb["USB Sentinel<br/>[usb_defense.py]"]
  node_integrity["Integrity Watchdog<br/>[integrity.py]"]
  node_scanner["Vulnerability Scanner<br/>[scanner.py]"]
  node_honeypot["Decoy Honeypot<br/>[honeypot.py]"]
end

subgraph group_ops["Response and Records"]
  node_api["Flask API<br/>[app.py]"]
  node_store[("Event Database<br/>[database.py]")]
  node_feedback["Feedback Learning<br/>[feedback.py]"]
  node_forensics["Packet Forensics<br/>[forensics.py]"]
  node_reports["PDF Reports<br/>[reports.py]"]
  node_socket["Live Event Transport<br/>[socket_handler.py]"]
  node_voice["Voice Alerts<br/>[voice.py]"]
end

subgraph group_interface["Command Center"]
  node_dashboard["Next.js Dashboard<br/>[page.tsx]"]
  node_logtable["Log Console<br/>[LogTable.tsx]"]
  node_phish_ui["Phishing Scan UI<br/>[PhishingScan.tsx]"]
  node_map["Threat Topology<br/>[page.tsx]"]
end

node_admin(("Administrator"))
node_packets(("Network Packets"))

node_packets -.->|"captures"| node_engine
node_engine -->|"checks anomalies"| node_traffic_ai
node_engine -->|"inspects payloads"| node_dpi
node_engine -->|"checks geography"| node_geo
node_engine -->|"checks DNS"| node_dns
node_engine -->|"scores context"| node_trust
node_engine -->|"checks feeds"| node_intel
node_engine -->|"logs events"| node_store
node_engine -->|"emits updates"| node_socket
node_engine -->|"requests alerts"| node_voice
node_api -->|"starts sniffer"| node_engine
node_api -->|"starts monitor"| node_ransom
node_api -->|"starts decoy"| node_honeypot
node_api -->|"checks URLs"| node_phishing
node_api -->|"runs prediction"| node_sequence
node_api -->|"records feedback"| node_feedback
node_api -->|"initializes watchdog"| node_integrity
node_api -->|"integrates scanning"| node_scanner
node_api -->|"integrates sentinel"| node_usb
node_api -->|"queries dashboard data"| node_store
node_api -->|"generates report"| node_reports
node_api -.->|"integrates capture"| node_forensics
node_admin -->|"reviews telemetry"| node_dashboard
node_dashboard -->|"requests data"| node_api
node_dashboard -->|"receives live alerts"| node_socket
node_dashboard -->|"renders logs"| node_logtable
node_dashboard -->|"renders topology"| node_map
node_dashboard -->|"offers URL scan"| node_phish_ui
node_phish_ui -.->|"submits URL"| node_api
node_admin -->|"changes rules"| node_api

click node_engine "https://github.com/ganesh030106/nxt_firewall/blob/main/backend/src/firewall.py"
click node_traffic_ai "https://github.com/ganesh030106/nxt_firewall/blob/main/backend/src/dl_traffic.py"
click node_dns "https://github.com/ganesh030106/nxt_firewall/blob/main/backend/src/dns_security.py"
click node_dpi "https://github.com/ganesh030106/nxt_firewall/blob/main/backend/src/dpi.py"
click node_geo "https://github.com/ganesh030106/nxt_firewall/blob/main/backend/src/geo.py"
click node_trust "https://github.com/ganesh030106/nxt_firewall/blob/main/backend/src/zero_trust.py"
click node_intel "https://github.com/ganesh030106/nxt_firewall/blob/main/backend/src/threat_intel.py"
click node_phishing "https://github.com/ganesh030106/nxt_firewall/blob/main/backend/src/phising.py"
click node_sequence "https://github.com/ganesh030106/nxt_firewall/blob/main/backend/src/cnn_gru_inference.py"
click node_ransom "https://github.com/ganesh030106/nxt_firewall/blob/main/backend/src/ransomware.py"
click node_malware "https://github.com/ganesh030106/nxt_firewall/blob/main/backend/src/malware_scanner.py"
click node_usb "https://github.com/ganesh030106/nxt_firewall/blob/main/backend/src/usb_defense.py"
click node_integrity "https://github.com/ganesh030106/nxt_firewall/blob/main/backend/src/integrity.py"
click node_scanner "https://github.com/ganesh030106/nxt_firewall/blob/main/backend/src/scanner.py"
click node_honeypot "https://github.com/ganesh030106/nxt_firewall/blob/main/backend/src/honeypot.py"
click node_api "https://github.com/ganesh030106/nxt_firewall/blob/main/backend/app.py"
click node_store "https://github.com/ganesh030106/nxt_firewall/blob/main/backend/src/database.py"
click node_feedback "https://github.com/ganesh030106/nxt_firewall/blob/main/backend/src/feedback.py"
click node_forensics "https://github.com/ganesh030106/nxt_firewall/blob/main/backend/src/forensics.py"
click node_reports "https://github.com/ganesh030106/nxt_firewall/blob/main/backend/src/reports.py"
click node_socket "https://github.com/ganesh030106/nxt_firewall/blob/main/backend/src/socket_handler.py"
click node_voice "https://github.com/ganesh030106/nxt_firewall/blob/main/backend/src/voice.py"
click node_dashboard "https://github.com/ganesh030106/nxt_firewall/blob/main/frontend/src/app/page.tsx"
click node_logtable "https://github.com/ganesh030106/nxt_firewall/blob/main/frontend/src/components/LogTable.tsx"
click node_phish_ui "https://github.com/ganesh030106/nxt_firewall/blob/main/frontend/src/components/PhishingScan.tsx"
click node_map "https://github.com/ganesh030106/nxt_firewall/blob/main/frontend/src/app/page.tsx"

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_engine,node_traffic_ai,node_dns,node_dpi,node_geo,node_trust,node_intel,node_phishing,node_sequence toneBlue
class node_ransom,node_malware,node_usb,node_integrity,node_scanner,node_honeypot toneAmber
class node_api,node_store,node_feedback,node_forensics,node_reports,node_socket,node_voice toneMint
class node_dashboard,node_logtable,node_phish_ui,node_map toneRose
class node_admin,node_packets toneIndigo
```

## Components

### Traffic Defense

- [Firewall Engine](https://github.com/ganesh030106/nxt_firewall/blob/main/backend/src/firewall.py): `backend/src/firewall.py`
- [Traffic Forecasting](https://github.com/ganesh030106/nxt_firewall/blob/main/backend/src/dl_traffic.py): `backend/src/dl_traffic.py`
- [DNS Security](https://github.com/ganesh030106/nxt_firewall/blob/main/backend/src/dns_security.py): `backend/src/dns_security.py`
- [Payload Inspection](https://github.com/ganesh030106/nxt_firewall/blob/main/backend/src/dpi.py): `backend/src/dpi.py`
- [Geo Filtering](https://github.com/ganesh030106/nxt_firewall/blob/main/backend/src/geo.py): `backend/src/geo.py`
- [Zero-Trust Scoring](https://github.com/ganesh030106/nxt_firewall/blob/main/backend/src/zero_trust.py): `backend/src/zero_trust.py`
- [Threat Feeds](https://github.com/ganesh030106/nxt_firewall/blob/main/backend/src/threat_intel.py): `backend/src/threat_intel.py`
- [Phishing Analysis](https://github.com/ganesh030106/nxt_firewall/blob/main/backend/src/phising.py): `backend/src/phising.py`
- [Sequence Classifier](https://github.com/ganesh030106/nxt_firewall/blob/main/backend/src/cnn_gru_inference.py): `backend/src/cnn_gru_inference.py`

### Host Protection

- [Ransomware Guardian](https://github.com/ganesh030106/nxt_firewall/blob/main/backend/src/ransomware.py): `backend/src/ransomware.py`
- [Malware Scanner](https://github.com/ganesh030106/nxt_firewall/blob/main/backend/src/malware_scanner.py): `backend/src/malware_scanner.py`
- [USB Sentinel](https://github.com/ganesh030106/nxt_firewall/blob/main/backend/src/usb_defense.py): `backend/src/usb_defense.py`
- [Integrity Watchdog](https://github.com/ganesh030106/nxt_firewall/blob/main/backend/src/integrity.py): `backend/src/integrity.py`
- [Vulnerability Scanner](https://github.com/ganesh030106/nxt_firewall/blob/main/backend/src/scanner.py): `backend/src/scanner.py`
- [Decoy Honeypot](https://github.com/ganesh030106/nxt_firewall/blob/main/backend/src/honeypot.py): `backend/src/honeypot.py`

### Response and Records

- [Flask API](https://github.com/ganesh030106/nxt_firewall/blob/main/backend/app.py): `backend/app.py`
- [Event Database](https://github.com/ganesh030106/nxt_firewall/blob/main/backend/src/database.py): `backend/src/database.py`
- [Feedback Learning](https://github.com/ganesh030106/nxt_firewall/blob/main/backend/src/feedback.py): `backend/src/feedback.py`
- [Packet Forensics](https://github.com/ganesh030106/nxt_firewall/blob/main/backend/src/forensics.py): `backend/src/forensics.py`
- [PDF Reports](https://github.com/ganesh030106/nxt_firewall/blob/main/backend/src/reports.py): `backend/src/reports.py`
- [Live Event Transport](https://github.com/ganesh030106/nxt_firewall/blob/main/backend/src/socket_handler.py): `backend/src/socket_handler.py`
- [Voice Alerts](https://github.com/ganesh030106/nxt_firewall/blob/main/backend/src/voice.py): `backend/src/voice.py`

### Command Center

- [Next.js Dashboard](https://github.com/ganesh030106/nxt_firewall/blob/main/frontend/src/app/page.tsx): `frontend/src/app/page.tsx`
- [Log Console](https://github.com/ganesh030106/nxt_firewall/blob/main/frontend/src/components/LogTable.tsx): `frontend/src/components/LogTable.tsx`
- [Phishing Scan UI](https://github.com/ganesh030106/nxt_firewall/blob/main/frontend/src/components/PhishingScan.tsx): `frontend/src/components/PhishingScan.tsx`
- [Threat Topology](https://github.com/ganesh030106/nxt_firewall/blob/main/frontend/src/app/page.tsx): `frontend/src/app/page.tsx`

### Other components

- **Administrator**
- **Network Packets**

## Connections

- Network Packets → Firewall Engine: captures
- Firewall Engine → Traffic Forecasting: checks anomalies (evidence: `backend/src/firewall.py`)
- Firewall Engine → Payload Inspection: inspects payloads (evidence: `backend/src/firewall.py`)
- Firewall Engine → Geo Filtering: checks geography (evidence: `backend/src/firewall.py`)
- Firewall Engine → DNS Security: checks DNS (evidence: `backend/src/firewall.py`)
- Firewall Engine → Zero-Trust Scoring: scores context (evidence: `backend/src/firewall.py`)
- Firewall Engine → Threat Feeds: checks feeds (evidence: `backend/src/firewall.py`)
- Firewall Engine → Event Database: logs events (evidence: `backend/src/firewall.py`)
- Firewall Engine → Live Event Transport: emits updates (evidence: `backend/src/firewall.py`)
- Firewall Engine → Voice Alerts: requests alerts (evidence: `backend/src/firewall.py`)
- Flask API → Firewall Engine: starts sniffer (evidence: `backend/app.py`)
- Flask API → Ransomware Guardian: starts monitor (evidence: `backend/app.py`)
- Flask API → Decoy Honeypot: starts decoy (evidence: `backend/app.py`)
- Flask API → Phishing Analysis: checks URLs (evidence: `backend/app.py`)
- Flask API → Sequence Classifier: runs prediction (evidence: `backend/app.py`)
- Flask API → Feedback Learning: records feedback (evidence: `backend/app.py`)
- Flask API → Integrity Watchdog: initializes watchdog (evidence: `backend/app.py`)
- Flask API → Vulnerability Scanner: integrates scanning (evidence: `backend/app.py`)
- Flask API → USB Sentinel: integrates sentinel (evidence: `backend/app.py`)
- Flask API → Event Database: queries dashboard data (evidence: `backend/app.py`)
- Flask API → PDF Reports: generates report (evidence: `backend/app.py`)
- Flask API → Packet Forensics: integrates capture
- Administrator → Next.js Dashboard: reviews telemetry
- Next.js Dashboard → Flask API: requests data
- Next.js Dashboard → Live Event Transport: receives live alerts
- Next.js Dashboard → Log Console: renders logs (evidence: `frontend/src/app/page.tsx`)
- Next.js Dashboard → Threat Topology: renders topology (evidence: `frontend/src/app/page.tsx`)
- Next.js Dashboard → Phishing Scan UI: offers URL scan (evidence: `frontend/src/app/page.tsx`)
- Phishing Scan UI → Flask API: submits URL
- Administrator → Flask API: changes rules (evidence: `backend/app.py`)
