# raghupathi24891a0545/neurashield architecture

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

- Interactive diagram: https://gitdiagram.com/raghupathi24891a0545/neurashield
- Repository: https://github.com/raghupathi24891a0545/neurashield

## Overview

NeuraShield is a security-intelligence application for investigating suspicious URLs, domains, webpages, QR codes, and email, alongside platform monitoring and brand-threat capabilities. The principal workflow is an analyst submitting an investigation through the unified API; the investigation agent coordinates analysis and the routes persist and return a report. The graph preserves the major analysis stages and platform branches visible in the source index and excerpts. Several service internals and frontend-to-API wiring were not shown, so those relationships are omitted rather than inferred.

Main entry points: [`backend/app.py`](https://github.com/raghupathi24891a0545/neurashield/blob/main/backend/app.py) (Flask application), [`backend/platform_routes.py`](https://github.com/raghupathi24891a0545/neurashield/blob/main/backend/platform_routes.py) (Platform routes), [`backend/investigation_agent.py`](https://github.com/raghupathi24891a0545/neurashield/blob/main/backend/investigation_agent.py) (Investigation agent), [`backend/extension_routes.py`](https://github.com/raghupathi24891a0545/neurashield/blob/main/backend/extension_routes.py) (Extension API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Application entry"]
  node_app["Flask application<br/>[app.py]"]
  node_unified_api["Investigation API<br/>[module5_routes.py]"]
  node_extension_api["Extension API"]
  node_email_routes["Email routes<br/>[email_routes.py]"]
  node_platform_routes["Platform routes<br/>[platform_routes.py]"]
end

subgraph group_investigation["Investigation workflow"]
  node_investigator["Investigation agent"]
  node_report_store[("Investigation records<br/>[email_routes.py]")]
  node_security_intel["Security intelligence"]
  node_qr_intel["QR intelligence<br/>[qr_intelligence.py]"]
  node_threat_incidents["Threat incidents"]
end

subgraph group_analysis["Threat analysis"]
  node_url_analysis["URL intelligence"]
  node_url_rules["URL security rules<br/>[rule_engine.py]"]
  node_domain_collection["Domain intelligence<br/>[collector.py]"]
  node_domain_rules["Domain rules"]
  node_web_fetch["Webpage fetching<br/>[fetcher.py]"]
  node_web_analysis["Webpage analysis<br/>[analyzer.py]"]
  node_email_analysis["Email analysis<br/>[analyzer.py]"]
  node_email_parser["Email parsing<br/>[parser.py]"]
  node_email_helpers["Email evidence helpers<br/>[common.py]"]
end

subgraph group_platform["Security platform"]
  node_brand_service["Brand intelligence<br/>[brand_service.py]"]
  node_monitoring["Threat monitoring"]
  node_resilience["Resilience lab"]
  node_audit["Model self-audit<br/>[audit_service.py]"]
  node_analytics["Security analytics"]
  node_evidence_workflow["Evidence workflow"]
  node_news["Threat news<br/>[news_service.py]"]
  node_institution_service["Institution verification"]
end

node_analyst(("Analyst"))

node_app -->|"registers routes"| node_unified_api
node_app -->|"registers routes"| node_extension_api
node_app -->|"registers routes"| node_email_routes
node_app -->|"registers routes"| node_platform_routes
node_analyst -->|"submits investigation"| node_unified_api
node_unified_api -->|"dispatches analysis"| node_investigator
node_unified_api -->|"persists report"| node_report_store
node_extension_api -->|"uses agent"| node_investigator
node_extension_api -->|"uses verification"| node_institution_service
node_extension_api -->|"uses intelligence"| node_security_intel
node_investigator -->|"uses intelligence"| node_security_intel
node_investigator -->|"uses QR analysis"| node_qr_intel
node_investigator -->|"uses incident data"| node_threat_incidents
node_investigator -->|"uses brand data"| node_brand_service
node_app -->|"imports analysis"| node_url_analysis
node_app -->|"imports rules"| node_url_rules
node_app -->|"imports collection"| node_domain_collection
node_app -->|"imports rules"| node_domain_rules
node_app -->|"imports fetcher"| node_web_fetch
node_app -->|"imports analyzer"| node_web_analysis
node_email_routes -->|"uses analyzer"| node_email_analysis
node_email_routes -->|"uses parser"| node_email_parser
node_email_analysis -->|"parses message"| node_email_parser
node_email_analysis -->|"uses helpers"| node_email_helpers
node_platform_routes -->|"serves monitoring"| node_monitoring
node_platform_routes -->|"serves brand data"| node_brand_service
node_platform_routes -->|"serves resilience"| node_resilience
node_platform_routes -->|"serves model audit"| node_audit
node_platform_routes -->|"serves analytics"| node_analytics
node_platform_routes -->|"serves evidence workflow"| node_evidence_workflow
node_platform_routes -->|"serves threat news"| node_news

click node_app "https://github.com/raghupathi24891a0545/neurashield/blob/main/backend/app.py"
click node_unified_api "https://github.com/raghupathi24891a0545/neurashield/blob/main/backend/module5_routes.py"
click node_extension_api "https://github.com/raghupathi24891a0545/neurashield/blob/main/backend/extension_routes.py"
click node_email_routes "https://github.com/raghupathi24891a0545/neurashield/blob/main/backend/email_routes.py"
click node_investigator "https://github.com/raghupathi24891a0545/neurashield/blob/main/backend/investigation_agent.py"
click node_report_store "https://github.com/raghupathi24891a0545/neurashield/blob/main/backend/email_routes.py"
click node_url_analysis "https://github.com/raghupathi24891a0545/neurashield/blob/main/model/feature_extraction.py"
click node_url_rules "https://github.com/raghupathi24891a0545/neurashield/blob/main/model/rule_engine.py"
click node_domain_collection "https://github.com/raghupathi24891a0545/neurashield/blob/main/model/domain_intelligence/collector.py"
click node_domain_rules "https://github.com/raghupathi24891a0545/neurashield/blob/main/model/domain_intelligence/domain_rule_engine.py"
click node_web_fetch "https://github.com/raghupathi24891a0545/neurashield/blob/main/model/webpage_intelligence/fetcher.py"
click node_web_analysis "https://github.com/raghupathi24891a0545/neurashield/blob/main/model/webpage_intelligence/analyzer.py"
click node_email_analysis "https://github.com/raghupathi24891a0545/neurashield/blob/main/model/email_intelligence/analyzer.py"
click node_email_parser "https://github.com/raghupathi24891a0545/neurashield/blob/main/model/email_intelligence/parser.py"
click node_email_helpers "https://github.com/raghupathi24891a0545/neurashield/blob/main/model/email_intelligence/common.py"
click node_security_intel "https://github.com/raghupathi24891a0545/neurashield/blob/main/backend/security_intelligence.py"
click node_qr_intel "https://github.com/raghupathi24891a0545/neurashield/blob/main/backend/qr_intelligence.py"
click node_threat_incidents "https://github.com/raghupathi24891a0545/neurashield/blob/main/backend/threat_intel_incident.py"
click node_brand_service "https://github.com/raghupathi24891a0545/neurashield/blob/main/backend/brand_service.py"
click node_monitoring "https://github.com/raghupathi24891a0545/neurashield/blob/main/backend/monitoring_service.py"
click node_resilience "https://github.com/raghupathi24891a0545/neurashield/blob/main/backend/resilience_service.py"
click node_audit "https://github.com/raghupathi24891a0545/neurashield/blob/main/backend/audit_service.py"
click node_analytics "https://github.com/raghupathi24891a0545/neurashield/blob/main/backend/analytics_service.py"
click node_evidence_workflow "https://github.com/raghupathi24891a0545/neurashield/blob/main/backend/evidence_workflow.py"
click node_news "https://github.com/raghupathi24891a0545/neurashield/blob/main/backend/news_service.py"
click node_platform_routes "https://github.com/raghupathi24891a0545/neurashield/blob/main/backend/platform_routes.py"
click node_institution_service "https://github.com/raghupathi24891a0545/neurashield/blob/main/backend/institution_service.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_app,node_unified_api,node_extension_api,node_email_routes,node_platform_routes toneBlue
class node_investigator,node_report_store,node_security_intel,node_qr_intel,node_threat_incidents toneAmber
class node_url_analysis,node_url_rules,node_domain_collection,node_domain_rules,node_web_fetch,node_web_analysis,node_email_analysis,node_email_parser,node_email_helpers toneMint
class node_brand_service,node_monitoring,node_resilience,node_audit,node_analytics,node_evidence_workflow,node_news,node_institution_service toneRose
class node_analyst toneIndigo
```

## Components

### Application entry

- [Flask application](https://github.com/raghupathi24891a0545/neurashield/blob/main/backend/app.py): `backend/app.py`
- [Investigation API](https://github.com/raghupathi24891a0545/neurashield/blob/main/backend/module5_routes.py): `backend/module5_routes.py`
- [Extension API](https://github.com/raghupathi24891a0545/neurashield/blob/main/backend/extension_routes.py): `backend/extension_routes.py`
- [Email routes](https://github.com/raghupathi24891a0545/neurashield/blob/main/backend/email_routes.py): `backend/email_routes.py`
- [Platform routes](https://github.com/raghupathi24891a0545/neurashield/blob/main/backend/platform_routes.py): `backend/platform_routes.py`

### Investigation workflow

- [Investigation agent](https://github.com/raghupathi24891a0545/neurashield/blob/main/backend/investigation_agent.py): `backend/investigation_agent.py`
- [Investigation records](https://github.com/raghupathi24891a0545/neurashield/blob/main/backend/email_routes.py): `backend/email_routes.py`
- [Security intelligence](https://github.com/raghupathi24891a0545/neurashield/blob/main/backend/security_intelligence.py): `backend/security_intelligence.py`
- [QR intelligence](https://github.com/raghupathi24891a0545/neurashield/blob/main/backend/qr_intelligence.py): `backend/qr_intelligence.py`
- [Threat incidents](https://github.com/raghupathi24891a0545/neurashield/blob/main/backend/threat_intel_incident.py): `backend/threat_intel_incident.py`

### Threat analysis

- [URL intelligence](https://github.com/raghupathi24891a0545/neurashield/blob/main/model/feature_extraction.py): `model/feature_extraction.py`
- [URL security rules](https://github.com/raghupathi24891a0545/neurashield/blob/main/model/rule_engine.py): `model/rule_engine.py`
- [Domain intelligence](https://github.com/raghupathi24891a0545/neurashield/blob/main/model/domain_intelligence/collector.py): `model/domain_intelligence/collector.py`
- [Domain rules](https://github.com/raghupathi24891a0545/neurashield/blob/main/model/domain_intelligence/domain_rule_engine.py): `model/domain_intelligence/domain_rule_engine.py`
- [Webpage fetching](https://github.com/raghupathi24891a0545/neurashield/blob/main/model/webpage_intelligence/fetcher.py): `model/webpage_intelligence/fetcher.py`
- [Webpage analysis](https://github.com/raghupathi24891a0545/neurashield/blob/main/model/webpage_intelligence/analyzer.py): `model/webpage_intelligence/analyzer.py`
- [Email analysis](https://github.com/raghupathi24891a0545/neurashield/blob/main/model/email_intelligence/analyzer.py): `model/email_intelligence/analyzer.py`
- [Email parsing](https://github.com/raghupathi24891a0545/neurashield/blob/main/model/email_intelligence/parser.py): `model/email_intelligence/parser.py`
- [Email evidence helpers](https://github.com/raghupathi24891a0545/neurashield/blob/main/model/email_intelligence/common.py): `model/email_intelligence/common.py`

### Security platform

- [Brand intelligence](https://github.com/raghupathi24891a0545/neurashield/blob/main/backend/brand_service.py): `backend/brand_service.py`
- [Threat monitoring](https://github.com/raghupathi24891a0545/neurashield/blob/main/backend/monitoring_service.py): `backend/monitoring_service.py`
- [Resilience lab](https://github.com/raghupathi24891a0545/neurashield/blob/main/backend/resilience_service.py): `backend/resilience_service.py`
- [Model self-audit](https://github.com/raghupathi24891a0545/neurashield/blob/main/backend/audit_service.py): `backend/audit_service.py`
- [Security analytics](https://github.com/raghupathi24891a0545/neurashield/blob/main/backend/analytics_service.py): `backend/analytics_service.py`
- [Evidence workflow](https://github.com/raghupathi24891a0545/neurashield/blob/main/backend/evidence_workflow.py): `backend/evidence_workflow.py`
- [Threat news](https://github.com/raghupathi24891a0545/neurashield/blob/main/backend/news_service.py): `backend/news_service.py`
- [Institution verification](https://github.com/raghupathi24891a0545/neurashield/blob/main/backend/institution_service.py): `backend/institution_service.py`

### Other components

- **Analyst**

## Connections

- Flask application → Investigation API: registers routes (evidence: `backend/app.py`)
- Flask application → Extension API: registers routes (evidence: `backend/app.py`)
- Flask application → Email routes: registers routes (evidence: `backend/app.py`)
- Flask application → Platform routes: registers routes (evidence: `backend/app.py`)
- Analyst → Investigation API: submits investigation (evidence: `backend/module5_routes.py`)
- Investigation API → Investigation agent: dispatches analysis (evidence: `backend/module5_routes.py`)
- Investigation API → Investigation records: persists report (evidence: `backend/module5_routes.py`)
- Extension API → Investigation agent: uses agent (evidence: `backend/extension_routes.py`)
- Extension API → Institution verification: uses verification (evidence: `backend/extension_routes.py`)
- Extension API → Security intelligence: uses intelligence (evidence: `backend/extension_routes.py`)
- Investigation agent → Security intelligence: uses intelligence (evidence: `backend/investigation_agent.py`)
- Investigation agent → QR intelligence: uses QR analysis (evidence: `backend/investigation_agent.py`)
- Investigation agent → Threat incidents: uses incident data (evidence: `backend/investigation_agent.py`)
- Investigation agent → Brand intelligence: uses brand data (evidence: `backend/investigation_agent.py`)
- Flask application → URL intelligence: imports analysis (evidence: `backend/app.py`)
- Flask application → URL security rules: imports rules (evidence: `backend/app.py`)
- Flask application → Domain intelligence: imports collection (evidence: `backend/app.py`)
- Flask application → Domain rules: imports rules (evidence: `backend/app.py`)
- Flask application → Webpage fetching: imports fetcher (evidence: `backend/app.py`)
- Flask application → Webpage analysis: imports analyzer (evidence: `backend/app.py`)
- Email routes → Email analysis: uses analyzer (evidence: `backend/email_routes.py`)
- Email routes → Email parsing: uses parser (evidence: `backend/email_routes.py`)
- Email analysis → Email parsing: parses message (evidence: `model/email_intelligence/analyzer.py`)
- Email analysis → Email evidence helpers: uses helpers (evidence: `model/email_intelligence/analyzer.py`)
- Platform routes → Threat monitoring: serves monitoring (evidence: `backend/platform_routes.py`)
- Platform routes → Brand intelligence: serves brand data (evidence: `backend/platform_routes.py`)
- Platform routes → Resilience lab: serves resilience (evidence: `backend/platform_routes.py`)
- Platform routes → Model self-audit: serves model audit (evidence: `backend/platform_routes.py`)
- Platform routes → Security analytics: serves analytics (evidence: `backend/platform_routes.py`)
- Platform routes → Evidence workflow: serves evidence workflow (evidence: `backend/platform_routes.py`)
- Platform routes → Threat news: serves threat news (evidence: `backend/platform_routes.py`)
