# mayadispeler/firewall-threat-detection architecture

> Architecture diagram of the GitHub repository mayadispeler/firewall-threat-detection, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-08-11). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/mayadispeler/firewall-threat-detection
- Repository: https://github.com/mayadispeler/firewall-threat-detection

## Overview

##### Project type and purpose
- This is a data-science / small analytics application with a Streamlit dashboard front-end. Its primary goal is to process raw firewall logs, run an anomaly-detection model (Isolation Forest), and expose the results in an interactive UI for analysts.

##### File structure
- Top‐level files:
- 01_data_eda.ipynb, 02_model.ipynb – exploratory data analysis & model‐training notebooks
- Approach.md – detailed pipeline steps
- dashboard.py – Streamlit script powering the UI
- data_synthesis.py – script to generate or preprocess the dataset
- requirements.txt – Python dependencies
- model.joblib (generated) – serialized trained model
- No separate “src” or “backend” folder; scripts and notebooks coexist at root.

##### README for additional insights
- Confirms a 3-step pipeline: EDA → model build (Isolation Forest) → dashboard display
- Mentions environment setup, package list, and commands to rerun pipeline or re-generate data.

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Data Source
    DataSource["Firewall Logs\nCSV/JSON"]:::data

    subgraph "ML Pipeline"
        direction TB
        Preprocess["Data Preprocessing & Synthesis\ndata_synthesis.py"]:::compute
        CleanedData["Cleaned Dataset"]:::data
        EDA["Exploratory Data Analysis\n01_data_eda.ipynb"]:::compute
        Training["Model Training\nIsolation Forest\n02_model.ipynb"]:::compute
        ModelRepo["Model Artifact\nmodel.joblib"]:::artifact

        DataSource --> Preprocess
        Preprocess --> CleanedData
        CleanedData --> EDA
        CleanedData --> Training
        Training --> ModelRepo
    end

    %% Dashboard & User
    Dashboard["Dashboard Application\nStreamlit\ndashboard.py"]:::ui
    User["End User / Analyst\n(Web Browser)"]:::ui

    DataSource --> Dashboard
    ModelRepo --> Dashboard
    Dashboard --> User

    %% Documentation & Dependencies
    Docs["Pipeline Spec & Documentation\nApproach.md"]:::docs
    Deps["Dependency Management\nrequirements.txt"]:::deps

    Docs --> Preprocess
    Docs --> EDA
    Docs --> Training
    Deps --> Preprocess
    Deps --> EDA
    Deps --> Training
    Deps --> Dashboard

    %% Legend
    subgraph Legend
        direction TB
        D1["Data (blue)"]:::data
        C1["Compute (green)"]:::compute
        A1["Artifact (yellow)"]:::artifact
        U1["UI/UX (orange)"]:::ui
        X1["Docs (purple)"]:::docs
        X2["Deps (gray)"]:::deps
    end

    %% Click Events
    click Preprocess "https://github.com/mayadispeler/firewall-threat-detection/blob/main/data_synthesis.py"
    click EDA "https://github.com/mayadispeler/firewall-threat-detection/blob/main/01_data_eda.ipynb"
    click Training "https://github.com/mayadispeler/firewall-threat-detection/blob/main/02_model.ipynb"
    click ModelRepo "https://github.com/mayadispeler/firewall-threat-detection/blob/main/model.joblib"
    click Dashboard "https://github.com/mayadispeler/firewall-threat-detection/blob/main/dashboard.py"
    click Docs "https://github.com/mayadispeler/firewall-threat-detection/blob/main/Approach.md"
    click Deps "https://github.com/mayadispeler/firewall-threat-detection/blob/main/requirements.txt"

    %% Styles
    classDef data fill:#AED6F1,stroke:#1B4F72,color:#000;
    classDef compute fill:#A9DFBF,stroke:#196F3D,color:#000;
    classDef artifact fill:#F9E79F,stroke:#7D6608,color:#000;
    classDef ui fill:#F5B7B1,stroke:#7E5109,color:#000;
    classDef docs fill:#D2B4DE,stroke:#512E5F,color:#000;
    classDef deps fill:#D5DBDB,stroke:#626567,color:#000;
```
