# adhithiya-77/phishing-website-detection architecture

> Architecture diagram of the GitHub repository adhithiya-77/phishing-website-detection, 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/adhithiya-77/phishing-website-detection
- Repository: https://github.com/adhithiya-77/phishing-website-detection

## Overview

This is a Flask-based phishing-URL screening application. A user submits a URL; the server normalizes and validates it, checks whether the destination responds, and—if reachable—runs URL-feature extraction, model classification, and additional security checks before rendering an assessment. The browser enhances the result display and stores recent checks locally. The README documents this staged workflow; source excerpts confirm the server-side orchestration and prediction components. Some prediction internals are only partially excerpted, so edges between their stages are limited to documented or visible relationships.

Main entry points: [`app.py`](https://github.com/adhithiya-77/phishing-website-detection/blob/main/app.py) (Flask workflow), [`predict.py`](https://github.com/adhithiya-77/phishing-website-detection/blob/main/predict.py) (Prediction workflow), [`templates/index.html`](https://github.com/adhithiya-77/phishing-website-detection/blob/main/templates/index.html) (Analysis page), [`static/app.js`](https://github.com/adhithiya-77/phishing-website-detection/blob/main/static/app.js) (Interactive interface)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web experience"]
  node_web_ui["Analysis page<br/>[index.html]"]
  node_browser_ui["Interactive interface<br/>[app.js]"]
  node_recent_checks[("Recent checks<br/>[app.js]")]
end

subgraph group_server["Request handling"]
  node_flask["Flask workflow<br/>[app.py]"]
  node_url_validation["URL validation<br/>[predict.py]"]
  node_availability["Availability check<br/>[app.py]"]
end

subgraph group_analysis["Detection analysis"]
  node_prediction["Prediction workflow<br/>[predict.py]"]
  node_features["URL features"]
  node_classifier["ML classifier<br/>[predict.py]"]
  node_security_rules["Security checks<br/>[predict.py]"]
end

subgraph group_state["Model and browser state"]
  node_model_file["Trained model<br/>[phishing_model.pkl]"]
  node_feature_names["Feature names<br/>[feature_names.pkl]"]
end

node_user(("URL submitter"))
node_remote_site(("Submitted website"))

node_user -->|"enters URL"| node_web_ui
node_web_ui -->|"submits form"| node_flask
node_flask -->|"validates URL"| node_url_validation
node_flask -->|"checks availability"| node_availability
node_availability -->|"requests URL"| node_remote_site
node_flask -->|"analyzes reachable URL"| node_prediction
node_prediction -->|"extracts features"| node_features
node_prediction -->|"classifies URL"| node_classifier
node_classifier -->|"loads model"| node_model_file
node_classifier -.->|"uses feature names"| node_feature_names
node_prediction -->|"runs security checks"| node_security_rules
node_flask -->|"renders assessment"| node_web_ui
node_web_ui -->|"provides result data"| node_browser_ui
node_browser_ui -->|"stores recent results"| node_recent_checks

click node_web_ui "https://github.com/adhithiya-77/phishing-website-detection/blob/main/templates/index.html"
click node_browser_ui "https://github.com/adhithiya-77/phishing-website-detection/blob/main/static/app.js"
click node_recent_checks "https://github.com/adhithiya-77/phishing-website-detection/blob/main/static/app.js"
click node_flask "https://github.com/adhithiya-77/phishing-website-detection/blob/main/app.py"
click node_url_validation "https://github.com/adhithiya-77/phishing-website-detection/blob/main/predict.py"
click node_availability "https://github.com/adhithiya-77/phishing-website-detection/blob/main/app.py"
click node_prediction "https://github.com/adhithiya-77/phishing-website-detection/blob/main/predict.py"
click node_features "https://github.com/adhithiya-77/phishing-website-detection/blob/main/feature_extractor.py"
click node_classifier "https://github.com/adhithiya-77/phishing-website-detection/blob/main/predict.py"
click node_security_rules "https://github.com/adhithiya-77/phishing-website-detection/blob/main/predict.py"
click node_model_file "https://github.com/adhithiya-77/phishing-website-detection/blob/main/phishing_model.pkl"
click node_feature_names "https://github.com/adhithiya-77/phishing-website-detection/blob/main/feature_names.pkl"

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_browser_ui,node_recent_checks toneBlue
class node_flask,node_url_validation,node_availability toneAmber
class node_prediction,node_features,node_classifier,node_security_rules toneMint
class node_model_file,node_feature_names toneRose
class node_user,node_remote_site toneIndigo
```

## Components

### Web experience

- [Analysis page](https://github.com/adhithiya-77/phishing-website-detection/blob/main/templates/index.html): `templates/index.html`
- [Interactive interface](https://github.com/adhithiya-77/phishing-website-detection/blob/main/static/app.js): `static/app.js`
- [Recent checks](https://github.com/adhithiya-77/phishing-website-detection/blob/main/static/app.js): `static/app.js`

### Request handling

- [Flask workflow](https://github.com/adhithiya-77/phishing-website-detection/blob/main/app.py): `app.py`
- [URL validation](https://github.com/adhithiya-77/phishing-website-detection/blob/main/predict.py): `predict.py`
- [Availability check](https://github.com/adhithiya-77/phishing-website-detection/blob/main/app.py): `app.py`

### Detection analysis

- [Prediction workflow](https://github.com/adhithiya-77/phishing-website-detection/blob/main/predict.py): `predict.py`
- [URL features](https://github.com/adhithiya-77/phishing-website-detection/blob/main/feature_extractor.py): `feature_extractor.py`
- [ML classifier](https://github.com/adhithiya-77/phishing-website-detection/blob/main/predict.py): `predict.py`
- [Security checks](https://github.com/adhithiya-77/phishing-website-detection/blob/main/predict.py): `predict.py`

### Model and browser state

- [Trained model](https://github.com/adhithiya-77/phishing-website-detection/blob/main/phishing_model.pkl): `phishing_model.pkl`
- [Feature names](https://github.com/adhithiya-77/phishing-website-detection/blob/main/feature_names.pkl): `feature_names.pkl`

### Other components

- **URL submitter**
- **Submitted website**

## Connections

- URL submitter → Analysis page: enters URL (evidence: `README.md`)
- Analysis page → Flask workflow: submits form (evidence: `app.py`)
- Flask workflow → URL validation: validates URL (evidence: `app.py`)
- Flask workflow → Availability check: checks availability (evidence: `app.py`)
- Availability check → Submitted website: requests URL (evidence: `app.py`)
- Flask workflow → Prediction workflow: analyzes reachable URL (evidence: `app.py`)
- Prediction workflow → URL features: extracts features (evidence: `predict.py`)
- Prediction workflow → ML classifier: classifies URL (evidence: `README.md`)
- ML classifier → Trained model: loads model (evidence: `predict.py`)
- ML classifier → Feature names: uses feature names
- Prediction workflow → Security checks: runs security checks (evidence: `predict.py`)
- Flask workflow → Analysis page: renders assessment (evidence: `app.py`)
- Analysis page → Interactive interface: provides result data (evidence: `static/app.js`)
- Interactive interface → Recent checks: stores recent results (evidence: `static/app.js`)
