# am1rarshad/arpspoofnewday architecture

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

- Interactive diagram: https://gitdiagram.com/am1rarshad/arpspoofnewday
- Repository: https://github.com/am1rarshad/arpspoofnewday

## Overview

This is an ARP intrusion-detection dashboard: the backend captures network traffic, derives packet features, detects suspicious activity with rules and an ML scorer, and serves alerts and live metrics to an authenticated web UI. Operators can inspect/export alerts, provide feedback, manage account settings, and control model retraining. The graph follows the documented capture-to-detection-to-alert path and the sampled UI wiring; unsampled routes and integrations are not inferred.

Main entry points: [`ids_project/frontend/src/App.jsx`](https://github.com/am1rarshad/arpspoofnewday/blob/main/ids_project/frontend/src/App.jsx) (Dashboard shell), [`ids_project/backend/main.py`](https://github.com/am1rarshad/arpspoofnewday/blob/main/ids_project/backend/main.py) (API and event server), [`ids_project/frontend/src/api.js`](https://github.com/am1rarshad/arpspoofnewday/blob/main/ids_project/frontend/src/api.js) (HTTP client), [`ids_project/frontend/src/components/AlertCenter.jsx`](https://github.com/am1rarshad/arpspoofnewday/blob/main/ids_project/frontend/src/components/AlertCenter.jsx) (Alert center)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_capture["Capture and detection"]
  node_sniffer["Packet sniffer<br/>[sniffer.py]"]
  node_features["Feature engineering<br/>[features.py]"]
  node_rules["Rule and ML engines<br/>[engine.py]"]
end

subgraph group_service["Backend services"]
  node_server["API and event server<br/>[main.py]"]
  node_auth["Authentication<br/>[auth.py]"]
end

subgraph group_ui["Dashboard interface"]
  node_app["Dashboard shell<br/>[App.jsx]"]
  node_api["HTTP client<br/>[api.js]"]
  node_login["Login view<br/>[Login.jsx]"]
  node_overview["Network overview"]
  node_alerts["Alert center<br/>[AlertCenter.jsx]"]
  node_alerttable["Alert table<br/>[AlertTable.jsx]"]
  node_alertdetail["Alert details"]
  node_account["Account settings<br/>[AccountConfig.jsx]"]
  node_modelcontrol["Model controls<br/>[ModelControl.jsx]"]
  node_websocket["WebSocket hook<br/>[useWebSocket.js]"]
  node_entry["React entry point<br/>[main.jsx]"]
end

subgraph group_state["Persistence and learning"]
  node_store[("IDS data store<br/>[database.py]")]
  node_training["Model training<br/>[train_model.py]"]
  node_alertsdata["Alert data file<br/>[alerts.json]"]
end

node_network(("ARP traffic"))
node_operator(("Security operator"))

node_network -->|"supplies packets"| node_sniffer
node_sniffer -->|"derives features"| node_features
node_sniffer -->|"scores traffic"| node_rules
node_sniffer -->|"reads state"| node_store
node_server -->|"starts capture"| node_sniffer
node_server -->|"records alerts"| node_store
node_server -->|"authenticates routes"| node_auth
node_auth -->|"looks up users"| node_store
node_rules -->|"consumes features"| node_features
node_rules -->|"loads feedback"| node_store
node_training -->|"uses feature schema"| node_features
node_server -.->|"sends notifications"| node_operator
node_operator -->|"opens dashboard"| node_entry
node_entry -->|"renders"| node_app
node_app -->|"shows login"| node_login
node_app -->|"selects overview"| node_overview
node_app -->|"selects alerts"| node_alerts
node_app -->|"selects settings"| node_account
node_app -->|"selects model"| node_modelcontrol
node_login -->|"submits credentials"| node_api
node_overview -->|"requests ARP table"| node_api
node_overview -->|"subscribes metrics"| node_websocket
node_alerts -->|"loads alert data"| node_api
node_alerts -->|"subscribes alerts"| node_websocket
node_alerts -->|"renders rows"| node_alerttable
node_alerts -->|"opens details"| node_alertdetail
node_account -->|"manages account"| node_api
node_modelcontrol -->|"controls retraining"| node_api
node_api -->|"calls API"| node_server
node_websocket -.->|"receives live events"| node_server

click node_sniffer "https://github.com/am1rarshad/arpspoofnewday/blob/main/ids_project/backend/sniffer.py"
click node_features "https://github.com/am1rarshad/arpspoofnewday/blob/main/ids_project/backend/features.py"
click node_rules "https://github.com/am1rarshad/arpspoofnewday/blob/main/ids_project/backend/engine.py"
click node_server "https://github.com/am1rarshad/arpspoofnewday/blob/main/ids_project/backend/main.py"
click node_auth "https://github.com/am1rarshad/arpspoofnewday/blob/main/ids_project/backend/auth.py"
click node_store "https://github.com/am1rarshad/arpspoofnewday/blob/main/ids_project/backend/database.py"
click node_training "https://github.com/am1rarshad/arpspoofnewday/blob/main/ids_project/backend/train_model.py"
click node_alertsdata "https://github.com/am1rarshad/arpspoofnewday/blob/main/ids_project/backend/alerts.json"
click node_app "https://github.com/am1rarshad/arpspoofnewday/blob/main/ids_project/frontend/src/App.jsx"
click node_api "https://github.com/am1rarshad/arpspoofnewday/blob/main/ids_project/frontend/src/api.js"
click node_login "https://github.com/am1rarshad/arpspoofnewday/blob/main/ids_project/frontend/src/components/Login.jsx"
click node_overview "https://github.com/am1rarshad/arpspoofnewday/blob/main/ids_project/frontend/src/components/NetworkOverview.jsx"
click node_alerts "https://github.com/am1rarshad/arpspoofnewday/blob/main/ids_project/frontend/src/components/AlertCenter.jsx"
click node_alerttable "https://github.com/am1rarshad/arpspoofnewday/blob/main/ids_project/frontend/src/components/AlertTable.jsx"
click node_alertdetail "https://github.com/am1rarshad/arpspoofnewday/blob/main/ids_project/frontend/src/components/AlertDetailModal.jsx"
click node_account "https://github.com/am1rarshad/arpspoofnewday/blob/main/ids_project/frontend/src/components/AccountConfig.jsx"
click node_modelcontrol "https://github.com/am1rarshad/arpspoofnewday/blob/main/ids_project/frontend/src/components/ModelControl.jsx"
click node_websocket "https://github.com/am1rarshad/arpspoofnewday/blob/main/ids_project/frontend/src/hooks/useWebSocket.js"
click node_entry "https://github.com/am1rarshad/arpspoofnewday/blob/main/ids_project/frontend/src/main.jsx"

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_sniffer,node_features,node_rules toneBlue
class node_server,node_auth toneAmber
class node_app,node_api,node_login,node_overview,node_alerts,node_alerttable,node_alertdetail,node_account,node_modelcontrol,node_websocket,node_entry toneMint
class node_store,node_training,node_alertsdata toneRose
class node_network,node_operator toneIndigo
```

## Components

### Capture and detection

- [Packet sniffer](https://github.com/am1rarshad/arpspoofnewday/blob/main/ids_project/backend/sniffer.py): `ids_project/backend/sniffer.py`
- [Feature engineering](https://github.com/am1rarshad/arpspoofnewday/blob/main/ids_project/backend/features.py): `ids_project/backend/features.py`
- [Rule and ML engines](https://github.com/am1rarshad/arpspoofnewday/blob/main/ids_project/backend/engine.py): `ids_project/backend/engine.py`

### Backend services

- [API and event server](https://github.com/am1rarshad/arpspoofnewday/blob/main/ids_project/backend/main.py): `ids_project/backend/main.py`
- [Authentication](https://github.com/am1rarshad/arpspoofnewday/blob/main/ids_project/backend/auth.py): `ids_project/backend/auth.py`

### Dashboard interface

- [Dashboard shell](https://github.com/am1rarshad/arpspoofnewday/blob/main/ids_project/frontend/src/App.jsx): `ids_project/frontend/src/App.jsx`
- [HTTP client](https://github.com/am1rarshad/arpspoofnewday/blob/main/ids_project/frontend/src/api.js): `ids_project/frontend/src/api.js`
- [Login view](https://github.com/am1rarshad/arpspoofnewday/blob/main/ids_project/frontend/src/components/Login.jsx): `ids_project/frontend/src/components/Login.jsx`
- [Network overview](https://github.com/am1rarshad/arpspoofnewday/blob/main/ids_project/frontend/src/components/NetworkOverview.jsx): `ids_project/frontend/src/components/NetworkOverview.jsx`
- [Alert center](https://github.com/am1rarshad/arpspoofnewday/blob/main/ids_project/frontend/src/components/AlertCenter.jsx): `ids_project/frontend/src/components/AlertCenter.jsx`
- [Alert table](https://github.com/am1rarshad/arpspoofnewday/blob/main/ids_project/frontend/src/components/AlertTable.jsx): `ids_project/frontend/src/components/AlertTable.jsx`
- [Alert details](https://github.com/am1rarshad/arpspoofnewday/blob/main/ids_project/frontend/src/components/AlertDetailModal.jsx): `ids_project/frontend/src/components/AlertDetailModal.jsx`
- [Account settings](https://github.com/am1rarshad/arpspoofnewday/blob/main/ids_project/frontend/src/components/AccountConfig.jsx): `ids_project/frontend/src/components/AccountConfig.jsx`
- [Model controls](https://github.com/am1rarshad/arpspoofnewday/blob/main/ids_project/frontend/src/components/ModelControl.jsx): `ids_project/frontend/src/components/ModelControl.jsx`
- [WebSocket hook](https://github.com/am1rarshad/arpspoofnewday/blob/main/ids_project/frontend/src/hooks/useWebSocket.js): `ids_project/frontend/src/hooks/useWebSocket.js`
- [React entry point](https://github.com/am1rarshad/arpspoofnewday/blob/main/ids_project/frontend/src/main.jsx): `ids_project/frontend/src/main.jsx`

### Persistence and learning

- [IDS data store](https://github.com/am1rarshad/arpspoofnewday/blob/main/ids_project/backend/database.py): `ids_project/backend/database.py`
- [Model training](https://github.com/am1rarshad/arpspoofnewday/blob/main/ids_project/backend/train_model.py): `ids_project/backend/train_model.py`
- [Alert data file](https://github.com/am1rarshad/arpspoofnewday/blob/main/ids_project/backend/alerts.json): `ids_project/backend/alerts.json`

### Other components

- **ARP traffic**
- **Security operator**

## Connections

- ARP traffic → Packet sniffer: supplies packets (evidence: `ids_project/backend/sniffer.py`)
- Packet sniffer → Feature engineering: derives features (evidence: `ids_project/backend/sniffer.py`)
- Packet sniffer → Rule and ML engines: scores traffic (evidence: `ids_project/backend/sniffer.py`)
- Packet sniffer → IDS data store: reads state (evidence: `ids_project/backend/sniffer.py`)
- API and event server → Packet sniffer: starts capture (evidence: `ids_project/backend/main.py`)
- API and event server → IDS data store: records alerts (evidence: `ids_project/backend/main.py`)
- API and event server → Authentication: authenticates routes (evidence: `ids_project/backend/main.py`)
- Authentication → IDS data store: looks up users (evidence: `ids_project/backend/auth.py`)
- Rule and ML engines → Feature engineering: consumes features (evidence: `ids_project/backend/engine.py`)
- Rule and ML engines → IDS data store: loads feedback (evidence: `ids_project/backend/engine.py`)
- Model training → Feature engineering: uses feature schema (evidence: `ids_project/backend/train_model.py`)
- API and event server → Security operator: sends notifications
- Security operator → React entry point: opens dashboard (evidence: `ids_project/frontend/src/main.jsx`)
- React entry point → Dashboard shell: renders (evidence: `ids_project/frontend/src/main.jsx`)
- Dashboard shell → Login view: shows login (evidence: `ids_project/frontend/src/App.jsx`)
- Dashboard shell → Network overview: selects overview (evidence: `ids_project/frontend/src/App.jsx`)
- Dashboard shell → Alert center: selects alerts (evidence: `ids_project/frontend/src/App.jsx`)
- Dashboard shell → Account settings: selects settings (evidence: `ids_project/frontend/src/App.jsx`)
- Dashboard shell → Model controls: selects model (evidence: `ids_project/frontend/src/App.jsx`)
- Login view → HTTP client: submits credentials (evidence: `ids_project/frontend/src/components/Login.jsx`)
- Network overview → HTTP client: requests ARP table (evidence: `ids_project/frontend/src/components/NetworkOverview.jsx`)
- Network overview → WebSocket hook: subscribes metrics (evidence: `ids_project/frontend/src/components/NetworkOverview.jsx`)
- Alert center → HTTP client: loads alert data (evidence: `ids_project/frontend/src/components/AlertCenter.jsx`)
- Alert center → WebSocket hook: subscribes alerts (evidence: `ids_project/frontend/src/components/AlertCenter.jsx`)
- Alert center → Alert table: renders rows (evidence: `ids_project/frontend/src/components/AlertCenter.jsx`)
- Alert center → Alert details: opens details (evidence: `ids_project/frontend/src/components/AlertCenter.jsx`)
- Account settings → HTTP client: manages account (evidence: `ids_project/frontend/src/components/AccountConfig.jsx`)
- Model controls → HTTP client: controls retraining (evidence: `ids_project/frontend/src/components/ModelControl.jsx`)
- HTTP client → API and event server: calls API (evidence: `ids_project/frontend/src/api.js`)
- WebSocket hook → API and event server: receives live events
