# srineshreddy1/lexiguard-phishing-email-system architecture

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

- Interactive diagram: https://gitdiagram.com/srineshreddy1/lexiguard-phishing-email-system
- Repository: https://github.com/srineshreddy1/lexiguard-phishing-email-system

## Overview

LexiGuard is an email and URL threat-analysis gateway with a dashboard for scanning messages, reviewing verdicts, and managing incidents. The documented workflow ingests Gmail or simulated messages, inspects URLs, HTML, Unicode, and attachments, scores risk, records results, and presents findings; malicious verdicts can trigger quarantine and alerts. The map also preserves documented cloud-intelligence, reporting, and translation capabilities. Some implementation files were not sampled, so their connections are included only where the README or source index supports them.

Main entry points: [`app.py`](https://github.com/srineshreddy1/lexiguard-phishing-email-system/blob/main/app.py) (SecOps dashboard), [`lexiguard/gateway/gmail_client.py`](https://github.com/srineshreddy1/lexiguard-phishing-email-system/blob/main/lexiguard/gateway/gmail_client.py) (Gmail gateway), [`gateway/gmail_client.py`](https://github.com/srineshreddy1/lexiguard-phishing-email-system/blob/main/gateway/gmail_client.py) (Gateway simulation), [`lexiguard/db/database.py`](https://github.com/srineshreddy1/lexiguard-phishing-email-system/blob/main/lexiguard/db/database.py) (Threat ledger)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ingest["Ingestion"]
  node_dashboard["SecOps dashboard<br/>[app.py]"]
  node_gmail["Gmail gateway<br/>[gmail_client.py]"]
  node_legacy_gmail["Gateway simulation<br/>[gmail_client.py]"]
end

subgraph group_inspect["Threat inspection"]
  node_url_parser["URL parser<br/>[parser.py]"]
  node_features["URL features<br/>[features.py]"]
  node_risk_scorer["Risk scorer<br/>[scorer.py]"]
  node_html_guard["HTML evasion guard<br/>[html_guard.py]"]
  node_unicode_guard["Unicode guard<br/>[unicode_guard.py]"]
  node_attachments["Attachment scanner<br/>[attachments.py]"]
  node_legacy_attachments["Gateway attachments<br/>[attachments.py]"]
end

subgraph group_intel["Threat intelligence"]
  node_virustotal["VirusTotal checks<br/>[virustotal.py]"]
  node_webrisk["Google Web Risk<br/>[google_webrisk.py]"]
  node_hybrid_analysis["Hybrid Analysis<br/>[hybrid_analysis.py]"]
  node_stego_api["Stego analysis<br/>[stego_api.py]"]
end

subgraph group_operate["Operations and response"]
  node_threat_db[("Threat ledger<br/>[database.py]")]
  node_seed_intel["Threat bootstrap<br/>[seed_intel.py]"]
  node_responder["Incident responder<br/>[responder.py]"]
  node_webhooks["Alert webhooks<br/>[webhooks.py]"]
  node_exporter["Audit exporter<br/>[exporter.py]"]
  node_translator["Threat translator<br/>[translator.py]"]
end

node_analyst(("User / analyst"))
node_gmail_service["Gmail API"]
node_cloud_intel["Cloud intel services"]
node_alert_destinations["Alert destinations"]

node_analyst -->|"uses"| node_dashboard
node_dashboard -->|"polls inbox"| node_gmail
node_dashboard -->|"offers gateway"| node_legacy_gmail
node_gmail -->|"fetches messages"| node_gmail_service
node_legacy_gmail -->|"polls inbox"| node_gmail_service
node_gmail -->|"parses URLs"| node_url_parser
node_gmail -->|"extracts features"| node_features
node_gmail -->|"scores risk"| node_risk_scorer
node_gmail -->|"checks HTML"| node_html_guard
node_gmail -->|"sanitizes text"| node_unicode_guard
node_gmail -->|"scans files"| node_attachments
node_gmail -->|"persists scans"| node_threat_db
node_legacy_gmail -->|"parses URLs"| node_url_parser
node_legacy_gmail -->|"extracts features"| node_features
node_legacy_gmail -->|"scores risk"| node_risk_scorer
node_legacy_gmail -->|"logs results"| node_threat_db
node_legacy_attachments -->|"checks hashes"| node_threat_db
node_dashboard -->|"parses URLs"| node_url_parser
node_dashboard -->|"extracts features"| node_features
node_dashboard -->|"scores risk"| node_risk_scorer
node_dashboard -->|"inspects HTML"| node_html_guard
node_dashboard -->|"scans files"| node_attachments
node_dashboard -->|"checks URLs"| node_virustotal
node_dashboard -->|"checks URLs"| node_webrisk
node_dashboard -.->|"queries sandbox"| node_hybrid_analysis
node_dashboard -.->|"checks payloads"| node_stego_api
node_virustotal -.->|"queries"| node_cloud_intel
node_webrisk -.->|"queries"| node_cloud_intel
node_hybrid_analysis -.->|"queries"| node_cloud_intel
node_dashboard -->|"records scans"| node_threat_db
node_seed_intel -->|"seeds indicators"| node_threat_db
node_dashboard -->|"handles verdicts"| node_responder
node_responder -->|"dispatches alerts"| node_webhooks
node_webhooks -->|"sends alerts"| node_alert_destinations
node_responder -.->|"quarantines messages"| node_gmail_service
node_dashboard -->|"exports reports"| node_exporter
node_exporter -->|"reads scans"| node_threat_db
node_dashboard -->|"explains verdicts"| node_translator

click node_dashboard "https://github.com/srineshreddy1/lexiguard-phishing-email-system/blob/main/app.py"
click node_gmail "https://github.com/srineshreddy1/lexiguard-phishing-email-system/blob/main/lexiguard/gateway/gmail_client.py"
click node_legacy_gmail "https://github.com/srineshreddy1/lexiguard-phishing-email-system/blob/main/gateway/gmail_client.py"
click node_url_parser "https://github.com/srineshreddy1/lexiguard-phishing-email-system/blob/main/lexiguard/parser.py"
click node_features "https://github.com/srineshreddy1/lexiguard-phishing-email-system/blob/main/lexiguard/features.py"
click node_risk_scorer "https://github.com/srineshreddy1/lexiguard-phishing-email-system/blob/main/lexiguard/core/scorer.py"
click node_html_guard "https://github.com/srineshreddy1/lexiguard-phishing-email-system/blob/main/lexiguard/evasion/html_guard.py"
click node_unicode_guard "https://github.com/srineshreddy1/lexiguard-phishing-email-system/blob/main/lexiguard/evasion/unicode_guard.py"
click node_attachments "https://github.com/srineshreddy1/lexiguard-phishing-email-system/blob/main/lexiguard/gateway/attachments.py"
click node_legacy_attachments "https://github.com/srineshreddy1/lexiguard-phishing-email-system/blob/main/gateway/attachments.py"
click node_virustotal "https://github.com/srineshreddy1/lexiguard-phishing-email-system/blob/main/lexiguard/intel/virustotal.py"
click node_webrisk "https://github.com/srineshreddy1/lexiguard-phishing-email-system/blob/main/lexiguard/intel/google_webrisk.py"
click node_hybrid_analysis "https://github.com/srineshreddy1/lexiguard-phishing-email-system/blob/main/lexiguard/intel/hybrid_analysis.py"
click node_stego_api "https://github.com/srineshreddy1/lexiguard-phishing-email-system/blob/main/lexiguard/intel/stego_api.py"
click node_threat_db "https://github.com/srineshreddy1/lexiguard-phishing-email-system/blob/main/lexiguard/db/database.py"
click node_seed_intel "https://github.com/srineshreddy1/lexiguard-phishing-email-system/blob/main/lexiguard/db/seed_intel.py"
click node_responder "https://github.com/srineshreddy1/lexiguard-phishing-email-system/blob/main/lexiguard/response/responder.py"
click node_webhooks "https://github.com/srineshreddy1/lexiguard-phishing-email-system/blob/main/lexiguard/response/webhooks.py"
click node_exporter "https://github.com/srineshreddy1/lexiguard-phishing-email-system/blob/main/lexiguard/reports/exporter.py"
click node_translator "https://github.com/srineshreddy1/lexiguard-phishing-email-system/blob/main/lexiguard/ui/translator.py"

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_dashboard,node_gmail,node_legacy_gmail,node_analyst toneBlue
class node_url_parser,node_features,node_risk_scorer,node_html_guard,node_unicode_guard,node_attachments,node_legacy_attachments toneAmber
class node_virustotal,node_webrisk,node_hybrid_analysis,node_stego_api,node_gmail_service toneMint
class node_threat_db,node_seed_intel,node_responder,node_webhooks,node_exporter,node_translator toneRose
class node_cloud_intel,node_alert_destinations toneIndigo
```

## Components

### Ingestion

- [SecOps dashboard](https://github.com/srineshreddy1/lexiguard-phishing-email-system/blob/main/app.py): `app.py`
- [Gmail gateway](https://github.com/srineshreddy1/lexiguard-phishing-email-system/blob/main/lexiguard/gateway/gmail_client.py): `lexiguard/gateway/gmail_client.py`
- [Gateway simulation](https://github.com/srineshreddy1/lexiguard-phishing-email-system/blob/main/gateway/gmail_client.py): `gateway/gmail_client.py`

### Threat inspection

- [URL parser](https://github.com/srineshreddy1/lexiguard-phishing-email-system/blob/main/lexiguard/parser.py): `lexiguard/parser.py`
- [URL features](https://github.com/srineshreddy1/lexiguard-phishing-email-system/blob/main/lexiguard/features.py): `lexiguard/features.py`
- [Risk scorer](https://github.com/srineshreddy1/lexiguard-phishing-email-system/blob/main/lexiguard/core/scorer.py): `lexiguard/core/scorer.py`
- [HTML evasion guard](https://github.com/srineshreddy1/lexiguard-phishing-email-system/blob/main/lexiguard/evasion/html_guard.py): `lexiguard/evasion/html_guard.py`
- [Unicode guard](https://github.com/srineshreddy1/lexiguard-phishing-email-system/blob/main/lexiguard/evasion/unicode_guard.py): `lexiguard/evasion/unicode_guard.py`
- [Attachment scanner](https://github.com/srineshreddy1/lexiguard-phishing-email-system/blob/main/lexiguard/gateway/attachments.py): `lexiguard/gateway/attachments.py`
- [Gateway attachments](https://github.com/srineshreddy1/lexiguard-phishing-email-system/blob/main/gateway/attachments.py): `gateway/attachments.py`

### Threat intelligence

- [VirusTotal checks](https://github.com/srineshreddy1/lexiguard-phishing-email-system/blob/main/lexiguard/intel/virustotal.py): `lexiguard/intel/virustotal.py`
- [Google Web Risk](https://github.com/srineshreddy1/lexiguard-phishing-email-system/blob/main/lexiguard/intel/google_webrisk.py): `lexiguard/intel/google_webrisk.py`
- [Hybrid Analysis](https://github.com/srineshreddy1/lexiguard-phishing-email-system/blob/main/lexiguard/intel/hybrid_analysis.py): `lexiguard/intel/hybrid_analysis.py`
- [Stego analysis](https://github.com/srineshreddy1/lexiguard-phishing-email-system/blob/main/lexiguard/intel/stego_api.py): `lexiguard/intel/stego_api.py`

### Operations and response

- [Threat ledger](https://github.com/srineshreddy1/lexiguard-phishing-email-system/blob/main/lexiguard/db/database.py): `lexiguard/db/database.py`
- [Threat bootstrap](https://github.com/srineshreddy1/lexiguard-phishing-email-system/blob/main/lexiguard/db/seed_intel.py): `lexiguard/db/seed_intel.py`
- [Incident responder](https://github.com/srineshreddy1/lexiguard-phishing-email-system/blob/main/lexiguard/response/responder.py): `lexiguard/response/responder.py`
- [Alert webhooks](https://github.com/srineshreddy1/lexiguard-phishing-email-system/blob/main/lexiguard/response/webhooks.py): `lexiguard/response/webhooks.py`
- [Audit exporter](https://github.com/srineshreddy1/lexiguard-phishing-email-system/blob/main/lexiguard/reports/exporter.py): `lexiguard/reports/exporter.py`
- [Threat translator](https://github.com/srineshreddy1/lexiguard-phishing-email-system/blob/main/lexiguard/ui/translator.py): `lexiguard/ui/translator.py`

### Other components

- **User / analyst**
- **Gmail API**
- **Cloud intel services**
- **Alert destinations**

## Connections

- User / analyst → SecOps dashboard: uses (evidence: `README.md`)
- SecOps dashboard → Gmail gateway: polls inbox (evidence: `app.py`)
- SecOps dashboard → Gateway simulation: offers gateway (evidence: `app.py`)
- Gmail gateway → Gmail API: fetches messages (evidence: `README.md`)
- Gateway simulation → Gmail API: polls inbox (evidence: `gateway/gmail_client.py`)
- Gmail gateway → URL parser: parses URLs (evidence: `lexiguard/gateway/gmail_client.py`)
- Gmail gateway → URL features: extracts features (evidence: `lexiguard/gateway/gmail_client.py`)
- Gmail gateway → Risk scorer: scores risk (evidence: `lexiguard/gateway/gmail_client.py`)
- Gmail gateway → HTML evasion guard: checks HTML (evidence: `lexiguard/gateway/gmail_client.py`)
- Gmail gateway → Unicode guard: sanitizes text (evidence: `lexiguard/gateway/gmail_client.py`)
- Gmail gateway → Attachment scanner: scans files (evidence: `lexiguard/gateway/gmail_client.py`)
- Gmail gateway → Threat ledger: persists scans (evidence: `lexiguard/gateway/gmail_client.py`)
- Gateway simulation → URL parser: parses URLs (evidence: `gateway/gmail_client.py`)
- Gateway simulation → URL features: extracts features (evidence: `gateway/gmail_client.py`)
- Gateway simulation → Risk scorer: scores risk (evidence: `gateway/gmail_client.py`)
- Gateway simulation → Threat ledger: logs results (evidence: `gateway/gmail_client.py`)
- Gateway attachments → Threat ledger: checks hashes (evidence: `gateway/attachments.py`)
- SecOps dashboard → URL parser: parses URLs (evidence: `app.py`)
- SecOps dashboard → URL features: extracts features (evidence: `app.py`)
- SecOps dashboard → Risk scorer: scores risk (evidence: `app.py`)
- SecOps dashboard → HTML evasion guard: inspects HTML (evidence: `README.md`)
- SecOps dashboard → Attachment scanner: scans files (evidence: `app.py`)
- SecOps dashboard → VirusTotal checks: checks URLs (evidence: `app.py`)
- SecOps dashboard → Google Web Risk: checks URLs (evidence: `app.py`)
- SecOps dashboard → Hybrid Analysis: queries sandbox (evidence: `app.py`)
- SecOps dashboard → Stego analysis: checks payloads (evidence: `app.py`)
- VirusTotal checks → Cloud intel services: queries (evidence: `README.md`)
- Google Web Risk → Cloud intel services: queries (evidence: `README.md`)
- Hybrid Analysis → Cloud intel services: queries (evidence: `README.md`)
- SecOps dashboard → Threat ledger: records scans (evidence: `app.py`)
- Threat bootstrap → Threat ledger: seeds indicators (evidence: `lexiguard/db/seed_intel.py`)
- SecOps dashboard → Incident responder: handles verdicts (evidence: `app.py`)
- Incident responder → Alert webhooks: dispatches alerts (evidence: `lexiguard/response/responder.py`)
- Alert webhooks → Alert destinations: sends alerts (evidence: `README.md`)
- Incident responder → Gmail API: quarantines messages (evidence: `README.md`)
- SecOps dashboard → Audit exporter: exports reports (evidence: `app.py`)
- Audit exporter → Threat ledger: reads scans (evidence: `lexiguard/reports/exporter.py`)
- SecOps dashboard → Threat translator: explains verdicts (evidence: `app.py`)
