# unnikrishnandec03-lgtm/trustgate architecture

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

- Interactive diagram: https://gitdiagram.com/unnikrishnandec03-lgtm/trustgate
- Repository: https://github.com/unnikrishnandec03-lgtm/trustgate

## Overview

TrustGate Sentinel is a forensic fraud-gateway interface for reviewing document, identity, voice, and transaction threats. Operators sign in, select a preset or ingest a file, inspect scan findings and risk signals, then review history or quarantine a suspicious entity; scan records are persisted to Firestore. The repository describes multimodal triage, but the sampled implementation chiefly shows a UI workflow and preset-driven analysis, not a backend AI detection engine. Edges are limited to relationships visible in excerpts or the source index.

Main entry points: [`New folder (2)/src/App.tsx`](https://github.com/unnikrishnandec03-lgtm/trustgate/blob/main/New%20folder%20(2)/src/App.tsx) (Application flow), [`New folder (2)/src/components/WebForensicWorkspace.tsx`](https://github.com/unnikrishnandec03-lgtm/trustgate/blob/main/New%20folder%20(2)/src/components/WebForensicWorkspace.tsx) (Web workspace), [`New folder (2)/src/hooks/useFirebaseAuth.ts`](https://github.com/unnikrishnandec03-lgtm/trustgate/blob/main/New%20folder%20(2)/src/hooks/useFirebaseAuth.ts) (Auth state), [`New folder (2)/src/components/DualViewCanvas.tsx`](https://github.com/unnikrishnandec03-lgtm/trustgate/blob/main/New%20folder%20(2)/src/components/DualViewCanvas.tsx) (Document comparison)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_access["Operator Access"]
  node_authui["Login screens<br/>[LoginScreen.tsx]"]
  node_authmodal["Authorization modal"]
  node_authhook["Auth state<br/>[useFirebaseAuth.ts]"]
end

subgraph group_workflow["Forensic Workflow"]
  node_app["Application flow<br/>[App.tsx]"]
  node_web["Web workspace"]
  node_mobile["Mobile workspace"]
  node_presets["Scenario presets<br/>[mockPresets.ts]"]
  node_history["Scan history"]
  node_metrics["Latency metrics"]
  node_health["Health monitor"]
end

subgraph group_analysis["Threat Review"]
  node_canvas["Document comparison<br/>[DualViewCanvas.tsx]"]
  node_renderers["Document renderers"]
  node_ela["ELA generator<br/>[elaGenerator.ts]"]
  node_hallmarks["Forensic findings"]
  node_risk["Risk meter<br/>[RiskMeterRing.tsx]"]
  node_audio["Audio spectrogram"]
  node_transactions["Transaction graph"]
  node_vectors["Threat vector radar"]
end

subgraph group_platform["Data and Platform"]
  node_firebase["Firebase services<br/>[firebase.ts]"]
  node_firestore[("Firestore")]
  node_types["Forensic data model<br/>[forensic.ts]"]
  node_glass["Glass effects<br/>[LiquidGlass.tsx]"]
end

node_operator(("Security operator"))

node_operator -->|"uses"| node_app
node_app -->|"gets auth state"| node_authhook
node_authhook -->|"calls auth helpers"| node_firebase
node_app -->|"persists scans"| node_firebase
node_app -->|"subscribes to audits"| node_firebase
node_firebase -->|"reads and writes"| node_firestore
node_authhook -->|"writes profiles"| node_firestore
node_app -->|"loads scenarios"| node_presets
node_app -.->|"presents workspace"| node_web
node_app -.->|"presents workspace"| node_mobile
node_app -.->|"supplies scan history"| node_history
node_app -->|"uses scan types"| node_types
node_web -->|"renders comparison"| node_canvas
node_mobile -.->|"renders comparison"| node_canvas
node_canvas -->|"uses renderers"| node_renderers
node_canvas -->|"uses ELA"| node_ela
node_web -.->|"shows findings"| node_hallmarks
node_hallmarks -->|"renders meter"| node_risk
node_web -.->|"shows audio analysis"| node_audio
node_web -.->|"shows transaction graph"| node_transactions
node_web -.->|"shows threat vectors"| node_vectors
node_web -.->|"shows scan history"| node_history
node_web -.->|"shows latency"| node_metrics
node_web -.->|"offers health view"| node_health
node_authui -->|"uses auth"| node_authhook
node_authmodal -->|"receives auth actions"| node_authhook
node_glass -.->|"uses effects"| node_glass

click node_app "https://github.com/unnikrishnandec03-lgtm/trustgate/blob/main/New%20folder%20(2)/src/App.tsx"
click node_web "https://github.com/unnikrishnandec03-lgtm/trustgate/blob/main/New%20folder%20(2)/src/components/WebForensicWorkspace.tsx"
click node_mobile "https://github.com/unnikrishnandec03-lgtm/trustgate/blob/main/New%20folder%20(2)/src/components/MobileForensicInterface.tsx"
click node_presets "https://github.com/unnikrishnandec03-lgtm/trustgate/blob/main/New%20folder%20(2)/src/data/mockPresets.ts"
click node_authui "https://github.com/unnikrishnandec03-lgtm/trustgate/blob/main/New%20folder%20(2)/src/components/LoginScreen.tsx"
click node_authmodal "https://github.com/unnikrishnandec03-lgtm/trustgate/blob/main/New%20folder%20(2)/src/components/LoginAuthorizationModal.tsx"
click node_authhook "https://github.com/unnikrishnandec03-lgtm/trustgate/blob/main/New%20folder%20(2)/src/hooks/useFirebaseAuth.ts"
click node_firebase "https://github.com/unnikrishnandec03-lgtm/trustgate/blob/main/New%20folder%20(2)/src/lib/firebase.ts"
click node_types "https://github.com/unnikrishnandec03-lgtm/trustgate/blob/main/New%20folder%20(2)/src/types/forensic.ts"
click node_canvas "https://github.com/unnikrishnandec03-lgtm/trustgate/blob/main/New%20folder%20(2)/src/components/DualViewCanvas.tsx"
click node_renderers "https://github.com/unnikrishnandec03-lgtm/trustgate/blob/main/New%20folder%20(2)/src/utils/documentRenderers.ts"
click node_ela "https://github.com/unnikrishnandec03-lgtm/trustgate/blob/main/New%20folder%20(2)/src/utils/elaGenerator.ts"
click node_hallmarks "https://github.com/unnikrishnandec03-lgtm/trustgate/blob/main/New%20folder%20(2)/src/components/ForensicHallmarksDrawer.tsx"
click node_risk "https://github.com/unnikrishnandec03-lgtm/trustgate/blob/main/New%20folder%20(2)/src/components/RiskMeterRing.tsx"
click node_audio "https://github.com/unnikrishnandec03-lgtm/trustgate/blob/main/New%20folder%20(2)/src/components/AudioSpectrogramViewer.tsx"
click node_transactions "https://github.com/unnikrishnandec03-lgtm/trustgate/blob/main/New%20folder%20(2)/src/components/TransactionGraphViewer.tsx"
click node_vectors "https://github.com/unnikrishnandec03-lgtm/trustgate/blob/main/New%20folder%20(2)/src/components/VectorRadarChart.tsx"
click node_history "https://github.com/unnikrishnandec03-lgtm/trustgate/blob/main/New%20folder%20(2)/src/components/HistoricalScansTable.tsx"
click node_metrics "https://github.com/unnikrishnandec03-lgtm/trustgate/blob/main/New%20folder%20(2)/src/components/LatencyThroughputChart.tsx"
click node_health "https://github.com/unnikrishnandec03-lgtm/trustgate/blob/main/New%20folder%20(2)/src/components/GlobalHealthMonitor.tsx"
click node_glass "https://github.com/unnikrishnandec03-lgtm/trustgate/blob/main/New%20folder%20(2)/src/components/LiquidGlass.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_authui,node_authmodal,node_authhook toneBlue
class node_app,node_web,node_mobile,node_presets,node_history,node_metrics,node_health toneAmber
class node_canvas,node_renderers,node_ela,node_hallmarks,node_risk,node_audio,node_transactions,node_vectors toneMint
class node_firebase,node_firestore,node_types,node_glass toneRose
class node_operator toneIndigo
```

## Components

### Operator Access

- [Login screens](https://github.com/unnikrishnandec03-lgtm/trustgate/blob/main/New%20folder%20(2)/src/components/LoginScreen.tsx): `New folder (2)/src/components/LoginScreen.tsx`
- [Authorization modal](https://github.com/unnikrishnandec03-lgtm/trustgate/blob/main/New%20folder%20(2)/src/components/LoginAuthorizationModal.tsx): `New folder (2)/src/components/LoginAuthorizationModal.tsx`
- [Auth state](https://github.com/unnikrishnandec03-lgtm/trustgate/blob/main/New%20folder%20(2)/src/hooks/useFirebaseAuth.ts): `New folder (2)/src/hooks/useFirebaseAuth.ts`

### Forensic Workflow

- [Application flow](https://github.com/unnikrishnandec03-lgtm/trustgate/blob/main/New%20folder%20(2)/src/App.tsx): `New folder (2)/src/App.tsx`
- [Web workspace](https://github.com/unnikrishnandec03-lgtm/trustgate/blob/main/New%20folder%20(2)/src/components/WebForensicWorkspace.tsx): `New folder (2)/src/components/WebForensicWorkspace.tsx`
- [Mobile workspace](https://github.com/unnikrishnandec03-lgtm/trustgate/blob/main/New%20folder%20(2)/src/components/MobileForensicInterface.tsx): `New folder (2)/src/components/MobileForensicInterface.tsx`
- [Scenario presets](https://github.com/unnikrishnandec03-lgtm/trustgate/blob/main/New%20folder%20(2)/src/data/mockPresets.ts): `New folder (2)/src/data/mockPresets.ts`
- [Scan history](https://github.com/unnikrishnandec03-lgtm/trustgate/blob/main/New%20folder%20(2)/src/components/HistoricalScansTable.tsx): `New folder (2)/src/components/HistoricalScansTable.tsx`
- [Latency metrics](https://github.com/unnikrishnandec03-lgtm/trustgate/blob/main/New%20folder%20(2)/src/components/LatencyThroughputChart.tsx): `New folder (2)/src/components/LatencyThroughputChart.tsx`
- [Health monitor](https://github.com/unnikrishnandec03-lgtm/trustgate/blob/main/New%20folder%20(2)/src/components/GlobalHealthMonitor.tsx): `New folder (2)/src/components/GlobalHealthMonitor.tsx`

### Threat Review

- [Document comparison](https://github.com/unnikrishnandec03-lgtm/trustgate/blob/main/New%20folder%20(2)/src/components/DualViewCanvas.tsx): `New folder (2)/src/components/DualViewCanvas.tsx`
- [Document renderers](https://github.com/unnikrishnandec03-lgtm/trustgate/blob/main/New%20folder%20(2)/src/utils/documentRenderers.ts): `New folder (2)/src/utils/documentRenderers.ts`
- [ELA generator](https://github.com/unnikrishnandec03-lgtm/trustgate/blob/main/New%20folder%20(2)/src/utils/elaGenerator.ts): `New folder (2)/src/utils/elaGenerator.ts`
- [Forensic findings](https://github.com/unnikrishnandec03-lgtm/trustgate/blob/main/New%20folder%20(2)/src/components/ForensicHallmarksDrawer.tsx): `New folder (2)/src/components/ForensicHallmarksDrawer.tsx`
- [Risk meter](https://github.com/unnikrishnandec03-lgtm/trustgate/blob/main/New%20folder%20(2)/src/components/RiskMeterRing.tsx): `New folder (2)/src/components/RiskMeterRing.tsx`
- [Audio spectrogram](https://github.com/unnikrishnandec03-lgtm/trustgate/blob/main/New%20folder%20(2)/src/components/AudioSpectrogramViewer.tsx): `New folder (2)/src/components/AudioSpectrogramViewer.tsx`
- [Transaction graph](https://github.com/unnikrishnandec03-lgtm/trustgate/blob/main/New%20folder%20(2)/src/components/TransactionGraphViewer.tsx): `New folder (2)/src/components/TransactionGraphViewer.tsx`
- [Threat vector radar](https://github.com/unnikrishnandec03-lgtm/trustgate/blob/main/New%20folder%20(2)/src/components/VectorRadarChart.tsx): `New folder (2)/src/components/VectorRadarChart.tsx`

### Data and Platform

- [Firebase services](https://github.com/unnikrishnandec03-lgtm/trustgate/blob/main/New%20folder%20(2)/src/lib/firebase.ts): `New folder (2)/src/lib/firebase.ts`
- **Firestore**
- [Forensic data model](https://github.com/unnikrishnandec03-lgtm/trustgate/blob/main/New%20folder%20(2)/src/types/forensic.ts): `New folder (2)/src/types/forensic.ts`
- [Glass effects](https://github.com/unnikrishnandec03-lgtm/trustgate/blob/main/New%20folder%20(2)/src/components/LiquidGlass.tsx): `New folder (2)/src/components/LiquidGlass.tsx`

### Other components

- **Security operator**

## Connections

- Security operator → Application flow: uses
- Application flow → Auth state: gets auth state (evidence: `New folder (2)/src/App.tsx`)
- Auth state → Firebase services: calls auth helpers (evidence: `New folder (2)/src/hooks/useFirebaseAuth.ts`)
- Application flow → Firebase services: persists scans (evidence: `New folder (2)/src/App.tsx`)
- Application flow → Firebase services: subscribes to audits (evidence: `New folder (2)/src/App.tsx`)
- Firebase services → Firestore: reads and writes (evidence: `New folder (2)/src/lib/firebase.ts`)
- Auth state → Firestore: writes profiles (evidence: `New folder (2)/src/hooks/useFirebaseAuth.ts`)
- Application flow → Scenario presets: loads scenarios (evidence: `New folder (2)/src/App.tsx`)
- Application flow → Web workspace: presents workspace (evidence: `New folder (2)/src/App.tsx`)
- Application flow → Mobile workspace: presents workspace
- Application flow → Scan history: supplies scan history (evidence: `New folder (2)/src/App.tsx`)
- Application flow → Forensic data model: uses scan types (evidence: `New folder (2)/src/App.tsx`)
- Web workspace → Document comparison: renders comparison (evidence: `New folder (2)/src/components/WebForensicWorkspace.tsx`)
- Mobile workspace → Document comparison: renders comparison (evidence: `New folder (2)/src/components/MobileForensicInterface.tsx`)
- Document comparison → Document renderers: uses renderers (evidence: `New folder (2)/src/components/DualViewCanvas.tsx`)
- Document comparison → ELA generator: uses ELA (evidence: `New folder (2)/src/components/DualViewCanvas.tsx`)
- Web workspace → Forensic findings: shows findings (evidence: `New folder (2)/src/components/WebForensicWorkspace.tsx`)
- Forensic findings → Risk meter: renders meter (evidence: `New folder (2)/src/components/ForensicHallmarksDrawer.tsx`)
- Web workspace → Audio spectrogram: shows audio analysis (evidence: `New folder (2)/src/components/WebForensicWorkspace.tsx`)
- Web workspace → Transaction graph: shows transaction graph (evidence: `New folder (2)/src/components/WebForensicWorkspace.tsx`)
- Web workspace → Threat vector radar: shows threat vectors (evidence: `New folder (2)/src/components/WebForensicWorkspace.tsx`)
- Web workspace → Scan history: shows scan history (evidence: `New folder (2)/src/components/WebForensicWorkspace.tsx`)
- Web workspace → Latency metrics: shows latency (evidence: `New folder (2)/src/components/WebForensicWorkspace.tsx`)
- Web workspace → Health monitor: offers health view
- Login screens → Auth state: uses auth (evidence: `New folder (2)/src/components/LoginScreen.tsx`)
- Authorization modal → Auth state: receives auth actions (evidence: `New folder (2)/src/components/LoginAuthorizationModal.tsx`)
- Glass effects → Glass effects: uses effects (evidence: `New folder (2)/src/components/LiquidGlass.tsx`)
