# deaddemon001/snoc architecture

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

- Interactive diagram: https://gitdiagram.com/deaddemon001/snoc
- Repository: https://github.com/deaddemon001/snoc

## Overview

Smart NOC is a Windows-first network-operations application: operators use its authenticated web dashboard to inspect monitoring data, manage users and settings, configure alerts, and run OLT/ONU operations. Background collectors ingest traps, syslog, TFTP backups, and reachability/OLT telemetry; the Flask API exposes dashboard and operational actions over PostgreSQL-backed services. The graph preserves documented capabilities, but several backend internals are unsampled; those subsystem links rely on README descriptions rather than inspected call paths.

Main entry points: [`frontend/src/App.tsx`](https://github.com/deaddemon001/snoc/blob/main/frontend/src/App.tsx) (SPA Router), [`frontend/src/api.ts`](https://github.com/deaddemon001/snoc/blob/main/frontend/src/api.ts) (API Client), [`api.py`](https://github.com/deaddemon001/snoc/blob/main/api.py) (Flask API), [`alert_engine.py`](https://github.com/deaddemon001/snoc/blob/main/alert_engine.py) (Alert Engine)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Dashboard"]
  node_app["SPA Router<br/>[App.tsx]"]
  node_auth["Authentication<br/>[AuthContext.tsx]"]
  node_dashboard["Health Dashboard"]
  node_syslogview["Syslog View<br/>[SyslogView.tsx]"]
  node_snmpview["Trap View<br/>[SnmpTrapsView.tsx]"]
  node_tftpview["Backup View"]
  node_pingview["Ping View"]
  node_alertsview["Alert Rules View<br/>[AlertsView.tsx]"]
  node_oltview["OLT Console<br/>[OltConnectView.tsx]"]
  node_ontview["ONT Lookup<br/>[OntLookupView.tsx]"]
  node_uplinkview["Uplink Traffic"]
  node_usersview["User Admin<br/>[UsersView.tsx]"]
  node_httpclient["API Client<br/>[api.ts]"]
end

subgraph group_backend["API and Storage"]
  node_flask["Flask API<br/>[api.py]"]
  node_config["Runtime Configuration<br/>[noc_config.py]"]
  node_postgres[("PostgreSQL")]
end

subgraph group_collect["Collection and Monitoring"]
  node_trap["SNMP Trap Receiver<br/>[trap_receiver.py]"]
  node_mib["VSOL MIB<br/>[vsol_mib.py]"]
  node_syslog["Syslog Collector<br/>[syslog_server.py]"]
  node_tftp["TFTP Receiver<br/>[tftp_server.py]"]
  node_ping["Ping Monitoring<br/>[api.py]"]
end

subgraph group_olt["OLT Operations"]
  node_oltconnector["OLT Polling Engine<br/>[olt_connector.py]"]
end

subgraph group_notify["Alerting"]
  node_alerts["Alert Engine<br/>[alert_engine.py]"]
end

node_operator(("NOC Operator"))
node_email["Email Service"]
node_telegram["Telegram"]
node_discord["Discord Webhook"]

node_operator -->|"uses dashboard"| node_app
node_app -->|"checks access"| node_auth
node_app -->|"routes to"| node_dashboard
node_app -->|"routes to"| node_syslogview
node_app -->|"routes to"| node_snmpview
node_app -->|"routes to"| node_tftpview
node_app -->|"routes to"| node_pingview
node_app -->|"routes to"| node_alertsview
node_app -->|"routes to"| node_oltview
node_app -->|"routes to"| node_ontview
node_app -->|"routes to"| node_uplinkview
node_app -->|"routes to"| node_usersview
node_auth -->|"requests session"| node_httpclient
node_dashboard -->|"requests telemetry"| node_httpclient
node_syslogview -->|"requests events"| node_httpclient
node_snmpview -->|"requests traps"| node_httpclient
node_tftpview -->|"requests backups"| node_httpclient
node_pingview -->|"requests status"| node_httpclient
node_alertsview -->|"manages rules"| node_httpclient
node_oltview -->|"requests OLT data"| node_httpclient
node_ontview -->|"requests ONU data"| node_httpclient
node_uplinkview -->|"requests traffic"| node_httpclient
node_usersview -->|"manages users"| node_httpclient
node_httpclient -->|"sends API requests"| node_flask
node_flask -->|"loads settings"| node_config
node_flask -->|"reads and writes"| node_postgres
node_flask -->|"uses alert engine"| node_alerts
node_flask -->|"dispatches OLT work"| node_oltconnector
node_trap -->|"loads configuration"| node_config
node_trap -->|"uses MIB definitions"| node_mib
node_syslog -->|"loads configuration"| node_config
node_syslog -->|"checks alert rules"| node_alerts
node_tftp -->|"loads configuration"| node_config
node_oltconnector -->|"uses configuration"| node_config
node_oltconnector -->|"stores telemetry"| node_postgres
node_flask -->|"runs reachability checks"| node_ping
node_ping -->|"raises state alerts"| node_alerts
node_alerts -->|"sends email"| node_email
node_alerts -->|"sends notifications"| node_telegram
node_alerts -->|"posts webhooks"| node_discord
node_trap -.->|"stores events"| node_postgres
node_tftp -.->|"stores backups"| node_postgres

click node_app "https://github.com/deaddemon001/snoc/blob/main/frontend/src/App.tsx"
click node_auth "https://github.com/deaddemon001/snoc/blob/main/frontend/src/context/AuthContext.tsx"
click node_dashboard "https://github.com/deaddemon001/snoc/blob/main/frontend/src/views/HealthDashboardView.tsx"
click node_syslogview "https://github.com/deaddemon001/snoc/blob/main/frontend/src/views/SyslogView.tsx"
click node_snmpview "https://github.com/deaddemon001/snoc/blob/main/frontend/src/views/SnmpTrapsView.tsx"
click node_tftpview "https://github.com/deaddemon001/snoc/blob/main/frontend/src/views/TftpBackupsView.tsx"
click node_pingview "https://github.com/deaddemon001/snoc/blob/main/frontend/src/views/PingMonitorView.tsx"
click node_alertsview "https://github.com/deaddemon001/snoc/blob/main/frontend/src/views/AlertsView.tsx"
click node_oltview "https://github.com/deaddemon001/snoc/blob/main/frontend/src/views/OltConnectView.tsx"
click node_ontview "https://github.com/deaddemon001/snoc/blob/main/frontend/src/views/OntLookupView.tsx"
click node_uplinkview "https://github.com/deaddemon001/snoc/blob/main/frontend/src/views/UplinkTrafficView.tsx"
click node_usersview "https://github.com/deaddemon001/snoc/blob/main/frontend/src/views/UsersView.tsx"
click node_httpclient "https://github.com/deaddemon001/snoc/blob/main/frontend/src/api.ts"
click node_flask "https://github.com/deaddemon001/snoc/blob/main/api.py"
click node_config "https://github.com/deaddemon001/snoc/blob/main/noc_config.py"
click node_trap "https://github.com/deaddemon001/snoc/blob/main/trap_receiver.py"
click node_mib "https://github.com/deaddemon001/snoc/blob/main/vsol_mib.py"
click node_syslog "https://github.com/deaddemon001/snoc/blob/main/syslog_server.py"
click node_tftp "https://github.com/deaddemon001/snoc/blob/main/tftp_server.py"
click node_ping "https://github.com/deaddemon001/snoc/blob/main/api.py"
click node_oltconnector "https://github.com/deaddemon001/snoc/blob/main/olt_connector.py"
click node_alerts "https://github.com/deaddemon001/snoc/blob/main/alert_engine.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_auth,node_dashboard,node_syslogview,node_snmpview,node_tftpview,node_pingview,node_alertsview,node_oltview,node_ontview,node_uplinkview,node_usersview,node_httpclient toneBlue
class node_flask,node_config,node_postgres toneAmber
class node_trap,node_mib,node_syslog,node_tftp,node_ping,node_discord toneMint
class node_oltconnector toneRose
class node_alerts,node_operator,node_email,node_telegram toneIndigo
```

## Components

### Dashboard

- [SPA Router](https://github.com/deaddemon001/snoc/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`
- [Authentication](https://github.com/deaddemon001/snoc/blob/main/frontend/src/context/AuthContext.tsx): `frontend/src/context/AuthContext.tsx`
- [Health Dashboard](https://github.com/deaddemon001/snoc/blob/main/frontend/src/views/HealthDashboardView.tsx): `frontend/src/views/HealthDashboardView.tsx`
- [Syslog View](https://github.com/deaddemon001/snoc/blob/main/frontend/src/views/SyslogView.tsx): `frontend/src/views/SyslogView.tsx`
- [Trap View](https://github.com/deaddemon001/snoc/blob/main/frontend/src/views/SnmpTrapsView.tsx): `frontend/src/views/SnmpTrapsView.tsx`
- [Backup View](https://github.com/deaddemon001/snoc/blob/main/frontend/src/views/TftpBackupsView.tsx): `frontend/src/views/TftpBackupsView.tsx`
- [Ping View](https://github.com/deaddemon001/snoc/blob/main/frontend/src/views/PingMonitorView.tsx): `frontend/src/views/PingMonitorView.tsx`
- [Alert Rules View](https://github.com/deaddemon001/snoc/blob/main/frontend/src/views/AlertsView.tsx): `frontend/src/views/AlertsView.tsx`
- [OLT Console](https://github.com/deaddemon001/snoc/blob/main/frontend/src/views/OltConnectView.tsx): `frontend/src/views/OltConnectView.tsx`
- [ONT Lookup](https://github.com/deaddemon001/snoc/blob/main/frontend/src/views/OntLookupView.tsx): `frontend/src/views/OntLookupView.tsx`
- [Uplink Traffic](https://github.com/deaddemon001/snoc/blob/main/frontend/src/views/UplinkTrafficView.tsx): `frontend/src/views/UplinkTrafficView.tsx`
- [User Admin](https://github.com/deaddemon001/snoc/blob/main/frontend/src/views/UsersView.tsx): `frontend/src/views/UsersView.tsx`
- [API Client](https://github.com/deaddemon001/snoc/blob/main/frontend/src/api.ts): `frontend/src/api.ts`

### API and Storage

- [Flask API](https://github.com/deaddemon001/snoc/blob/main/api.py): `api.py`
- [Runtime Configuration](https://github.com/deaddemon001/snoc/blob/main/noc_config.py): `noc_config.py`
- **PostgreSQL**

### Collection and Monitoring

- [SNMP Trap Receiver](https://github.com/deaddemon001/snoc/blob/main/trap_receiver.py): `trap_receiver.py`
- [VSOL MIB](https://github.com/deaddemon001/snoc/blob/main/vsol_mib.py): `vsol_mib.py`
- [Syslog Collector](https://github.com/deaddemon001/snoc/blob/main/syslog_server.py): `syslog_server.py`
- [TFTP Receiver](https://github.com/deaddemon001/snoc/blob/main/tftp_server.py): `tftp_server.py`
- [Ping Monitoring](https://github.com/deaddemon001/snoc/blob/main/api.py): `api.py`

### OLT Operations

- [OLT Polling Engine](https://github.com/deaddemon001/snoc/blob/main/olt_connector.py): `olt_connector.py`

### Alerting

- [Alert Engine](https://github.com/deaddemon001/snoc/blob/main/alert_engine.py): `alert_engine.py`

### Other components

- **NOC Operator**
- **Email Service**
- **Telegram**
- **Discord Webhook**

## Connections

- NOC Operator → SPA Router: uses dashboard (evidence: `README.md`)
- SPA Router → Authentication: checks access (evidence: `frontend/src/App.tsx`)
- SPA Router → Health Dashboard: routes to (evidence: `frontend/src/App.tsx`)
- SPA Router → Syslog View: routes to (evidence: `frontend/src/App.tsx`)
- SPA Router → Trap View: routes to (evidence: `frontend/src/App.tsx`)
- SPA Router → Backup View: routes to (evidence: `frontend/src/App.tsx`)
- SPA Router → Ping View: routes to (evidence: `frontend/src/App.tsx`)
- SPA Router → Alert Rules View: routes to (evidence: `frontend/src/App.tsx`)
- SPA Router → OLT Console: routes to (evidence: `frontend/src/App.tsx`)
- SPA Router → ONT Lookup: routes to (evidence: `frontend/src/App.tsx`)
- SPA Router → Uplink Traffic: routes to (evidence: `frontend/src/App.tsx`)
- SPA Router → User Admin: routes to (evidence: `frontend/src/App.tsx`)
- Authentication → API Client: requests session (evidence: `frontend/src/context/AuthContext.tsx`)
- Health Dashboard → API Client: requests telemetry (evidence: `frontend/src/views/HealthDashboardView.tsx`)
- Syslog View → API Client: requests events (evidence: `frontend/src/views/SyslogView.tsx`)
- Trap View → API Client: requests traps (evidence: `frontend/src/views/SnmpTrapsView.tsx`)
- Backup View → API Client: requests backups (evidence: `frontend/src/views/TftpBackupsView.tsx`)
- Ping View → API Client: requests status (evidence: `frontend/src/views/PingMonitorView.tsx`)
- Alert Rules View → API Client: manages rules (evidence: `frontend/src/views/AlertsView.tsx`)
- OLT Console → API Client: requests OLT data (evidence: `frontend/src/views/OltConnectView.tsx`)
- ONT Lookup → API Client: requests ONU data (evidence: `frontend/src/views/OntLookupView.tsx`)
- Uplink Traffic → API Client: requests traffic (evidence: `frontend/src/views/UplinkTrafficView.tsx`)
- User Admin → API Client: manages users (evidence: `frontend/src/views/UsersView.tsx`)
- API Client → Flask API: sends API requests (evidence: `README.md`)
- Flask API → Runtime Configuration: loads settings (evidence: `api.py`)
- Flask API → PostgreSQL: reads and writes (evidence: `README.md`)
- Flask API → Alert Engine: uses alert engine (evidence: `api.py`)
- Flask API → OLT Polling Engine: dispatches OLT work (evidence: `api.py`)
- SNMP Trap Receiver → Runtime Configuration: loads configuration (evidence: `trap_receiver.py`)
- SNMP Trap Receiver → VSOL MIB: uses MIB definitions (evidence: `trap_receiver.py`)
- Syslog Collector → Runtime Configuration: loads configuration (evidence: `syslog_server.py`)
- Syslog Collector → Alert Engine: checks alert rules (evidence: `syslog_server.py`)
- TFTP Receiver → Runtime Configuration: loads configuration (evidence: `tftp_server.py`)
- OLT Polling Engine → Runtime Configuration: uses configuration (evidence: `olt_connector.py`)
- OLT Polling Engine → PostgreSQL: stores telemetry (evidence: `README.md`)
- Flask API → Ping Monitoring: runs reachability checks (evidence: `README.md`)
- Ping Monitoring → Alert Engine: raises state alerts (evidence: `alert_engine.py`)
- Alert Engine → Email Service: sends email (evidence: `alert_engine.py`)
- Alert Engine → Telegram: sends notifications (evidence: `README.md`)
- Alert Engine → Discord Webhook: posts webhooks (evidence: `alert_engine.py`)
- SNMP Trap Receiver → PostgreSQL: stores events
- TFTP Receiver → PostgreSQL: stores backups
