How aixisstudio/snitch works
Snitch is a local, real-time network-traffic visualizer. Its main workflow captures and parses packets, enriches connections with process, classification and offline-geolocation data, detects anomalies, persists local history, and streams updates to the UI. The UI presents live graph and map views alongside alerts, per-app activity, bandwidth, timeline, privacy scoring and settings. The graph preserves documented capabilities, but some implementation links rely on README or SOURCE INDEX references because the corresponding source was not excerpted.
Main entry points: App.jsx Application shell · main.py Backend API · sniffer.py Packet capture · useWebSocket.js Realtime state
Components 27
Capture and analysis
- Packet capture
backend/capture/sniffer.py - Packet parser
backend/capture/parser.py - libpcap binding
backend/capture/pcap.py - Process attribution
backend/capture/sniffer.py - Traffic classifier
backend/classifier/traffic.py - Offline geolocation
backend/resolver/dns_geo.py - LAN discovery
backend/scanner/arp_scanner.py - Anomaly detection
backend/detection/anomaly.py - Media monitor
backend/capture/media_monitor.py
API and local services
- Backend API
backend/api/main.py - API security
backend/api/security.py - SQLite history
backend/storage/db.py - Data paths
backend/paths.py
Desktop and web UI
- Frontend API helpers
frontend/src/api.js - Realtime state
frontend/src/hooks/useWebSocket.js - Application shell
frontend/src/App.jsx - Bilingual interface
frontend/src/i18n.jsx - Electron desktop
electron/main.js
Traffic views
- Force graph
frontend/src/graph/ForceGraph.jsx - World map
frontend/src/map/MapView.jsx - Sidebar and metrics
frontend/src/components/Sidebar.jsx - Alert panel
frontend/src/components/AlertPanel.jsx - Per-app view
frontend/src/components/AppsView.jsx - Traffic timeline
frontend/src/components/Timeline.jsx - Settings
frontend/src/components/Settings.jsx - Privacy scoring
frontend/src/scoring/privacy.js
Other components
- User
Connections 29
- User → Application shell: uses
- Packet capture → libpcap binding: captures via
backend/capture/sniffer.py - Packet capture → Packet parser: decodes with
backend/capture/sniffer.py - Backend API → Packet capture: starts and receives
backend/api/main.py - Packet capture → Process attribution: attributes process
backend/capture/sniffer.py - Backend API → Traffic classifier: classifies traffic
backend/api/main.py - Backend API → Offline geolocation: enriches connections
backend/api/main.py - Backend API → LAN discovery: discovers devices
backend/api/main.py - Backend API → Anomaly detection: checks anomalies
backend/api/main.py - Backend API → Media monitor: reads media state
backend/api/main.py - Backend API → SQLite history: persists and reads
backend/api/main.py - Backend API → API security: enforces tokens
backend/api/main.py - SQLite history → Data paths: resolves storage
backend/storage/db.py - API security → Data paths: resolves token path
backend/api/security.py - Backend API → Realtime state: streams updates
backend/api/main.py - Frontend API helpers → Backend API: calls endpoints
- Realtime state → Frontend API helpers: gets connection details
frontend/src/hooks/useWebSocket.js - Application shell → Realtime state: uses realtime state
frontend/src/App.jsx - Application shell → Force graph: renders traffic graph
frontend/src/App.jsx - Application shell → World map: renders geo map
frontend/src/App.jsx - Application shell → Sidebar and metrics: renders metrics
frontend/src/App.jsx - Application shell → Alert panel: renders alerts
frontend/src/App.jsx - Application shell → Per-app view: renders app view
frontend/src/App.jsx - Application shell → Traffic timeline: renders timeline
frontend/src/App.jsx - Application shell → Settings: renders settings
frontend/src/App.jsx - Application shell → Privacy scoring: calculates score
frontend/src/App.jsx - Application shell → Bilingual interface: uses translations
frontend/src/App.jsx - Electron desktop → Backend API: launches backend
- Electron desktop → Application shell: hosts interface