# manishpradhan50/netarmor-ai architecture

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

- Interactive diagram: https://gitdiagram.com/manishpradhan50/netarmor-ai
- Repository: https://github.com/manishpradhan50/netarmor-ai

## Overview

NetArmor AI is a phishing-detection product spanning browser and web interfaces, a FastAPI service, and ML/domain-analysis logic. The main workflow is a user submitting a URL, email, message, or PDF through a scanner; the API analyzes it and returns a risk assessment for display. The web application also provides accounts, scan history, dashboards, and administrator operations backed by Firebase. The graph reflects README-documented capabilities where frontend/API implementation excerpts were not available; those links are cited to the README.

Main entry points: [`backend/app.py`](https://github.com/manishpradhan50/netarmor-ai/blob/main/backend/app.py) (FastAPI Service), [`frontend/login.js`](https://github.com/manishpradhan50/netarmor-ai/blob/main/frontend/login.js) (Authentication UI), [`frontend/detect.js`](https://github.com/manishpradhan50/netarmor-ai/blob/main/frontend/detect.js) (Scanner Hub), [`chrome_extension/popup.js`](https://github.com/manishpradhan50/netarmor-ai/blob/main/chrome_extension/popup.js) (Chrome Scanner)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_clients["User Interfaces"]
  node_web_scanner["Scanner Hub<br/>[detect.js]"]
  node_browser_extension["Chrome Scanner<br/>[popup.js]"]
  node_user_dashboard["User Dashboard<br/>[dashboard.js]"]
  node_admin_console["Admin Console<br/>[admin-dashboard.js]"]
end

subgraph group_service["Detection Service"]
  node_api["FastAPI Service<br/>[app.py]"]
  node_url_scan["URL Scanner<br/>[app.py]"]
  node_email_scan["Email Scanner<br/>[app.py]"]
  node_message_scan["Message Scanner<br/>[app.py]"]
  node_document_scan["PDF Scanner<br/>[app.py]"]
  node_assistant["ArmorBot<br/>[app.py]"]
end

subgraph group_analysis["Analysis Engines"]
  node_url_features["URL Features<br/>[url_features.py]"]
  node_domain_intel["Domain Intelligence<br/>[domain_analysis.py]"]
  node_email_model["Email Classifier<br/>[email_model.pkl]"]
  node_tfidf["TF-IDF Vectorizer"]
  node_url_model["URL Classifier<br/>[url_model.pkl]"]
end

subgraph group_accounts["Accounts and Operations"]
  node_login["Authentication UI<br/>[login.js]"]
  node_firebase_auth["Firebase Auth"]
  node_firestore[("Cloud Firestore")]
end

node_user(("User"))
node_gemini["Gemini API"]

node_user -->|"submits scans"| node_web_scanner
node_user -->|"scans content"| node_browser_extension
node_web_scanner -->|"requests analysis"| node_api
node_browser_extension -->|"posts scans"| node_api
node_api -->|"routes URL"| node_url_scan
node_api -->|"routes email"| node_email_scan
node_api -->|"routes message"| node_message_scan
node_api -->|"routes PDF"| node_document_scan
node_api -->|"routes chat"| node_assistant
node_url_scan -->|"extracts features"| node_url_features
node_url_scan -->|"assesses domains"| node_domain_intel
node_url_scan -.->|"predicts risk"| node_url_model
node_email_scan -->|"vectorizes text"| node_tfidf
node_email_scan -->|"classifies text"| node_email_model
node_assistant -->|"requests response"| node_gemini
node_user -->|"signs in"| node_login
node_login -->|"authenticates"| node_firebase_auth
node_login -->|"reads profiles"| node_firestore
node_user_dashboard -->|"reads scan history"| node_firestore
node_admin_console -->|"manages operations"| node_firestore
node_user -->|"views results"| node_user_dashboard

click node_web_scanner "https://github.com/manishpradhan50/netarmor-ai/blob/main/frontend/detect.js"
click node_browser_extension "https://github.com/manishpradhan50/netarmor-ai/blob/main/chrome_extension/popup.js"
click node_user_dashboard "https://github.com/manishpradhan50/netarmor-ai/blob/main/frontend/dashboard.js"
click node_admin_console "https://github.com/manishpradhan50/netarmor-ai/blob/main/frontend/admin-dashboard.js"
click node_login "https://github.com/manishpradhan50/netarmor-ai/blob/main/frontend/login.js"
click node_api "https://github.com/manishpradhan50/netarmor-ai/blob/main/backend/app.py"
click node_url_scan "https://github.com/manishpradhan50/netarmor-ai/blob/main/backend/app.py"
click node_email_scan "https://github.com/manishpradhan50/netarmor-ai/blob/main/backend/app.py"
click node_message_scan "https://github.com/manishpradhan50/netarmor-ai/blob/main/backend/app.py"
click node_document_scan "https://github.com/manishpradhan50/netarmor-ai/blob/main/backend/app.py"
click node_assistant "https://github.com/manishpradhan50/netarmor-ai/blob/main/backend/app.py"
click node_url_features "https://github.com/manishpradhan50/netarmor-ai/blob/main/ml_pipeline/url_features.py"
click node_domain_intel "https://github.com/manishpradhan50/netarmor-ai/blob/main/ml_pipeline/domain_analysis.py"
click node_email_model "https://github.com/manishpradhan50/netarmor-ai/blob/main/ml_pipeline/saved_models/email_model.pkl"
click node_tfidf "https://github.com/manishpradhan50/netarmor-ai/blob/main/ml_pipeline/saved_models/tfidf_vectorizer.pkl"
click node_url_model "https://github.com/manishpradhan50/netarmor-ai/blob/main/ml_pipeline/saved_models/url_model.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_scanner,node_browser_extension,node_user_dashboard,node_admin_console,node_user toneBlue
class node_api,node_url_scan,node_email_scan,node_message_scan,node_document_scan,node_assistant toneAmber
class node_url_features,node_domain_intel,node_email_model,node_tfidf,node_url_model,node_gemini toneMint
class node_login,node_firebase_auth,node_firestore toneRose
```

## Components

### User Interfaces

- [Scanner Hub](https://github.com/manishpradhan50/netarmor-ai/blob/main/frontend/detect.js): `frontend/detect.js`
- [Chrome Scanner](https://github.com/manishpradhan50/netarmor-ai/blob/main/chrome_extension/popup.js): `chrome_extension/popup.js`
- [User Dashboard](https://github.com/manishpradhan50/netarmor-ai/blob/main/frontend/dashboard.js): `frontend/dashboard.js`
- [Admin Console](https://github.com/manishpradhan50/netarmor-ai/blob/main/frontend/admin-dashboard.js): `frontend/admin-dashboard.js`

### Detection Service

- [FastAPI Service](https://github.com/manishpradhan50/netarmor-ai/blob/main/backend/app.py): `backend/app.py`
- [URL Scanner](https://github.com/manishpradhan50/netarmor-ai/blob/main/backend/app.py): `backend/app.py`
- [Email Scanner](https://github.com/manishpradhan50/netarmor-ai/blob/main/backend/app.py): `backend/app.py`
- [Message Scanner](https://github.com/manishpradhan50/netarmor-ai/blob/main/backend/app.py): `backend/app.py`
- [PDF Scanner](https://github.com/manishpradhan50/netarmor-ai/blob/main/backend/app.py): `backend/app.py`
- [ArmorBot](https://github.com/manishpradhan50/netarmor-ai/blob/main/backend/app.py): `backend/app.py`

### Analysis Engines

- [URL Features](https://github.com/manishpradhan50/netarmor-ai/blob/main/ml_pipeline/url_features.py): `ml_pipeline/url_features.py`
- [Domain Intelligence](https://github.com/manishpradhan50/netarmor-ai/blob/main/ml_pipeline/domain_analysis.py): `ml_pipeline/domain_analysis.py`
- [Email Classifier](https://github.com/manishpradhan50/netarmor-ai/blob/main/ml_pipeline/saved_models/email_model.pkl): `ml_pipeline/saved_models/email_model.pkl`
- [TF-IDF Vectorizer](https://github.com/manishpradhan50/netarmor-ai/blob/main/ml_pipeline/saved_models/tfidf_vectorizer.pkl): `ml_pipeline/saved_models/tfidf_vectorizer.pkl`
- [URL Classifier](https://github.com/manishpradhan50/netarmor-ai/blob/main/ml_pipeline/saved_models/url_model.pkl): `ml_pipeline/saved_models/url_model.pkl`

### Accounts and Operations

- [Authentication UI](https://github.com/manishpradhan50/netarmor-ai/blob/main/frontend/login.js): `frontend/login.js`
- **Firebase Auth**
- **Cloud Firestore**

### Other components

- **User**
- **Gemini API**

## Connections

- User → Scanner Hub: submits scans (evidence: `README.md`)
- User → Chrome Scanner: scans content (evidence: `README.md`)
- Scanner Hub → FastAPI Service: requests analysis (evidence: `README.md`)
- Chrome Scanner → FastAPI Service: posts scans (evidence: `chrome_extension/popup.js`)
- FastAPI Service → URL Scanner: routes URL (evidence: `backend/app.py`)
- FastAPI Service → Email Scanner: routes email (evidence: `backend/app.py`)
- FastAPI Service → Message Scanner: routes message (evidence: `backend/app.py`)
- FastAPI Service → PDF Scanner: routes PDF (evidence: `backend/app.py`)
- FastAPI Service → ArmorBot: routes chat (evidence: `backend/app.py`)
- URL Scanner → URL Features: extracts features (evidence: `backend/app.py`)
- URL Scanner → Domain Intelligence: assesses domains (evidence: `backend/app.py`)
- URL Scanner → URL Classifier: predicts risk
- Email Scanner → TF-IDF Vectorizer: vectorizes text (evidence: `backend/app.py`)
- Email Scanner → Email Classifier: classifies text (evidence: `backend/app.py`)
- ArmorBot → Gemini API: requests response (evidence: `backend/app.py`)
- User → Authentication UI: signs in (evidence: `README.md`)
- Authentication UI → Firebase Auth: authenticates (evidence: `README.md`)
- Authentication UI → Cloud Firestore: reads profiles (evidence: `frontend/login.js`)
- User Dashboard → Cloud Firestore: reads scan history (evidence: `frontend/dashboard.js`)
- Admin Console → Cloud Firestore: manages operations (evidence: `frontend/admin-dashboard.js`)
- User → User Dashboard: views results (evidence: `README.md`)
