# saigayathrigudla-1184/phishhh architecture

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

- Interactive diagram: https://gitdiagram.com/saigayathrigudla-1184/phishhh
- Repository: https://github.com/saigayathrigudla-1184/phishhh

## Overview

This Flask application offers two user-facing checks: URL phishing detection and email spam classification. URL submissions are expanded, analyzed into features, classified, and shown as safe or phishing; email text is vectorized, classified, and shown with the result. The central implementation is `app.py` plus `custom/feature.py`; model and vectorizer artifacts are runtime inputs. The excerpts support the main calls and several URL-analysis lookups, but do not show every feature implementation or template interaction.

Main entry points: [`app.py`](https://github.com/saigayathrigudla-1184/phishhh/blob/main/app.py) (Flask routes), [`custom/feature.py`](https://github.com/saigayathrigudla-1184/phishhh/blob/main/custom/feature.py) (URL feature extraction), [`templates`](https://github.com/saigayathrigudla-1184/phishhh/tree/main/templates) (Page templates), [`finalmodel.joblib`](https://github.com/saigayathrigudla-1184/phishhh/blob/main/finalmodel.joblib) (URL classifier)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web application"]
  node_flask["Flask routes<br/>[app.py]"]
  node_pages["Page templates"]
end

subgraph group_url["URL analysis"]
  node_urlcheck["URL feature extraction<br/>[feature.py]"]
  node_urlmodel["URL classifier<br/>[finalmodel.joblib]"]
end

subgraph group_email["Email classification"]
  node_emailmodel["Email classifier"]
end

subgraph group_assets["Prediction assets"]
  node_vectorizer["TF-IDF vectorizer"]
end

node_visitor(("Visitor"))
node_webtarget{{"Target websites"}}
node_whois{{"WHOIS service"}}
node_pagerank{{"PageRank service"}}
node_search{{"Web search"}}

node_visitor -->|"submits checks"| node_flask
node_flask -->|"renders pages"| node_pages
node_flask -->|"expands URL"| node_webtarget
node_flask -->|"extracts features"| node_urlcheck
node_urlcheck -->|"predicts URL"| node_urlmodel
node_flask -->|"transforms email"| node_vectorizer
node_flask -->|"predicts email"| node_emailmodel
node_urlcheck -->|"fetches page"| node_webtarget
node_urlcheck -->|"looks up domain"| node_whois
node_urlcheck -->|"checks rank"| node_pagerank
node_urlcheck -->|"searches URL"| node_search

click node_flask "https://github.com/saigayathrigudla-1184/phishhh/blob/main/app.py"
click node_pages "https://github.com/saigayathrigudla-1184/phishhh/tree/main/templates"
click node_urlcheck "https://github.com/saigayathrigudla-1184/phishhh/blob/main/custom/feature.py"
click node_urlmodel "https://github.com/saigayathrigudla-1184/phishhh/blob/main/finalmodel.joblib"
click node_vectorizer "https://github.com/saigayathrigudla-1184/phishhh/blob/main/tfidf_vectorizer.joblib"
click node_emailmodel "https://github.com/saigayathrigudla-1184/phishhh/blob/main/logistic_regression_model.joblib"

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_flask,node_pages toneBlue
class node_urlcheck,node_urlmodel toneAmber
class node_emailmodel toneMint
class node_vectorizer toneRose
class node_visitor,node_webtarget,node_whois,node_pagerank,node_search toneIndigo
```

## Components

### Web application

- [Flask routes](https://github.com/saigayathrigudla-1184/phishhh/blob/main/app.py): `app.py`
- [Page templates](https://github.com/saigayathrigudla-1184/phishhh/tree/main/templates): `templates`

### URL analysis

- [URL feature extraction](https://github.com/saigayathrigudla-1184/phishhh/blob/main/custom/feature.py): `custom/feature.py`
- [URL classifier](https://github.com/saigayathrigudla-1184/phishhh/blob/main/finalmodel.joblib): `finalmodel.joblib`

### Email classification

- [Email classifier](https://github.com/saigayathrigudla-1184/phishhh/blob/main/logistic_regression_model.joblib): `logistic_regression_model.joblib`

### Prediction assets

- [TF-IDF vectorizer](https://github.com/saigayathrigudla-1184/phishhh/blob/main/tfidf_vectorizer.joblib): `tfidf_vectorizer.joblib`

### Other components

- **Visitor**
- **Target websites**
- **WHOIS service**
- **PageRank service**
- **Web search**

## Connections

- Visitor → Flask routes: submits checks (evidence: `app.py`)
- Flask routes → Page templates: renders pages (evidence: `app.py`)
- Flask routes → Target websites: expands URL (evidence: `app.py`)
- Flask routes → URL feature extraction: extracts features (evidence: `app.py`)
- URL feature extraction → URL classifier: predicts URL
- Flask routes → TF-IDF vectorizer: transforms email (evidence: `app.py`)
- Flask routes → Email classifier: predicts email (evidence: `app.py`)
- URL feature extraction → Target websites: fetches page (evidence: `custom/feature.py`)
- URL feature extraction → WHOIS service: looks up domain (evidence: `custom/feature.py`)
- URL feature extraction → PageRank service: checks rank (evidence: `custom/feature.py`)
- URL feature extraction → Web search: searches URL (evidence: `custom/feature.py`)
