# neerjain2008/scamshield-oss architecture

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

- Interactive diagram: https://gitdiagram.com/neerjain2008/scamshield-oss
- Repository: https://github.com/neerjain2008/scamshield-oss

## Overview

ScamShield is a privacy-focused scam detection web app. Users enter a message or URL, or provide a screenshot for in-browser OCR; the home page runs deterministic analysis, then requests an explanation from the local Ollama service and displays the result and recommended actions. The README also describes accessibility features, local-only processing, and message, URL, and screenshot scanners. Source excerpts show the main orchestration and API fallback; some UI components and OCR internals were not fully sampled, so their internal relationships are not inferred.

Main entry points: [`src/app/page.tsx`](https://github.com/neerjain2008/scamshield-oss/blob/main/src/app/page.tsx) (Scanner Orchestrator), [`src/lib/audio.ts`](https://github.com/neerjain2008/scamshield-oss/blob/main/src/lib/audio.ts) (Speech And Sound), [`src/components/AnalysisCard.tsx`](https://github.com/neerjain2008/scamshield-oss/blob/main/src/components/AnalysisCard.tsx) (Message URL Screenshot Scanner), [`src/app/api/explain/route.ts`](https://github.com/neerjain2008/scamshield-oss/blob/main/src/app/api/explain/route.ts) (Explanation API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workflow["Scanning Workflow"]
  node_home["Scanner Orchestrator<br/>[page.tsx]"]
  node_scanner["Message URL Screenshot Scanner<br/>[AnalysisCard.tsx]"]
  node_ocr["Screenshot OCR<br/>[AnalysisCard.tsx]"]
  node_result["Security Results Dashboard"]
end

subgraph group_intelligence["Threat Intelligence"]
  node_engine["Deterministic Scam Engine<br/>[scamEngine.ts]"]
  node_explain_api["Explanation API<br/>[route.ts]"]
end

subgraph group_experience["User Experience"]
  node_audio["Speech And Sound<br/>[audio.ts]"]
  node_settings["Accessibility Settings"]
  node_navbar["Navigation<br/>[Navbar.tsx]"]
  node_hero["Hero Section<br/>[HeroSection.tsx]"]
  node_features["Feature Section<br/>[FeatureSection.tsx]"]
  node_how["How It Works"]
  node_demo["Interactive Demo<br/>[DemoSection.tsx]"]
  node_opensource["Open Source Section"]
  node_footer["Footer<br/>[Footer.tsx]"]
  node_brand["Brand Logo<br/>[BrandLogo.tsx]"]
  node_github_icon["GitHub Icon<br/>[GithubIcon.tsx]"]
  node_geometric_hero["Geometric Hero"]
  node_hero_demo["Hero Component Demo<br/>[demo.tsx]"]
end

subgraph group_privacy["Privacy And Guidance"]
  node_privacy_page["Privacy Information<br/>[page.tsx]"]
  node_local_page["Local Processing Guide<br/>[page.tsx]"]
end

node_user(("User"))
node_ollama{{"Local Ollama"}}

node_user -->|"opens scanner"| node_home
node_home -->|"renders and handles input"| node_scanner
node_scanner -->|"recognizes screenshots"| node_ocr
node_home -->|"analyzes input"| node_engine
node_home -->|"requests explanation"| node_explain_api
node_explain_api -->|"creates fallback explanation"| node_engine
node_explain_api -->|"queries local model"| node_ollama
node_home -->|"renders analysis"| node_result
node_home -->|"renders settings"| node_settings
node_home -->|"renders navigation"| node_navbar
node_home -->|"renders hero"| node_hero
node_home -->|"renders features"| node_features
node_home -->|"renders workflow guide"| node_how
node_home -->|"renders demos"| node_demo
node_home -->|"renders open source section"| node_opensource
node_home -->|"renders footer"| node_footer
node_home -->|"uses audio"| node_audio
node_scanner -->|"uses audio feedback"| node_audio
node_result -->|"uses audio feedback"| node_audio
node_settings -->|"configures audio"| node_audio
node_opensource -->|"renders icon"| node_github_icon
node_privacy_page -->|"renders brand"| node_brand
node_local_page -->|"renders brand"| node_brand
node_local_page -->|"renders shapes"| node_geometric_hero
node_hero_demo -->|"renders demo"| node_geometric_hero

click node_home "https://github.com/neerjain2008/scamshield-oss/blob/main/src/app/page.tsx"
click node_scanner "https://github.com/neerjain2008/scamshield-oss/blob/main/src/components/AnalysisCard.tsx"
click node_ocr "https://github.com/neerjain2008/scamshield-oss/blob/main/src/components/AnalysisCard.tsx"
click node_engine "https://github.com/neerjain2008/scamshield-oss/blob/main/src/lib/scamEngine.ts"
click node_explain_api "https://github.com/neerjain2008/scamshield-oss/blob/main/src/app/api/explain/route.ts"
click node_result "https://github.com/neerjain2008/scamshield-oss/blob/main/src/components/SecurityDashboardResult.tsx"
click node_audio "https://github.com/neerjain2008/scamshield-oss/blob/main/src/lib/audio.ts"
click node_settings "https://github.com/neerjain2008/scamshield-oss/blob/main/src/components/AdvancedSettingsModal.tsx"
click node_navbar "https://github.com/neerjain2008/scamshield-oss/blob/main/src/components/Navbar.tsx"
click node_hero "https://github.com/neerjain2008/scamshield-oss/blob/main/src/components/HeroSection.tsx"
click node_features "https://github.com/neerjain2008/scamshield-oss/blob/main/src/components/FeatureSection.tsx"
click node_how "https://github.com/neerjain2008/scamshield-oss/blob/main/src/components/HowItWorksSection.tsx"
click node_demo "https://github.com/neerjain2008/scamshield-oss/blob/main/src/components/DemoSection.tsx"
click node_opensource "https://github.com/neerjain2008/scamshield-oss/blob/main/src/components/OpenSourceSection.tsx"
click node_footer "https://github.com/neerjain2008/scamshield-oss/blob/main/src/components/Footer.tsx"
click node_brand "https://github.com/neerjain2008/scamshield-oss/blob/main/src/components/BrandLogo.tsx"
click node_github_icon "https://github.com/neerjain2008/scamshield-oss/blob/main/src/components/icons/GithubIcon.tsx"
click node_privacy_page "https://github.com/neerjain2008/scamshield-oss/blob/main/src/app/privacy/page.tsx"
click node_local_page "https://github.com/neerjain2008/scamshield-oss/blob/main/src/app/why-local-matters/page.tsx"
click node_geometric_hero "https://github.com/neerjain2008/scamshield-oss/blob/main/src/components/ui/shape-landing-hero.tsx"
click node_hero_demo "https://github.com/neerjain2008/scamshield-oss/blob/main/src/components/ui/demo.tsx"

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_home,node_scanner,node_ocr,node_result,node_user toneBlue
class node_engine,node_explain_api toneAmber
class node_audio,node_settings,node_navbar,node_hero,node_features,node_how,node_demo,node_opensource,node_footer,node_brand,node_github_icon,node_geometric_hero,node_hero_demo toneMint
class node_privacy_page,node_local_page toneRose
class node_ollama toneIndigo
```

## Components

### Scanning Workflow

- [Scanner Orchestrator](https://github.com/neerjain2008/scamshield-oss/blob/main/src/app/page.tsx): `src/app/page.tsx`
- [Message URL Screenshot Scanner](https://github.com/neerjain2008/scamshield-oss/blob/main/src/components/AnalysisCard.tsx): `src/components/AnalysisCard.tsx`
- [Screenshot OCR](https://github.com/neerjain2008/scamshield-oss/blob/main/src/components/AnalysisCard.tsx): `src/components/AnalysisCard.tsx`
- [Security Results Dashboard](https://github.com/neerjain2008/scamshield-oss/blob/main/src/components/SecurityDashboardResult.tsx): `src/components/SecurityDashboardResult.tsx`

### Threat Intelligence

- [Deterministic Scam Engine](https://github.com/neerjain2008/scamshield-oss/blob/main/src/lib/scamEngine.ts): `src/lib/scamEngine.ts`
- [Explanation API](https://github.com/neerjain2008/scamshield-oss/blob/main/src/app/api/explain/route.ts): `src/app/api/explain/route.ts`

### User Experience

- [Speech And Sound](https://github.com/neerjain2008/scamshield-oss/blob/main/src/lib/audio.ts): `src/lib/audio.ts`
- [Accessibility Settings](https://github.com/neerjain2008/scamshield-oss/blob/main/src/components/AdvancedSettingsModal.tsx): `src/components/AdvancedSettingsModal.tsx`
- [Navigation](https://github.com/neerjain2008/scamshield-oss/blob/main/src/components/Navbar.tsx): `src/components/Navbar.tsx`
- [Hero Section](https://github.com/neerjain2008/scamshield-oss/blob/main/src/components/HeroSection.tsx): `src/components/HeroSection.tsx`
- [Feature Section](https://github.com/neerjain2008/scamshield-oss/blob/main/src/components/FeatureSection.tsx): `src/components/FeatureSection.tsx`
- [How It Works](https://github.com/neerjain2008/scamshield-oss/blob/main/src/components/HowItWorksSection.tsx): `src/components/HowItWorksSection.tsx`
- [Interactive Demo](https://github.com/neerjain2008/scamshield-oss/blob/main/src/components/DemoSection.tsx): `src/components/DemoSection.tsx`
- [Open Source Section](https://github.com/neerjain2008/scamshield-oss/blob/main/src/components/OpenSourceSection.tsx): `src/components/OpenSourceSection.tsx`
- [Footer](https://github.com/neerjain2008/scamshield-oss/blob/main/src/components/Footer.tsx): `src/components/Footer.tsx`
- [Brand Logo](https://github.com/neerjain2008/scamshield-oss/blob/main/src/components/BrandLogo.tsx): `src/components/BrandLogo.tsx`
- [GitHub Icon](https://github.com/neerjain2008/scamshield-oss/blob/main/src/components/icons/GithubIcon.tsx): `src/components/icons/GithubIcon.tsx`
- [Geometric Hero](https://github.com/neerjain2008/scamshield-oss/blob/main/src/components/ui/shape-landing-hero.tsx): `src/components/ui/shape-landing-hero.tsx`
- [Hero Component Demo](https://github.com/neerjain2008/scamshield-oss/blob/main/src/components/ui/demo.tsx): `src/components/ui/demo.tsx`

### Privacy And Guidance

- [Privacy Information](https://github.com/neerjain2008/scamshield-oss/blob/main/src/app/privacy/page.tsx): `src/app/privacy/page.tsx`
- [Local Processing Guide](https://github.com/neerjain2008/scamshield-oss/blob/main/src/app/why-local-matters/page.tsx): `src/app/why-local-matters/page.tsx`

### Other components

- **User**
- **Local Ollama**

## Connections

- User → Scanner Orchestrator: opens scanner (evidence: `src/app/page.tsx`)
- Scanner Orchestrator → Message URL Screenshot Scanner: renders and handles input (evidence: `src/app/page.tsx`)
- Message URL Screenshot Scanner → Screenshot OCR: recognizes screenshots (evidence: `README.md`)
- Scanner Orchestrator → Deterministic Scam Engine: analyzes input (evidence: `src/app/page.tsx`)
- Scanner Orchestrator → Explanation API: requests explanation (evidence: `src/app/page.tsx`)
- Explanation API → Deterministic Scam Engine: creates fallback explanation (evidence: `src/app/api/explain/route.ts`)
- Explanation API → Local Ollama: queries local model (evidence: `src/app/api/explain/route.ts`)
- Scanner Orchestrator → Security Results Dashboard: renders analysis (evidence: `src/app/page.tsx`)
- Scanner Orchestrator → Accessibility Settings: renders settings (evidence: `src/app/page.tsx`)
- Scanner Orchestrator → Navigation: renders navigation (evidence: `src/app/page.tsx`)
- Scanner Orchestrator → Hero Section: renders hero (evidence: `src/app/page.tsx`)
- Scanner Orchestrator → Feature Section: renders features (evidence: `src/app/page.tsx`)
- Scanner Orchestrator → How It Works: renders workflow guide (evidence: `src/app/page.tsx`)
- Scanner Orchestrator → Interactive Demo: renders demos (evidence: `src/app/page.tsx`)
- Scanner Orchestrator → Open Source Section: renders open source section (evidence: `src/app/page.tsx`)
- Scanner Orchestrator → Footer: renders footer (evidence: `src/app/page.tsx`)
- Scanner Orchestrator → Speech And Sound: uses audio (evidence: `src/app/page.tsx`)
- Message URL Screenshot Scanner → Speech And Sound: uses audio feedback (evidence: `src/components/AnalysisCard.tsx`)
- Security Results Dashboard → Speech And Sound: uses audio feedback (evidence: `src/components/SecurityDashboardResult.tsx`)
- Accessibility Settings → Speech And Sound: configures audio (evidence: `src/components/AdvancedSettingsModal.tsx`)
- Open Source Section → GitHub Icon: renders icon (evidence: `src/components/OpenSourceSection.tsx`)
- Privacy Information → Brand Logo: renders brand (evidence: `src/app/privacy/page.tsx`)
- Local Processing Guide → Brand Logo: renders brand (evidence: `src/app/why-local-matters/page.tsx`)
- Local Processing Guide → Geometric Hero: renders shapes (evidence: `src/app/why-local-matters/page.tsx`)
- Hero Component Demo → Geometric Hero: renders demo (evidence: `src/components/ui/demo.tsx`)
