# daudibrahimdev/phishguard architecture

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

- Interactive diagram: https://gitdiagram.com/daudibrahimdev/phishguard
- Repository: https://github.com/daudibrahimdev/phishguard

## Overview

PhishGuard is presented as a phishing-detection browser extension, but the available README provides only its name and several extension components are explicitly marked as pending. The implemented core extracts 15 URL/DOM signals, using shared domain and string utilities, and a separate module converts feature arrays into a heuristic risk score. The tree also contains threat-list data and popup assets, but their wiring and behavior are not evidenced in the sampled files. The graph therefore shows only the confirmed utility call and treats the remaining extension surfaces as unverified components.

Main entry points: [`core/feature_extractor.js`](https://github.com/daudibrahimdev/phishguard/blob/main/core/feature_extractor.js) (Feature Extractor), [`core/utils.js`](https://github.com/daudibrahimdev/phishguard/blob/main/core/utils.js) (Domain Utilities)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_analysis["Detection Core"]
  node_feature_extractor["Feature Extractor"]
  node_utils["Domain Utilities<br/>[utils.js]"]
  node_ml_model["Risk Scorer<br/>[ml_model.js]"]
end

subgraph group_extension["Extension Surfaces"]
  node_service_worker["Background Worker<br/>[service_worker.js]"]
  node_isolated_content["Isolated Content"]
  node_main_content["Main-World Blocker<br/>[content_main.js]"]
  node_popup["Popup Controller<br/>[popup.js]"]
  node_popup_view["Popup Assets<br/>[popup.html]"]
end

subgraph group_data["Threat Data"]
  node_blacklist["Domain Blacklist"]
  node_threat_rules["Threat Rules<br/>[threat_rules.json]"]
  node_whitelist["Domain Whitelist"]
end

node_feature_extractor -->|"calls domain helpers"| node_utils

click node_feature_extractor "https://github.com/daudibrahimdev/phishguard/blob/main/core/feature_extractor.js"
click node_utils "https://github.com/daudibrahimdev/phishguard/blob/main/core/utils.js"
click node_ml_model "https://github.com/daudibrahimdev/phishguard/blob/main/core/ml_model.js"
click node_service_worker "https://github.com/daudibrahimdev/phishguard/blob/main/background/service_worker.js"
click node_isolated_content "https://github.com/daudibrahimdev/phishguard/blob/main/content/content_isolated.js"
click node_main_content "https://github.com/daudibrahimdev/phishguard/blob/main/content/content_main.js"
click node_popup "https://github.com/daudibrahimdev/phishguard/blob/main/ui/popup.js"
click node_popup_view "https://github.com/daudibrahimdev/phishguard/blob/main/ui/popup.html"
click node_blacklist "https://github.com/daudibrahimdev/phishguard/blob/main/data/blacklist_domains.json"
click node_threat_rules "https://github.com/daudibrahimdev/phishguard/blob/main/data/threat_rules.json"
click node_whitelist "https://github.com/daudibrahimdev/phishguard/blob/main/data/whitelist_domains.json"

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_feature_extractor,node_utils,node_ml_model toneBlue
class node_service_worker,node_isolated_content,node_main_content,node_popup,node_popup_view toneAmber
class node_blacklist,node_threat_rules,node_whitelist toneMint
```

## Components

### Detection Core

- [Feature Extractor](https://github.com/daudibrahimdev/phishguard/blob/main/core/feature_extractor.js): `core/feature_extractor.js`
- [Domain Utilities](https://github.com/daudibrahimdev/phishguard/blob/main/core/utils.js): `core/utils.js`
- [Risk Scorer](https://github.com/daudibrahimdev/phishguard/blob/main/core/ml_model.js): `core/ml_model.js`

### Extension Surfaces

- [Background Worker](https://github.com/daudibrahimdev/phishguard/blob/main/background/service_worker.js): `background/service_worker.js`
- [Isolated Content](https://github.com/daudibrahimdev/phishguard/blob/main/content/content_isolated.js): `content/content_isolated.js`
- [Main-World Blocker](https://github.com/daudibrahimdev/phishguard/blob/main/content/content_main.js): `content/content_main.js`
- [Popup Controller](https://github.com/daudibrahimdev/phishguard/blob/main/ui/popup.js): `ui/popup.js`
- [Popup Assets](https://github.com/daudibrahimdev/phishguard/blob/main/ui/popup.html): `ui/popup.html`

### Threat Data

- [Domain Blacklist](https://github.com/daudibrahimdev/phishguard/blob/main/data/blacklist_domains.json): `data/blacklist_domains.json`
- [Threat Rules](https://github.com/daudibrahimdev/phishguard/blob/main/data/threat_rules.json): `data/threat_rules.json`
- [Domain Whitelist](https://github.com/daudibrahimdev/phishguard/blob/main/data/whitelist_domains.json): `data/whitelist_domains.json`

## Connections

- Feature Extractor → Domain Utilities: calls domain helpers (evidence: `core/feature_extractor.js`)
