# aditi012345/packetpulse architecture

> Architecture diagram of the GitHub repository aditi012345/packetpulse, 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/aditi012345/packetpulse
- Repository: https://github.com/aditi012345/packetpulse

## Overview

SentinelNet is a Streamlit network-intrusion detection dashboard with two user workflows: score uploaded traffic data using a selected dataset/model, or capture live IP traffic and score reconstructed flows with the CICIDS XGBoost model. The live path extracts bidirectional flow features before inference; both paths use shared model-loading and prediction helpers. The graph also shows the saved model artifacts. The README describes the NIDS goal, but sampled files do not establish training or deployment workflows beyond these scoring paths.

Main entry points: [`utils/live_flow_predictor.py`](https://github.com/aditi012345/packetpulse/blob/main/utils/live_flow_predictor.py) (Live Capture Scoring), [`app.py`](https://github.com/aditi012345/packetpulse/blob/main/app.py) (Streamlit Dashboard), [`utils/model_loader.py`](https://github.com/aditi012345/packetpulse/blob/main/utils/model_loader.py) (Model Loader), [`utils/predictions.py`](https://github.com/aditi012345/packetpulse/blob/main/utils/predictions.py) (Prediction Helper)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["Dashboard"]
  node_dashboard["Streamlit Dashboard<br/>[app.py]"]
  node_offline["CSV Scoring<br/>[app.py]"]
  node_live["Live Capture Scoring"]
end

subgraph group_analysis["Traffic Analysis"]
  node_flow_features["Flow Feature Extraction"]
  node_verdicts["Threat Verdicts"]
end

subgraph group_models["Models"]
  node_model_loader["Model Loader<br/>[model_loader.py]"]
  node_prediction["Prediction Helper<br/>[predictions.py]"]
  node_artifacts["Saved Models"]
end

node_operator(("Analyst"))
node_network(("IP Traffic"))

node_operator -->|"selects mode"| node_dashboard
node_dashboard -->|"routes CSV scoring"| node_offline
node_dashboard -->|"starts capture"| node_live
node_network -->|"supplies packets"| node_live
node_live -->|"extracts features"| node_flow_features
node_live -->|"loads model"| node_model_loader
node_live -->|"predicts flows"| node_prediction
node_live -->|"builds verdicts"| node_verdicts
node_offline -->|"loads model"| node_model_loader
node_offline -->|"predicts rows"| node_prediction
node_model_loader -->|"reads pickle"| node_artifacts

click node_dashboard "https://github.com/aditi012345/packetpulse/blob/main/app.py"
click node_offline "https://github.com/aditi012345/packetpulse/blob/main/app.py"
click node_live "https://github.com/aditi012345/packetpulse/blob/main/utils/live_flow_predictor.py"
click node_flow_features "https://github.com/aditi012345/packetpulse/blob/main/utils/cicids_flow_features.py"
click node_model_loader "https://github.com/aditi012345/packetpulse/blob/main/utils/model_loader.py"
click node_prediction "https://github.com/aditi012345/packetpulse/blob/main/utils/predictions.py"
click node_artifacts "https://github.com/aditi012345/packetpulse/tree/main/models"
click node_verdicts "https://github.com/aditi012345/packetpulse/blob/main/utils/live_flow_predictor.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_dashboard,node_offline,node_live toneBlue
class node_flow_features,node_verdicts toneAmber
class node_model_loader,node_prediction,node_artifacts toneMint
class node_operator,node_network toneIndigo
```

## Components

### Dashboard

- [Streamlit Dashboard](https://github.com/aditi012345/packetpulse/blob/main/app.py): `app.py`
- [CSV Scoring](https://github.com/aditi012345/packetpulse/blob/main/app.py): `app.py`
- [Live Capture Scoring](https://github.com/aditi012345/packetpulse/blob/main/utils/live_flow_predictor.py): `utils/live_flow_predictor.py`

### Traffic Analysis

- [Flow Feature Extraction](https://github.com/aditi012345/packetpulse/blob/main/utils/cicids_flow_features.py): `utils/cicids_flow_features.py`
- [Threat Verdicts](https://github.com/aditi012345/packetpulse/blob/main/utils/live_flow_predictor.py): `utils/live_flow_predictor.py`

### Models

- [Model Loader](https://github.com/aditi012345/packetpulse/blob/main/utils/model_loader.py): `utils/model_loader.py`
- [Prediction Helper](https://github.com/aditi012345/packetpulse/blob/main/utils/predictions.py): `utils/predictions.py`
- [Saved Models](https://github.com/aditi012345/packetpulse/tree/main/models): `models`

### Other components

- **Analyst**
- **IP Traffic**

## Connections

- Analyst → Streamlit Dashboard: selects mode (evidence: `app.py`)
- Streamlit Dashboard → CSV Scoring: routes CSV scoring (evidence: `app.py`)
- Streamlit Dashboard → Live Capture Scoring: starts capture (evidence: `app.py`)
- IP Traffic → Live Capture Scoring: supplies packets (evidence: `utils/live_flow_predictor.py`)
- Live Capture Scoring → Flow Feature Extraction: extracts features (evidence: `utils/live_flow_predictor.py`)
- Live Capture Scoring → Model Loader: loads model (evidence: `utils/live_flow_predictor.py`)
- Live Capture Scoring → Prediction Helper: predicts flows (evidence: `utils/live_flow_predictor.py`)
- Live Capture Scoring → Threat Verdicts: builds verdicts (evidence: `utils/live_flow_predictor.py`)
- CSV Scoring → Model Loader: loads model (evidence: `app.py`)
- CSV Scoring → Prediction Helper: predicts rows (evidence: `app.py`)
- Model Loader → Saved Models: reads pickle (evidence: `utils/model_loader.py`)
