# starkbyte-07/truevision architecture

> Architecture diagram of the GitHub repository starkbyte-07/truevision, 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/starkbyte-07/truevision
- Repository: https://github.com/starkbyte-07/truevision

## Overview

TrueVision is a deepfake-forensics platform: users upload media through a web dashboard, which sends it to a local FastAPI proxy and then to an EC2 inference service. The documented assessment flow includes frame/face processing, tri-model analysis, calibrated verdicts, and forensic results; user feedback enters an active-learning loop. The graph preserves the documented email-report capability and training/calibration layer. Some server internals are unsampled, so those stage links rely on the README rather than inspected call sites.

Main entry points: [`ec2_server/app.py`](https://github.com/starkbyte-07/truevision/blob/main/ec2_server/app.py) (Inference API), [`truevision-app/src/pages/Dashboard.jsx`](https://github.com/starkbyte-07/truevision/blob/main/truevision-app/src/pages/Dashboard.jsx) (Dashboard workflow), [`backend/app.py`](https://github.com/starkbyte-07/truevision/blob/main/backend/app.py) (FastAPI proxy), [`truevision-app/src/api/index.js`](https://github.com/starkbyte-07/truevision/blob/main/truevision-app/src/api/index.js) (API client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web application"]
  node_dashboard["Dashboard workflow<br/>[Dashboard.jsx]"]
  node_upload["Upload zone<br/>[UploadZone.jsx]"]
  node_processingview["Processing view<br/>[ProcessingView.jsx]"]
  node_results["Results and feedback<br/>[ResultsPanel.jsx]"]
  node_history["Scan history<br/>[HistoryContext.jsx]"]
  node_auth["Local user session<br/>[AuthContext.jsx]"]
  node_clientapi["API client<br/>[index.js]"]
end

subgraph group_gateway["Proxy and reporting"]
  node_proxy["FastAPI proxy<br/>[app.py]"]
  node_proxyupload["Upload route<br/>[upload.py]"]
  node_videoprep["Video frame extraction<br/>[preprocessing.py]"]
  node_reports["Email reports<br/>[report.py]"]
end

subgraph group_inference["Forensic inference"]
  node_ec2["Inference API<br/>[app.py]"]
  node_frames["Frame preprocessing<br/>[preprocessing.py]"]
  node_faces["Face detection<br/>[facedetection.py]"]
  node_models["Tri-model inference<br/>[inference.py]"]
  node_artifacts["Artifact analysis"]
  node_calibration["Confidence calibration<br/>[calibration.py]"]
end

subgraph group_learning["Model learning"]
  node_training["Training and fine-tuning<br/>[train.py]"]
  node_dataset[("Feedback archive<br/>[app.py]")]
end

node_user(("Media user"))
node_ses["SES / SMTP"]

node_user -->|"submits media"| node_dashboard
node_dashboard -->|"renders"| node_upload
node_dashboard -->|"processes file"| node_clientapi
node_dashboard -->|"shows progress"| node_processingview
node_dashboard -->|"shows results"| node_results
node_dashboard -->|"records scans"| node_history
node_user -->|"signs in locally"| node_auth
node_clientapi -->|"sends requests"| node_proxy
node_proxy -->|"forwards media"| node_ec2
node_proxyupload -->|"extracts frames"| node_videoprep
node_ec2 -->|"preprocesses media"| node_frames
node_ec2 -->|"detects faces"| node_faces
node_faces -->|"provides face inputs"| node_models
node_models -->|"analyzes artifacts"| node_artifacts
node_models -->|"calibrates scores"| node_calibration
node_ec2 -->|"returns verdict"| node_results
node_results -->|"submits feedback"| node_clientapi
node_clientapi -->|"posts feedback"| node_ec2
node_ec2 -->|"fine-tunes ETCNN"| node_training
node_ec2 -->|"archives predictions"| node_dataset
node_training -.->|"updates ETCNN"| node_models
node_proxy -.->|"generates reports"| node_reports
node_proxy -.->|"sends email"| node_ses

click node_dashboard "https://github.com/starkbyte-07/truevision/blob/main/truevision-app/src/pages/Dashboard.jsx"
click node_upload "https://github.com/starkbyte-07/truevision/blob/main/truevision-app/src/components/UploadZone.jsx"
click node_processingview "https://github.com/starkbyte-07/truevision/blob/main/truevision-app/src/components/ProcessingView.jsx"
click node_results "https://github.com/starkbyte-07/truevision/blob/main/truevision-app/src/components/ResultsPanel.jsx"
click node_history "https://github.com/starkbyte-07/truevision/blob/main/truevision-app/src/context/HistoryContext.jsx"
click node_auth "https://github.com/starkbyte-07/truevision/blob/main/truevision-app/src/context/AuthContext.jsx"
click node_clientapi "https://github.com/starkbyte-07/truevision/blob/main/truevision-app/src/api/index.js"
click node_proxy "https://github.com/starkbyte-07/truevision/blob/main/backend/app.py"
click node_proxyupload "https://github.com/starkbyte-07/truevision/blob/main/backend/routes/upload.py"
click node_videoprep "https://github.com/starkbyte-07/truevision/blob/main/backend/services/preprocessing.py"
click node_reports "https://github.com/starkbyte-07/truevision/blob/main/backend/services/report.py"
click node_ec2 "https://github.com/starkbyte-07/truevision/blob/main/ec2_server/app.py"
click node_frames "https://github.com/starkbyte-07/truevision/blob/main/ec2_server/preprocessing.py"
click node_faces "https://github.com/starkbyte-07/truevision/blob/main/ec2_server/facedetection.py"
click node_models "https://github.com/starkbyte-07/truevision/blob/main/ec2_server/inference.py"
click node_artifacts "https://github.com/starkbyte-07/truevision/blob/main/ec2_server/artifact_analyzer.py"
click node_calibration "https://github.com/starkbyte-07/truevision/blob/main/ec2_server/backend/calibration.py"
click node_training "https://github.com/starkbyte-07/truevision/blob/main/ec2_server/backend/train.py"
click node_dataset "https://github.com/starkbyte-07/truevision/blob/main/ec2_server/app.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_dashboard,node_upload,node_processingview,node_results,node_history,node_auth,node_clientapi,node_user toneBlue
class node_proxy,node_proxyupload,node_videoprep,node_reports toneAmber
class node_ec2,node_frames,node_faces,node_models,node_artifacts,node_calibration toneMint
class node_training,node_dataset toneRose
class node_ses toneIndigo
```

## Components

### Web application

- [Dashboard workflow](https://github.com/starkbyte-07/truevision/blob/main/truevision-app/src/pages/Dashboard.jsx): `truevision-app/src/pages/Dashboard.jsx`
- [Upload zone](https://github.com/starkbyte-07/truevision/blob/main/truevision-app/src/components/UploadZone.jsx): `truevision-app/src/components/UploadZone.jsx`
- [Processing view](https://github.com/starkbyte-07/truevision/blob/main/truevision-app/src/components/ProcessingView.jsx): `truevision-app/src/components/ProcessingView.jsx`
- [Results and feedback](https://github.com/starkbyte-07/truevision/blob/main/truevision-app/src/components/ResultsPanel.jsx): `truevision-app/src/components/ResultsPanel.jsx`
- [Scan history](https://github.com/starkbyte-07/truevision/blob/main/truevision-app/src/context/HistoryContext.jsx): `truevision-app/src/context/HistoryContext.jsx`
- [Local user session](https://github.com/starkbyte-07/truevision/blob/main/truevision-app/src/context/AuthContext.jsx): `truevision-app/src/context/AuthContext.jsx`
- [API client](https://github.com/starkbyte-07/truevision/blob/main/truevision-app/src/api/index.js): `truevision-app/src/api/index.js`

### Proxy and reporting

- [FastAPI proxy](https://github.com/starkbyte-07/truevision/blob/main/backend/app.py): `backend/app.py`
- [Upload route](https://github.com/starkbyte-07/truevision/blob/main/backend/routes/upload.py): `backend/routes/upload.py`
- [Video frame extraction](https://github.com/starkbyte-07/truevision/blob/main/backend/services/preprocessing.py): `backend/services/preprocessing.py`
- [Email reports](https://github.com/starkbyte-07/truevision/blob/main/backend/services/report.py): `backend/services/report.py`

### Forensic inference

- [Inference API](https://github.com/starkbyte-07/truevision/blob/main/ec2_server/app.py): `ec2_server/app.py`
- [Frame preprocessing](https://github.com/starkbyte-07/truevision/blob/main/ec2_server/preprocessing.py): `ec2_server/preprocessing.py`
- [Face detection](https://github.com/starkbyte-07/truevision/blob/main/ec2_server/facedetection.py): `ec2_server/facedetection.py`
- [Tri-model inference](https://github.com/starkbyte-07/truevision/blob/main/ec2_server/inference.py): `ec2_server/inference.py`
- [Artifact analysis](https://github.com/starkbyte-07/truevision/blob/main/ec2_server/artifact_analyzer.py): `ec2_server/artifact_analyzer.py`
- [Confidence calibration](https://github.com/starkbyte-07/truevision/blob/main/ec2_server/backend/calibration.py): `ec2_server/backend/calibration.py`

### Model learning

- [Training and fine-tuning](https://github.com/starkbyte-07/truevision/blob/main/ec2_server/backend/train.py): `ec2_server/backend/train.py`
- [Feedback archive](https://github.com/starkbyte-07/truevision/blob/main/ec2_server/app.py): `ec2_server/app.py`

### Other components

- **Media user**
- **SES / SMTP**

## Connections

- Media user → Dashboard workflow: submits media (evidence: `README.md`)
- Dashboard workflow → Upload zone: renders (evidence: `truevision-app/src/pages/Dashboard.jsx`)
- Dashboard workflow → API client: processes file (evidence: `truevision-app/src/pages/Dashboard.jsx`)
- Dashboard workflow → Processing view: shows progress (evidence: `truevision-app/src/pages/Dashboard.jsx`)
- Dashboard workflow → Results and feedback: shows results (evidence: `truevision-app/src/pages/Dashboard.jsx`)
- Dashboard workflow → Scan history: records scans (evidence: `truevision-app/src/pages/Dashboard.jsx`)
- Media user → Local user session: signs in locally (evidence: `truevision-app/src/context/AuthContext.jsx`)
- API client → FastAPI proxy: sends requests (evidence: `README.md`)
- FastAPI proxy → Inference API: forwards media (evidence: `README.md`)
- Upload route → Video frame extraction: extracts frames (evidence: `backend/routes/upload.py`)
- Inference API → Frame preprocessing: preprocesses media (evidence: `README.md`)
- Inference API → Face detection: detects faces (evidence: `README.md`)
- Face detection → Tri-model inference: provides face inputs (evidence: `README.md`)
- Tri-model inference → Artifact analysis: analyzes artifacts (evidence: `README.md`)
- Tri-model inference → Confidence calibration: calibrates scores (evidence: `README.md`)
- Inference API → Results and feedback: returns verdict (evidence: `README.md`)
- Results and feedback → API client: submits feedback (evidence: `truevision-app/src/components/ResultsPanel.jsx`)
- API client → Inference API: posts feedback (evidence: `README.md`)
- Inference API → Training and fine-tuning: fine-tunes ETCNN (evidence: `ec2_server/app.py`)
- Inference API → Feedback archive: archives predictions (evidence: `ec2_server/app.py`)
- Training and fine-tuning → Tri-model inference: updates ETCNN (evidence: `README.md`)
- FastAPI proxy → Email reports: generates reports (evidence: `README.md`)
- FastAPI proxy → SES / SMTP: sends email (evidence: `README.md`)
