# salman-sensei/soc-model-tester architecture

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

- Interactive diagram: https://gitdiagram.com/salman-sensei/soc-model-tester
- Repository: https://github.com/salman-sensei/soc-model-tester

## Overview

SOC Model Tester is a local web application for interactive network-flow inference and SOC triage, alongside a notebook-based model-development workflow. Analysts load a model, submit one record or a CSV, review predictions and provisional priority, and export batch results. The README documents model-family detection and evaluation capabilities; sampled backend excerpts show model inspection, prediction, triage, and metric logic, but do not expose every route implementation. The notebook’s internal stages are documented rather than sampled here.

Main entry points: [`backend/app.py`](https://github.com/salman-sensei/soc-model-tester/blob/main/backend/app.py) (Flask API), [`frontend/src/App.jsx`](https://github.com/salman-sensei/soc-model-tester/blob/main/frontend/src/App.jsx) (React Console), [`notebooks/soc_intrusion_detection_pipeline.ipynb`](https://github.com/salman-sensei/soc-model-tester/blob/main/notebooks/soc_intrusion_detection_pipeline.ipynb) (Development Pipeline), [`soc_model.joblib`](https://github.com/salman-sensei/soc-model-tester/blob/main/soc_model.joblib) (Model Artifact)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["Analyst Interface"]
  node_web_ui["React Console<br/>[App.jsx]"]
  node_csv_input["CSV Batch Input<br/>[App.jsx]"]
  node_results["Results and Export<br/>[App.jsx]"]
end

subgraph group_inference["Inference and Triage"]
  node_api["Flask API<br/>[app.py]"]
  node_model_inspection["Model Inspection<br/>[app.py]"]
  node_model_file["Model Artifact<br/>[soc_model.joblib]"]
  node_binary["Binary Detection<br/>[app.py]"]
  node_family["Attack Family<br/>[app.py]"]
  node_triage["Triage Priority<br/>[app.py]"]
  node_csv_evaluation["Batch Evaluation<br/>[app.py]"]
end

subgraph group_development["Model Development"]
  node_notebook["Development Pipeline"]
  node_datasets["Benchmark Datasets"]
end

node_analyst(("SOC Analyst"))

node_analyst -->|"uses"| node_web_ui
node_web_ui -->|"sends requests"| node_api
node_web_ui -->|"uploads model"| node_model_inspection
node_model_inspection -->|"loads"| node_model_file
node_model_inspection -->|"reports status"| node_api
node_api -->|"predicts"| node_binary
node_api -->|"estimates family"| node_family
node_api -->|"assigns priority"| node_triage
node_csv_input -->|"submits batch"| node_api
node_api -->|"evaluates labels"| node_csv_evaluation
node_api -->|"returns predictions"| node_results
node_web_ui -->|"presents and exports"| node_results
node_datasets -->|"audits and aligns"| node_notebook
node_notebook -->|"prepares artifact"| node_model_file

click node_web_ui "https://github.com/salman-sensei/soc-model-tester/blob/main/frontend/src/App.jsx"
click node_api "https://github.com/salman-sensei/soc-model-tester/blob/main/backend/app.py"
click node_model_inspection "https://github.com/salman-sensei/soc-model-tester/blob/main/backend/app.py"
click node_model_file "https://github.com/salman-sensei/soc-model-tester/blob/main/soc_model.joblib"
click node_binary "https://github.com/salman-sensei/soc-model-tester/blob/main/backend/app.py"
click node_family "https://github.com/salman-sensei/soc-model-tester/blob/main/backend/app.py"
click node_triage "https://github.com/salman-sensei/soc-model-tester/blob/main/backend/app.py"
click node_csv_input "https://github.com/salman-sensei/soc-model-tester/blob/main/frontend/src/App.jsx"
click node_csv_evaluation "https://github.com/salman-sensei/soc-model-tester/blob/main/backend/app.py"
click node_results "https://github.com/salman-sensei/soc-model-tester/blob/main/frontend/src/App.jsx"
click node_notebook "https://github.com/salman-sensei/soc-model-tester/blob/main/notebooks/soc_intrusion_detection_pipeline.ipynb"

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_web_ui,node_csv_input,node_results toneBlue
class node_api,node_model_inspection,node_model_file,node_binary,node_family,node_triage,node_csv_evaluation toneAmber
class node_notebook,node_datasets toneMint
class node_analyst toneIndigo
```

## Components

### Analyst Interface

- [React Console](https://github.com/salman-sensei/soc-model-tester/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [CSV Batch Input](https://github.com/salman-sensei/soc-model-tester/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Results and Export](https://github.com/salman-sensei/soc-model-tester/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`

### Inference and Triage

- [Flask API](https://github.com/salman-sensei/soc-model-tester/blob/main/backend/app.py): `backend/app.py`
- [Model Inspection](https://github.com/salman-sensei/soc-model-tester/blob/main/backend/app.py): `backend/app.py`
- [Model Artifact](https://github.com/salman-sensei/soc-model-tester/blob/main/soc_model.joblib): `soc_model.joblib`
- [Binary Detection](https://github.com/salman-sensei/soc-model-tester/blob/main/backend/app.py): `backend/app.py`
- [Attack Family](https://github.com/salman-sensei/soc-model-tester/blob/main/backend/app.py): `backend/app.py`
- [Triage Priority](https://github.com/salman-sensei/soc-model-tester/blob/main/backend/app.py): `backend/app.py`
- [Batch Evaluation](https://github.com/salman-sensei/soc-model-tester/blob/main/backend/app.py): `backend/app.py`

### Model Development

- [Development Pipeline](https://github.com/salman-sensei/soc-model-tester/blob/main/notebooks/soc_intrusion_detection_pipeline.ipynb): `notebooks/soc_intrusion_detection_pipeline.ipynb`
- **Benchmark Datasets**

### Other components

- **SOC Analyst**

## Connections

- SOC Analyst → React Console: uses (evidence: `README.md`)
- React Console → Flask API: sends requests (evidence: `README.md`)
- React Console → Model Inspection: uploads model (evidence: `README.md`)
- Model Inspection → Model Artifact: loads (evidence: `README.md`)
- Model Inspection → Flask API: reports status (evidence: `backend/app.py`)
- Flask API → Binary Detection: predicts (evidence: `backend/app.py`)
- Flask API → Attack Family: estimates family (evidence: `README.md`)
- Flask API → Triage Priority: assigns priority (evidence: `backend/app.py`)
- CSV Batch Input → Flask API: submits batch (evidence: `README.md`)
- Flask API → Batch Evaluation: evaluates labels (evidence: `backend/app.py`)
- Flask API → Results and Export: returns predictions (evidence: `README.md`)
- React Console → Results and Export: presents and exports (evidence: `frontend/src/App.jsx`)
- Benchmark Datasets → Development Pipeline: audits and aligns (evidence: `README.md`)
- Development Pipeline → Model Artifact: prepares artifact (evidence: `README.md`)
