# ranatashad92/sentinix architecture

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

- Interactive diagram: https://gitdiagram.com/ranatashad92/sentinix
- Repository: https://github.com/ranatashad92/sentinix

## Overview

Sentinix is a mobile phishing-URL scanner: a user submits a URL, the backend scores its URL structure with two ML models and checks threat-intelligence services, then returns a verdict and explanation for display and local history. The README also describes model-comparison and structural-analysis visualizations, privacy information, and three verdict levels. The scan handler and client hook are sampled; some backend internals and screen wiring are only partially shown, so uncertain calls are omitted.

Main entry points: [`phishing-detector-app/src/app/index.tsx`](https://github.com/ranatashad92/sentinix/blob/main/phishing-detector-app/src/app/index.tsx) (Scanner screen), [`phishing-detector/src/api.py`](https://github.com/ranatashad92/sentinix/blob/main/phishing-detector/src/api.py) (Scan API), [`phishing-detector-app/src/hooks/useScanner.ts`](https://github.com/ranatashad92/sentinix/blob/main/phishing-detector-app/src/hooks/useScanner.ts) (Scan client), [`phishing-detector-app/src/components/ScanResult.tsx`](https://github.com/ranatashad92/sentinix/blob/main/phishing-detector-app/src/components/ScanResult.tsx) (Verdict display)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_mobile["Mobile app"]
  node_home["Scanner screen<br/>[index.tsx]"]
  node_scanner["Scan client<br/>[useScanner.ts]"]
  node_antibot["Client protection<br/>[antiBot.ts]"]
  node_result["Verdict display<br/>[ScanResult.tsx]"]
  node_risk["Risk gauge<br/>[RiskGauge.tsx]"]
  node_features_ui["Feature charts"]
  node_model_chart["Model comparison<br/>[ModelLineChart.tsx]"]
  node_privacy["Privacy information"]
end

subgraph group_backend["Scan backend"]
  node_api["Scan API<br/>[api.py]"]
end

subgraph group_detection["Detection system"]
  node_extract["URL features<br/>[features.py]"]
  node_models["Dual ML models"]
  node_virustotal["VirusTotal"]
  node_safebrowsing["Safe Browsing"]
end

subgraph group_history["Scan history"]
  node_history_ui["History view<br/>[index.tsx]"]
  node_storage["History storage<br/>[storage.ts]"]
  node_async_storage[("Device storage")]
end

node_user(("Mobile user"))

node_user -->|"enters URL"| node_home
node_home -->|"starts scan"| node_scanner
node_scanner -->|"checks limit; signs"| node_antibot
node_scanner -->|"posts URL"| node_api
node_api -->|"extracts features"| node_extract
node_api -->|"loads; predicts"| node_models
node_api -.->|"checks URL"| node_virustotal
node_api -.->|"checks URL"| node_safebrowsing
node_api -->|"returns verdict"| node_scanner
node_scanner -->|"provides result"| node_result
node_result -->|"shows score"| node_risk
node_result -->|"shows features"| node_features_ui
node_home -->|"shows model data"| node_model_chart
node_home -->|"opens policy"| node_privacy
node_scanner -->|"saves scan"| node_storage
node_home -->|"loads; clears"| node_storage
node_storage -->|"reads; writes"| node_async_storage
node_home -->|"shows history"| node_history_ui

click node_home "https://github.com/ranatashad92/sentinix/blob/main/phishing-detector-app/src/app/index.tsx"
click node_scanner "https://github.com/ranatashad92/sentinix/blob/main/phishing-detector-app/src/hooks/useScanner.ts"
click node_antibot "https://github.com/ranatashad92/sentinix/blob/main/phishing-detector-app/src/utils/antiBot.ts"
click node_result "https://github.com/ranatashad92/sentinix/blob/main/phishing-detector-app/src/components/ScanResult.tsx"
click node_risk "https://github.com/ranatashad92/sentinix/blob/main/phishing-detector-app/src/components/RiskGauge.tsx"
click node_features_ui "https://github.com/ranatashad92/sentinix/blob/main/phishing-detector-app/src/components/StructuralFeatureCharts.tsx"
click node_model_chart "https://github.com/ranatashad92/sentinix/blob/main/phishing-detector-app/src/components/ModelLineChart.tsx"
click node_privacy "https://github.com/ranatashad92/sentinix/blob/main/phishing-detector-app/src/components/PrivacyPolicyModal.tsx"
click node_api "https://github.com/ranatashad92/sentinix/blob/main/phishing-detector/src/api.py"
click node_extract "https://github.com/ranatashad92/sentinix/blob/main/phishing-detector/src/features.py"
click node_models "https://github.com/ranatashad92/sentinix/tree/main/phishing-detector/models"
click node_history_ui "https://github.com/ranatashad92/sentinix/blob/main/phishing-detector-app/src/app/index.tsx"
click node_storage "https://github.com/ranatashad92/sentinix/blob/main/phishing-detector-app/src/utils/storage.ts"

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_home,node_scanner,node_antibot,node_result,node_risk,node_features_ui,node_model_chart,node_privacy,node_user toneBlue
class node_api toneAmber
class node_extract,node_models,node_virustotal,node_safebrowsing toneMint
class node_history_ui,node_storage,node_async_storage toneRose
```

## Components

### Mobile app

- [Scanner screen](https://github.com/ranatashad92/sentinix/blob/main/phishing-detector-app/src/app/index.tsx): `phishing-detector-app/src/app/index.tsx`
- [Scan client](https://github.com/ranatashad92/sentinix/blob/main/phishing-detector-app/src/hooks/useScanner.ts): `phishing-detector-app/src/hooks/useScanner.ts`
- [Client protection](https://github.com/ranatashad92/sentinix/blob/main/phishing-detector-app/src/utils/antiBot.ts): `phishing-detector-app/src/utils/antiBot.ts`
- [Verdict display](https://github.com/ranatashad92/sentinix/blob/main/phishing-detector-app/src/components/ScanResult.tsx): `phishing-detector-app/src/components/ScanResult.tsx`
- [Risk gauge](https://github.com/ranatashad92/sentinix/blob/main/phishing-detector-app/src/components/RiskGauge.tsx): `phishing-detector-app/src/components/RiskGauge.tsx`
- [Feature charts](https://github.com/ranatashad92/sentinix/blob/main/phishing-detector-app/src/components/StructuralFeatureCharts.tsx): `phishing-detector-app/src/components/StructuralFeatureCharts.tsx`
- [Model comparison](https://github.com/ranatashad92/sentinix/blob/main/phishing-detector-app/src/components/ModelLineChart.tsx): `phishing-detector-app/src/components/ModelLineChart.tsx`
- [Privacy information](https://github.com/ranatashad92/sentinix/blob/main/phishing-detector-app/src/components/PrivacyPolicyModal.tsx): `phishing-detector-app/src/components/PrivacyPolicyModal.tsx`

### Scan backend

- [Scan API](https://github.com/ranatashad92/sentinix/blob/main/phishing-detector/src/api.py): `phishing-detector/src/api.py`

### Detection system

- [URL features](https://github.com/ranatashad92/sentinix/blob/main/phishing-detector/src/features.py): `phishing-detector/src/features.py`
- [Dual ML models](https://github.com/ranatashad92/sentinix/tree/main/phishing-detector/models): `phishing-detector/models`
- **VirusTotal**
- **Safe Browsing**

### Scan history

- [History view](https://github.com/ranatashad92/sentinix/blob/main/phishing-detector-app/src/app/index.tsx): `phishing-detector-app/src/app/index.tsx`
- [History storage](https://github.com/ranatashad92/sentinix/blob/main/phishing-detector-app/src/utils/storage.ts): `phishing-detector-app/src/utils/storage.ts`
- **Device storage**

### Other components

- **Mobile user**

## Connections

- Mobile user → Scanner screen: enters URL
- Scanner screen → Scan client: starts scan
- Scan client → Client protection: checks limit; signs
- Scan client → Scan API: posts URL
- Scan API → URL features: extracts features
- Scan API → Dual ML models: loads; predicts
- Scan API → VirusTotal: checks URL
- Scan API → Safe Browsing: checks URL
- Scan API → Scan client: returns verdict
- Scan client → Verdict display: provides result
- Verdict display → Risk gauge: shows score
- Verdict display → Feature charts: shows features
- Scanner screen → Model comparison: shows model data
- Scanner screen → Privacy information: opens policy
- Scan client → History storage: saves scan
- Scanner screen → History storage: loads; clears
- History storage → Device storage: reads; writes
- Scanner screen → History view: shows history
