# iamvibhav/phisheye architecture

> Architecture diagram of the GitHub repository iamvibhav/phisheye, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-04-10). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/iamvibhav/phisheye
- Repository: https://github.com/iamvibhav/phisheye

## Overview

##### Main components
- Data Source: The project uses a CSV file (“phishing websites.csv”) and also references a Kaggle dataset for training and evaluation.
- Model Training & Analysis: Although the README describes instructions for training (via a “train.py” script and a Jupyter notebook “phisheye.ipynb”), the notebook file in the repository suggests that initial model development, data exploration, and training experiments are done interactively. This component is responsible for feature extraction, model training, and validation.
- Model Artifact: The “phishing_detection_model.pkl” file is the serialized machine learning model that is used for detection.
- Model Inference (Detection): The “phisheye.py” file functions as the detection engine, which loads the trained model and processes input URLs to determine if they are phishing sites.
- Project Documentation and Usage Instructions: The README file explains how to set up, train, and use the tool along with usage examples and external dataset pointers.

##### Relationships and interactions between the components
- The Data Source feeds into the Model Training & Analysis component where data is preprocessed, features are extracted, and the ML model is built.
- Once trained and validated, the model is saved (as shown by the .pkl file) so that it can be loaded later.
- The Model Inference component (via phisheye.py) then loads the saved model to perform detection on new input (URLs). The data flow here is linear: data collection → training → model artifact → inference.
- Optionally, the PhishEye notebook may incorporate both analytical and exploratory steps that could be shown to loop back if retraining is necessary.

##### Important architectural patterns or design principles
- Pipeline Architecture: The project follows a sequential data pipeline (data acquisition → training/analysis → model serialization → inference), which is common in machine learning projects.
- Modular Design: Each component (data, training, inference) is stored separately, which makes it easier to update or modify any part without disrupting the entire system.
- Separation of Concerns: The separation between data preprocessing/training (handled in the Jupyter notebook) and inference (handled in phisheye.py) is a key design principle.

##### Relevant technologies and frameworks
- Python: The primary programming language.
- Machine Learning Libraries (likely scikit-learn or similar): Used in the underlying training and model predictions (though not explicitly mentioned, the .pkl model hints at scikit-learn or a similar framework).
- Jupyter Notebook: For interactive development and analysis.
- CSV for data storage and Kaggle as an external data source.

##### Elements
- Clear labels: Each component (e.g., Data Source/CSV file, Jupyter Notebook for training, phisheye.py for detection, Model File) should be clearly labeled.

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "Data Acquisition"
        DS["Data Source (CSV)"]:::data
        Kaggle["Kaggle Dataset"]:::external
    end

    subgraph "Model Training & Analysis"
        NB["Jupyter Notebook (Training)"]:::process
    end

    subgraph "Model Serialization"
        MA["Pickle Model Artifact"]:::storage
    end

    subgraph "Model Inference"
        INF["Detection Script (phisheye.py)"]:::process
    end

    subgraph "Project Documentation"
        DOC["Usage Instructions (README)"]:::docstyle
    end

    DS -->|"DataPreprocessing"| NB
    Kaggle -->|"ExternalData"| NB
    NB -->|"TrainModel"| MA
    MA -->|"LoadModel"| INF
    DOC ---|"Guide"| INF

    click DS "https://github.com/iamvibhav/phisheye/blob/main/phishing websites.csv"
    click NB "https://github.com/iamvibhav/phisheye/blob/main/phisheye.ipynb"
    click MA "https://github.com/iamvibhav/phisheye/blob/main/phishing_detection_model.pkl"
    click INF "https://github.com/iamvibhav/phisheye/blob/main/phisheye.py"
    click DOC "https://github.com/iamvibhav/phisheye/blob/main/README.md"

    classDef data fill:#FFCC00,stroke:#333,stroke-width:2px;
    classDef process fill:#A2D9CE,stroke:#333,stroke-width:2px;
    classDef storage fill:#AED6F1,stroke:#333,stroke-width:2px;
    classDef external fill:#F9E79F,stroke:#333,stroke-width:2px;
    classDef docstyle fill:#D7BDE2,stroke:#333,stroke-width:2px;
```
