# mahendra-35/scam_schield architecture

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

- Interactive diagram: https://gitdiagram.com/mahendra-35/scam_schield
- Repository: https://github.com/mahendra-35/scam_schield

## Overview

ScamShield is a Django scam-awareness and risk-checking platform. A user submits suspicious text or a URL to the checker; the analysis endpoint validates and sanitizes input, evaluates text rules and URL structure, then combines indicators into a scored assessment. Signed-in users can review scan history, while visitors can browse educational guides and submit incident reports; administrators get platform and incident oversight. The graph preserves the documented dashboard-chart capability, although templates are not in the supplied tree. Evidence is limited to the README and sampled files/SOURCE INDEX references; unshown wiring is omitted.

Main entry points: [`accounts/views.py`](https://github.com/mahendra-35/scam_schield/blob/main/accounts/views.py) (Accounts and dashboards), [`analyzer/engine.py`](https://github.com/mahendra-35/scam_schield/blob/main/analyzer/engine.py) (Analysis orchestrator), [`analyzer/views.py`](https://github.com/mahendra-35/scam_schield/blob/main/analyzer/views.py) (Scam checker API), [`awareness/views.py`](https://github.com/mahendra-35/scam_schield/blob/main/awareness/views.py) (Learning center)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_analysis["Risk analysis"]
  node_checker["Scam checker API<br/>[views.py]"]
  node_engine["Analysis orchestrator<br/>[engine.py]"]
  node_input_validation["Input validation<br/>[validators.py]"]
  node_text_rules["Text rule matching<br/>[rules.py]"]
  node_url_inspector["URL inspection<br/>[url_analysis.py]"]
  node_risk_scoring["Risk scoring<br/>[scoring.py]"]
  node_analysis_records[("Scan history<br/>[models.py]")]
  node_analysis_ui["Checker interface<br/>[analyzer.js]"]
end

subgraph group_accounts["Accounts and dashboards"]
  node_user_profile[("User profile<br/>[models.py]")]
  node_account_views["Accounts and dashboards<br/>[views.py]"]
  node_dashboard_charts["Dashboard charts<br/>[charts.js]"]
end

subgraph group_education["Awareness hub"]
  node_awareness_views["Learning center<br/>[views.py]"]
  node_learning_content[("Guides and categories<br/>[models.py]")]
  node_content_seeder["Educational data seeder<br/>[seed_scam_data.py]"]
end

subgraph group_community["Incident reporting"]
  node_report_views["Incident submission<br/>[views.py]"]
  node_incident_reports[("Community reports<br/>[models.py]")]
end

node_visitor(("Visitor"))
node_member(("Signed-in user"))
node_admin(("Administrator"))

node_visitor -->|"submits for analysis"| node_checker
node_checker -->|"invokes analysis"| node_engine
node_engine -->|"validates input"| node_input_validation
node_engine -->|"evaluates text"| node_text_rules
node_engine -->|"inspects URL"| node_url_inspector
node_engine -->|"calculates score"| node_risk_scoring
node_checker -->|"stores scan"| node_analysis_records
node_checker -.->|"serves checker"| node_analysis_ui
node_member -->|"opens dashboard"| node_account_views
node_admin -->|"opens admin dashboard"| node_account_views
node_account_views -->|"creates profile"| node_user_profile
node_account_views -->|"reads scan history"| node_analysis_records
node_account_views -->|"reads incident reports"| node_incident_reports
node_account_views -.->|"provides chart data"| node_dashboard_charts
node_visitor -->|"browses guides"| node_awareness_views
node_awareness_views -->|"queries articles"| node_learning_content
node_content_seeder -->|"seeds guides"| node_learning_content
node_visitor -->|"submits incident"| node_report_views
node_report_views -->|"creates report"| node_incident_reports

click node_checker "https://github.com/mahendra-35/scam_schield/blob/main/analyzer/views.py"
click node_engine "https://github.com/mahendra-35/scam_schield/blob/main/analyzer/engine.py"
click node_input_validation "https://github.com/mahendra-35/scam_schield/blob/main/analyzer/validators.py"
click node_text_rules "https://github.com/mahendra-35/scam_schield/blob/main/analyzer/rules.py"
click node_url_inspector "https://github.com/mahendra-35/scam_schield/blob/main/analyzer/url_analysis.py"
click node_risk_scoring "https://github.com/mahendra-35/scam_schield/blob/main/analyzer/scoring.py"
click node_analysis_records "https://github.com/mahendra-35/scam_schield/blob/main/analyzer/models.py"
click node_analysis_ui "https://github.com/mahendra-35/scam_schield/blob/main/static/js/analyzer.js"
click node_user_profile "https://github.com/mahendra-35/scam_schield/blob/main/accounts/models.py"
click node_account_views "https://github.com/mahendra-35/scam_schield/blob/main/accounts/views.py"
click node_dashboard_charts "https://github.com/mahendra-35/scam_schield/blob/main/static/js/charts.js"
click node_awareness_views "https://github.com/mahendra-35/scam_schield/blob/main/awareness/views.py"
click node_learning_content "https://github.com/mahendra-35/scam_schield/blob/main/awareness/models.py"
click node_content_seeder "https://github.com/mahendra-35/scam_schield/blob/main/awareness/management/commands/seed_scam_data.py"
click node_report_views "https://github.com/mahendra-35/scam_schield/blob/main/reports/views.py"
click node_incident_reports "https://github.com/mahendra-35/scam_schield/blob/main/reports/models.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_checker,node_engine,node_input_validation,node_text_rules,node_url_inspector,node_risk_scoring,node_analysis_records,node_analysis_ui,node_member toneBlue
class node_user_profile,node_account_views,node_dashboard_charts toneAmber
class node_awareness_views,node_learning_content,node_content_seeder toneMint
class node_report_views,node_incident_reports toneRose
class node_visitor,node_admin toneIndigo
```

## Components

### Risk analysis

- [Scam checker API](https://github.com/mahendra-35/scam_schield/blob/main/analyzer/views.py): `analyzer/views.py`
- [Analysis orchestrator](https://github.com/mahendra-35/scam_schield/blob/main/analyzer/engine.py): `analyzer/engine.py`
- [Input validation](https://github.com/mahendra-35/scam_schield/blob/main/analyzer/validators.py): `analyzer/validators.py`
- [Text rule matching](https://github.com/mahendra-35/scam_schield/blob/main/analyzer/rules.py): `analyzer/rules.py`
- [URL inspection](https://github.com/mahendra-35/scam_schield/blob/main/analyzer/url_analysis.py): `analyzer/url_analysis.py`
- [Risk scoring](https://github.com/mahendra-35/scam_schield/blob/main/analyzer/scoring.py): `analyzer/scoring.py`
- [Scan history](https://github.com/mahendra-35/scam_schield/blob/main/analyzer/models.py): `analyzer/models.py`
- [Checker interface](https://github.com/mahendra-35/scam_schield/blob/main/static/js/analyzer.js): `static/js/analyzer.js`

### Accounts and dashboards

- [User profile](https://github.com/mahendra-35/scam_schield/blob/main/accounts/models.py): `accounts/models.py`
- [Accounts and dashboards](https://github.com/mahendra-35/scam_schield/blob/main/accounts/views.py): `accounts/views.py`
- [Dashboard charts](https://github.com/mahendra-35/scam_schield/blob/main/static/js/charts.js): `static/js/charts.js`

### Awareness hub

- [Learning center](https://github.com/mahendra-35/scam_schield/blob/main/awareness/views.py): `awareness/views.py`
- [Guides and categories](https://github.com/mahendra-35/scam_schield/blob/main/awareness/models.py): `awareness/models.py`
- [Educational data seeder](https://github.com/mahendra-35/scam_schield/blob/main/awareness/management/commands/seed_scam_data.py): `awareness/management/commands/seed_scam_data.py`

### Incident reporting

- [Incident submission](https://github.com/mahendra-35/scam_schield/blob/main/reports/views.py): `reports/views.py`
- [Community reports](https://github.com/mahendra-35/scam_schield/blob/main/reports/models.py): `reports/models.py`

### Other components

- **Visitor**
- **Signed-in user**
- **Administrator**

## Connections

- Visitor → Scam checker API: submits for analysis
- Scam checker API → Analysis orchestrator: invokes analysis (evidence: `analyzer/views.py`)
- Analysis orchestrator → Input validation: validates input (evidence: `analyzer/engine.py`)
- Analysis orchestrator → Text rule matching: evaluates text (evidence: `analyzer/engine.py`)
- Analysis orchestrator → URL inspection: inspects URL (evidence: `analyzer/engine.py`)
- Analysis orchestrator → Risk scoring: calculates score (evidence: `analyzer/engine.py`)
- Scam checker API → Scan history: stores scan (evidence: `analyzer/views.py`)
- Scam checker API → Checker interface: serves checker
- Signed-in user → Accounts and dashboards: opens dashboard (evidence: `accounts/views.py`)
- Administrator → Accounts and dashboards: opens admin dashboard (evidence: `accounts/views.py`)
- Accounts and dashboards → User profile: creates profile (evidence: `accounts/views.py`)
- Accounts and dashboards → Scan history: reads scan history (evidence: `accounts/views.py`)
- Accounts and dashboards → Community reports: reads incident reports (evidence: `accounts/views.py`)
- Accounts and dashboards → Dashboard charts: provides chart data
- Visitor → Learning center: browses guides
- Learning center → Guides and categories: queries articles (evidence: `awareness/views.py`)
- Educational data seeder → Guides and categories: seeds guides (evidence: `awareness/management/commands/seed_scam_data.py`)
- Visitor → Incident submission: submits incident
- Incident submission → Community reports: creates report (evidence: `reports/views.py`)
