# shunmuga-sundaran/cybershield architecture

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

- Interactive diagram: https://gitdiagram.com/shunmuga-sundaran/cybershield
- Repository: https://github.com/shunmuga-sundaran/cybershield

## Overview

CyberShield is a Streamlit phishing-analysis dashboard. A user submits a URL; the app coordinates feature extraction, webpage analysis, machine-learning and NLP risk signals, hybrid classification, and contextual RAG explanations before presenting results and analytics. The README documents the major stages; excerpts show feature extraction, page scraping, model scoring, hybrid scoring, and RAG use. Some app internals and model setup are unsampled, so only documented or excerpt-supported relationships are shown.

Main entry points: [`app.py`](https://github.com/shunmuga-sundaran/cybershield/blob/main/app.py) (Streamlit dashboard), [`nlp_rag_engine.py`](https://github.com/shunmuga-sundaran/cybershield/blob/main/nlp_rag_engine.py) (NLP risk analysis), [`feature_extraction.py`](https://github.com/shunmuga-sundaran/cybershield/blob/main/feature_extraction.py) (URL feature extraction)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["Dashboard"]
  node_dashboard["Streamlit dashboard<br/>[app.py]"]
end

subgraph group_analysis["Threat Analysis"]
  node_feature_extraction["URL feature extraction"]
  node_page_scraping["Webpage scraping<br/>[nlp_rag_engine.py]"]
  node_ml_ensemble["ML ensemble<br/>[app.py]"]
  node_nlp_analysis["NLP risk analysis<br/>[nlp_rag_engine.py]"]
  node_hybrid_decision["Hybrid risk decision<br/>[app.py]"]
end

subgraph group_intelligence["Threat Intelligence"]
  node_risk_rules["Risk indicators<br/>[nlp_rag_engine.py]"]
  node_knowledge_base["Cybersecurity knowledge base<br/>[nlp_rag_engine.py]"]
  node_rag_retrieval["RAG retrieval<br/>[nlp_rag_engine.py]"]
end

subgraph group_presentation["Results"]
  node_explanations["Threat explanations<br/>[nlp_rag_engine.py]"]
  node_analytics["Scan analytics<br/>[app.py]"]
end

node_user(("URL submitter"))

node_user -->|"submits URL"| node_dashboard
node_dashboard -->|"extracts features"| node_feature_extraction
node_dashboard -->|"requests page analysis"| node_page_scraping
node_dashboard -->|"evaluates features"| node_ml_ensemble
node_dashboard -->|"analyzes URL"| node_nlp_analysis
node_dashboard -->|"combines risk signals"| node_hybrid_decision
node_nlp_analysis -->|"checks indicators"| node_risk_rules
node_nlp_analysis -->|"queries context"| node_rag_retrieval
node_rag_retrieval -->|"retrieves documents"| node_knowledge_base
node_dashboard -->|"requests explanations"| node_explanations
node_dashboard -->|"renders analytics"| node_analytics

click node_dashboard "https://github.com/shunmuga-sundaran/cybershield/blob/main/app.py"
click node_feature_extraction "https://github.com/shunmuga-sundaran/cybershield/blob/main/feature_extraction.py"
click node_page_scraping "https://github.com/shunmuga-sundaran/cybershield/blob/main/nlp_rag_engine.py"
click node_ml_ensemble "https://github.com/shunmuga-sundaran/cybershield/blob/main/app.py"
click node_nlp_analysis "https://github.com/shunmuga-sundaran/cybershield/blob/main/nlp_rag_engine.py"
click node_hybrid_decision "https://github.com/shunmuga-sundaran/cybershield/blob/main/app.py"
click node_risk_rules "https://github.com/shunmuga-sundaran/cybershield/blob/main/nlp_rag_engine.py"
click node_knowledge_base "https://github.com/shunmuga-sundaran/cybershield/blob/main/nlp_rag_engine.py"
click node_rag_retrieval "https://github.com/shunmuga-sundaran/cybershield/blob/main/nlp_rag_engine.py"
click node_explanations "https://github.com/shunmuga-sundaran/cybershield/blob/main/nlp_rag_engine.py"
click node_analytics "https://github.com/shunmuga-sundaran/cybershield/blob/main/app.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 toneBlue
class node_feature_extraction,node_page_scraping,node_ml_ensemble,node_nlp_analysis,node_hybrid_decision toneAmber
class node_risk_rules,node_knowledge_base,node_rag_retrieval toneMint
class node_explanations,node_analytics toneRose
class node_user toneIndigo
```

## Components

### Dashboard

- [Streamlit dashboard](https://github.com/shunmuga-sundaran/cybershield/blob/main/app.py): `app.py`

### Threat Analysis

- [URL feature extraction](https://github.com/shunmuga-sundaran/cybershield/blob/main/feature_extraction.py): `feature_extraction.py`
- [Webpage scraping](https://github.com/shunmuga-sundaran/cybershield/blob/main/nlp_rag_engine.py): `nlp_rag_engine.py`
- [ML ensemble](https://github.com/shunmuga-sundaran/cybershield/blob/main/app.py): `app.py`
- [NLP risk analysis](https://github.com/shunmuga-sundaran/cybershield/blob/main/nlp_rag_engine.py): `nlp_rag_engine.py`
- [Hybrid risk decision](https://github.com/shunmuga-sundaran/cybershield/blob/main/app.py): `app.py`

### Threat Intelligence

- [Risk indicators](https://github.com/shunmuga-sundaran/cybershield/blob/main/nlp_rag_engine.py): `nlp_rag_engine.py`
- [Cybersecurity knowledge base](https://github.com/shunmuga-sundaran/cybershield/blob/main/nlp_rag_engine.py): `nlp_rag_engine.py`
- [RAG retrieval](https://github.com/shunmuga-sundaran/cybershield/blob/main/nlp_rag_engine.py): `nlp_rag_engine.py`

### Results

- [Threat explanations](https://github.com/shunmuga-sundaran/cybershield/blob/main/nlp_rag_engine.py): `nlp_rag_engine.py`
- [Scan analytics](https://github.com/shunmuga-sundaran/cybershield/blob/main/app.py): `app.py`

### Other components

- **URL submitter**

## Connections

- URL submitter → Streamlit dashboard: submits URL (evidence: `README.md`)
- Streamlit dashboard → URL feature extraction: extracts features (evidence: `README.md`)
- Streamlit dashboard → Webpage scraping: requests page analysis (evidence: `README.md`)
- Streamlit dashboard → ML ensemble: evaluates features (evidence: `app.py`)
- Streamlit dashboard → NLP risk analysis: analyzes URL (evidence: `app.py`)
- Streamlit dashboard → Hybrid risk decision: combines risk signals (evidence: `app.py`)
- NLP risk analysis → Risk indicators: checks indicators (evidence: `nlp_rag_engine.py`)
- NLP risk analysis → RAG retrieval: queries context (evidence: `nlp_rag_engine.py`)
- RAG retrieval → Cybersecurity knowledge base: retrieves documents (evidence: `nlp_rag_engine.py`)
- Streamlit dashboard → Threat explanations: requests explanations (evidence: `app.py`)
- Streamlit dashboard → Scan analytics: renders analytics (evidence: `README.md`)
