# theunstopabble/satark-ai architecture

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

- Interactive diagram: https://gitdiagram.com/theunstopabble/satark-ai
- Repository: https://github.com/theunstopabble/satark-ai

## Overview

Satark-AI detects synthetic audio and images, verifies enrolled speakers, and provides monitoring, history, analytics, feedback, and interactive learning features. The main path runs from an authenticated browser upload through the API to audio analysis and persisted scan results; image scans use a separate proxy pipeline. Source excerpts establish several calls, while README statements support documented capabilities whose implementation details were not sampled.

Main entry points: [`apps/web/src/AuthenticatedShell.tsx`](https://github.com/theunstopabble/satark-ai/blob/main/apps/web/src/AuthenticatedShell.tsx) (Authenticated shell), [`apps/api/src/index.ts`](https://github.com/theunstopabble/satark-ai/blob/main/apps/api/src/index.ts) (API routes), [`apps/web/src/api/client.ts`](https://github.com/theunstopabble/satark-ai/blob/main/apps/web/src/api/client.ts) (API client), [`apps/engine/main.py`](https://github.com/theunstopabble/satark-ai/blob/main/apps/engine/main.py) (Engine endpoints)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web experience"]
  node_app["App routing<br/>[App.tsx]"]
  node_authshell["Authenticated shell"]
  node_audio_upload["Audio scan<br/>[AudioUpload.tsx]"]
  node_api_client["API client<br/>[client.ts]"]
  node_live["Live monitor<br/>[LiveMonitor.tsx]"]
  node_image_upload["Image scan<br/>[ImageUpload.tsx]"]
  node_speaker_ui["Speaker identity"]
  node_history["History and reports<br/>[History.tsx]"]
  node_analytics["Scan analytics<br/>[AnalyticsStats.tsx]"]
  node_feedback["Scan feedback<br/>[FeedbackWidget.tsx]"]
  node_game["Deepfake game<br/>[DeepfakeGame.tsx]"]
end

subgraph group_api["API and persistence"]
  node_api_service["API routes<br/>[index.ts]"]
  node_auth["Authentication<br/>[auth.ts]"]
  node_speaker_routes["Speaker routes<br/>[speaker.ts]"]
  node_database[("Scan and speaker records<br/>[schema.ts]")]
end

subgraph group_audio["Audio and identity"]
  node_engine_api["Engine endpoints<br/>[main.py]"]
  node_audio_analysis["Audio forensics<br/>[detect.py]"]
  node_speaker_engine["Speaker embeddings<br/>[speaker.py]"]
end

subgraph group_image["Image detection"]
  node_worker["Image proxy<br/>[index.ts]"]
  node_huggingface{{"Hugging Face inference"}}
end

node_user(("User"))

node_user -->|"uses"| node_app
node_app -->|"routes to"| node_authshell
node_authshell -->|"renders"| node_audio_upload
node_audio_upload -->|"submits scans"| node_api_client
node_api_client -->|"requests scans"| node_api_service
node_api_service -->|"protects routes"| node_auth
node_api_service -->|"reads and writes"| node_database
node_api_service -.->|"forwards audio"| node_engine_api
node_engine_api -->|"analyzes audio"| node_audio_analysis
node_authshell -.->|"offers monitoring"| node_live
node_authshell -.->|"offers image scans"| node_image_upload
node_image_upload -.->|"submits images"| node_api_client
node_api_client -->|"requests image scan"| node_api_service
node_api_service -.->|"proxies image"| node_worker
node_worker -.->|"forwards image"| node_huggingface
node_authshell -->|"renders identity"| node_speaker_ui
node_speaker_ui -.->|"enrolls and verifies"| node_api_client
node_api_service -->|"mounts routes"| node_speaker_routes
node_speaker_routes -->|"requests embeddings"| node_engine_api
node_engine_api -->|"extracts embeddings"| node_speaker_engine
node_speaker_routes -->|"stores identity data"| node_database
node_authshell -->|"routes to"| node_history
node_history -.->|"loads scan history"| node_api_client
node_history -.->|"summarizes scans"| node_analytics
node_audio_upload -->|"collects feedback"| node_feedback
node_authshell -.->|"offers challenge mode"| node_game

click node_app "https://github.com/theunstopabble/satark-ai/blob/main/apps/web/src/App.tsx"
click node_authshell "https://github.com/theunstopabble/satark-ai/blob/main/apps/web/src/AuthenticatedShell.tsx"
click node_audio_upload "https://github.com/theunstopabble/satark-ai/blob/main/apps/web/src/components/AudioUpload.tsx"
click node_api_client "https://github.com/theunstopabble/satark-ai/blob/main/apps/web/src/api/client.ts"
click node_live "https://github.com/theunstopabble/satark-ai/blob/main/apps/web/src/components/LiveMonitor.tsx"
click node_image_upload "https://github.com/theunstopabble/satark-ai/blob/main/apps/web/src/components/ImageUpload.tsx"
click node_speaker_ui "https://github.com/theunstopabble/satark-ai/blob/main/apps/web/src/components/SpeakerIdentity.tsx"
click node_history "https://github.com/theunstopabble/satark-ai/blob/main/apps/web/src/pages/History.tsx"
click node_analytics "https://github.com/theunstopabble/satark-ai/blob/main/apps/web/src/components/AnalyticsStats.tsx"
click node_feedback "https://github.com/theunstopabble/satark-ai/blob/main/apps/web/src/components/FeedbackWidget.tsx"
click node_game "https://github.com/theunstopabble/satark-ai/blob/main/apps/web/src/components/DeepfakeGame.tsx"
click node_api_service "https://github.com/theunstopabble/satark-ai/blob/main/apps/api/src/index.ts"
click node_auth "https://github.com/theunstopabble/satark-ai/blob/main/apps/api/src/middleware/auth.ts"
click node_speaker_routes "https://github.com/theunstopabble/satark-ai/blob/main/apps/api/src/routes/speaker.ts"
click node_database "https://github.com/theunstopabble/satark-ai/blob/main/apps/api/src/db/schema.ts"
click node_engine_api "https://github.com/theunstopabble/satark-ai/blob/main/apps/engine/main.py"
click node_audio_analysis "https://github.com/theunstopabble/satark-ai/blob/main/apps/engine/detect.py"
click node_speaker_engine "https://github.com/theunstopabble/satark-ai/blob/main/apps/engine/speaker.py"
click node_worker "https://github.com/theunstopabble/satark-ai/blob/main/apps/worker/src/index.ts"

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_authshell,node_audio_upload,node_api_client,node_live,node_image_upload,node_speaker_ui,node_history,node_analytics,node_feedback,node_game,node_user toneBlue
class node_api_service,node_auth,node_speaker_routes,node_database toneAmber
class node_engine_api,node_audio_analysis,node_speaker_engine toneMint
class node_worker,node_huggingface toneRose
```

## Components

### Web experience

- [App routing](https://github.com/theunstopabble/satark-ai/blob/main/apps/web/src/App.tsx): `apps/web/src/App.tsx`
- [Authenticated shell](https://github.com/theunstopabble/satark-ai/blob/main/apps/web/src/AuthenticatedShell.tsx): `apps/web/src/AuthenticatedShell.tsx`
- [Audio scan](https://github.com/theunstopabble/satark-ai/blob/main/apps/web/src/components/AudioUpload.tsx): `apps/web/src/components/AudioUpload.tsx`
- [API client](https://github.com/theunstopabble/satark-ai/blob/main/apps/web/src/api/client.ts): `apps/web/src/api/client.ts`
- [Live monitor](https://github.com/theunstopabble/satark-ai/blob/main/apps/web/src/components/LiveMonitor.tsx): `apps/web/src/components/LiveMonitor.tsx`
- [Image scan](https://github.com/theunstopabble/satark-ai/blob/main/apps/web/src/components/ImageUpload.tsx): `apps/web/src/components/ImageUpload.tsx`
- [Speaker identity](https://github.com/theunstopabble/satark-ai/blob/main/apps/web/src/components/SpeakerIdentity.tsx): `apps/web/src/components/SpeakerIdentity.tsx`
- [History and reports](https://github.com/theunstopabble/satark-ai/blob/main/apps/web/src/pages/History.tsx): `apps/web/src/pages/History.tsx`
- [Scan analytics](https://github.com/theunstopabble/satark-ai/blob/main/apps/web/src/components/AnalyticsStats.tsx): `apps/web/src/components/AnalyticsStats.tsx`
- [Scan feedback](https://github.com/theunstopabble/satark-ai/blob/main/apps/web/src/components/FeedbackWidget.tsx): `apps/web/src/components/FeedbackWidget.tsx`
- [Deepfake game](https://github.com/theunstopabble/satark-ai/blob/main/apps/web/src/components/DeepfakeGame.tsx): `apps/web/src/components/DeepfakeGame.tsx`

### API and persistence

- [API routes](https://github.com/theunstopabble/satark-ai/blob/main/apps/api/src/index.ts): `apps/api/src/index.ts`
- [Authentication](https://github.com/theunstopabble/satark-ai/blob/main/apps/api/src/middleware/auth.ts): `apps/api/src/middleware/auth.ts`
- [Speaker routes](https://github.com/theunstopabble/satark-ai/blob/main/apps/api/src/routes/speaker.ts): `apps/api/src/routes/speaker.ts`
- [Scan and speaker records](https://github.com/theunstopabble/satark-ai/blob/main/apps/api/src/db/schema.ts): `apps/api/src/db/schema.ts`

### Audio and identity

- [Engine endpoints](https://github.com/theunstopabble/satark-ai/blob/main/apps/engine/main.py): `apps/engine/main.py`
- [Audio forensics](https://github.com/theunstopabble/satark-ai/blob/main/apps/engine/detect.py): `apps/engine/detect.py`
- [Speaker embeddings](https://github.com/theunstopabble/satark-ai/blob/main/apps/engine/speaker.py): `apps/engine/speaker.py`

### Image detection

- [Image proxy](https://github.com/theunstopabble/satark-ai/blob/main/apps/worker/src/index.ts): `apps/worker/src/index.ts`
- **Hugging Face inference**

### Other components

- **User**

## Connections

- User → App routing: uses (evidence: `apps/web/src/App.tsx`)
- App routing → Authenticated shell: routes to (evidence: `apps/web/src/App.tsx`)
- Authenticated shell → Audio scan: renders (evidence: `apps/web/src/AuthenticatedShell.tsx`)
- Audio scan → API client: submits scans (evidence: `apps/web/src/components/AudioUpload.tsx`)
- API client → API routes: requests scans (evidence: `apps/web/src/api/client.ts`)
- API routes → Authentication: protects routes (evidence: `apps/api/src/middleware/auth.ts`)
- API routes → Scan and speaker records: reads and writes (evidence: `apps/api/src/index.ts`)
- API routes → Engine endpoints: forwards audio
- Engine endpoints → Audio forensics: analyzes audio (evidence: `apps/engine/main.py`)
- Authenticated shell → Live monitor: offers monitoring (evidence: `README.md`)
- Authenticated shell → Image scan: offers image scans (evidence: `README.md`)
- Image scan → API client: submits images (evidence: `README.md`)
- API client → API routes: requests image scan (evidence: `apps/web/src/api/client.ts`)
- API routes → Image proxy: proxies image
- Image proxy → Hugging Face inference: forwards image (evidence: `README.md`)
- Authenticated shell → Speaker identity: renders identity (evidence: `apps/web/src/AuthenticatedShell.tsx`)
- Speaker identity → API client: enrolls and verifies (evidence: `README.md`)
- API routes → Speaker routes: mounts routes (evidence: `apps/api/src/index.ts`)
- Speaker routes → Engine endpoints: requests embeddings (evidence: `apps/api/src/routes/speaker.ts`)
- Engine endpoints → Speaker embeddings: extracts embeddings (evidence: `apps/engine/main.py`)
- Speaker routes → Scan and speaker records: stores identity data (evidence: `apps/api/src/routes/speaker.ts`)
- Authenticated shell → History and reports: routes to (evidence: `apps/web/src/AuthenticatedShell.tsx`)
- History and reports → API client: loads scan history (evidence: `README.md`)
- History and reports → Scan analytics: summarizes scans (evidence: `README.md`)
- Audio scan → Scan feedback: collects feedback (evidence: `apps/web/src/components/AudioUpload.tsx`)
- Authenticated shell → Deepfake game: offers challenge mode (evidence: `README.md`)
