# miteshpanda/truelens-ai architecture

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

- Interactive diagram: https://gitdiagram.com/miteshpanda/truelens-ai
- Repository: https://github.com/miteshpanda/truelens-ai

## Overview

TrueLens AI is a multimodal misinformation-analysis application. A user selects text or image/video analysis in the web UI; the corresponding page sends a request through the API client to FastAPI, which returns a verdict, confidence, and supporting details for display. Text analysis combines linguistic scoring with optional web verification; media analysis uses image/video detection, with sampled video-frame results available to the UI. The README also describes multi-modal fusion, but the sampled implementation does not establish a fusion component, so that connection is not asserted. Some backend route-to-model wiring is omitted from excerpts.

Main entry points: [`frontend/src/App.jsx`](https://github.com/miteshpanda/truelens-ai/blob/main/frontend/src/App.jsx) (App navigation), [`frontend/src/pages/TextAnalysis.jsx`](https://github.com/miteshpanda/truelens-ai/blob/main/frontend/src/pages/TextAnalysis.jsx) (Text analysis page), [`frontend/src/pages/MediaAnalysis.jsx`](https://github.com/miteshpanda/truelens-ai/blob/main/frontend/src/pages/MediaAnalysis.jsx) (Media analysis page), [`backend/main.py`](https://github.com/miteshpanda/truelens-ai/blob/main/backend/main.py) (Detection API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web application"]
  node_app["App navigation<br/>[App.jsx]"]
  node_home["Home page<br/>[Home.jsx]"]
  node_navbar["Navigation bar<br/>[Navbar.jsx]"]
  node_textpage["Text analysis page<br/>[TextAnalysis.jsx]"]
  node_mediapage["Media analysis page<br/>[MediaAnalysis.jsx]"]
  node_result_card["Verdict display<br/>[ResultCard.jsx]"]
  node_confidence["Confidence meter"]
  node_evidence_panel["Web evidence panel"]
  node_frame_timeline["Frame timeline<br/>[FrameTimeline.jsx]"]
end

subgraph group_api["API boundary"]
  node_api_client["API client<br/>[api.js]"]
  node_fastapi["Detection API<br/>[main.py]"]
end

subgraph group_text["Text analysis"]
  node_text_model["Fake-news analysis<br/>[fake_news_model.py]"]
  node_preprocess["Text preprocessing<br/>[preprocess.py]"]
  node_web_verify["Claim verification<br/>[web_verifier.py]"]
  node_wikipedia["Wikipedia API"]
end

subgraph group_media["Media analysis"]
  node_deepfake["Deepfake detection<br/>[deepfake_model.py]"]
end

node_visitor(("User"))

node_visitor -->|"uses"| node_app
node_app -->|"renders"| node_navbar
node_app -->|"renders"| node_home
node_app -->|"renders"| node_textpage
node_app -->|"renders"| node_mediapage
node_visitor -->|"submits text"| node_textpage
node_visitor -->|"uploads media"| node_mediapage
node_textpage -->|"requests text"| node_api_client
node_mediapage -->|"requests media"| node_api_client
node_api_client -->|"posts predictions"| node_fastapi
node_fastapi -->|"calls text model"| node_text_model
node_text_model -->|"uses token extraction"| node_preprocess
node_text_model -->|"verifies claims"| node_web_verify
node_web_verify -->|"queries"| node_wikipedia
node_fastapi -.->|"invokes media analysis"| node_deepfake
node_textpage -->|"renders result"| node_result_card
node_mediapage -->|"renders result"| node_result_card
node_result_card -->|"renders meter"| node_confidence
node_textpage -->|"renders evidence"| node_evidence_panel
node_mediapage -->|"renders frames"| node_frame_timeline

click node_app "https://github.com/miteshpanda/truelens-ai/blob/main/frontend/src/App.jsx"
click node_home "https://github.com/miteshpanda/truelens-ai/blob/main/frontend/src/pages/Home.jsx"
click node_navbar "https://github.com/miteshpanda/truelens-ai/blob/main/frontend/src/components/Navbar.jsx"
click node_textpage "https://github.com/miteshpanda/truelens-ai/blob/main/frontend/src/pages/TextAnalysis.jsx"
click node_mediapage "https://github.com/miteshpanda/truelens-ai/blob/main/frontend/src/pages/MediaAnalysis.jsx"
click node_api_client "https://github.com/miteshpanda/truelens-ai/blob/main/frontend/src/api.js"
click node_fastapi "https://github.com/miteshpanda/truelens-ai/blob/main/backend/main.py"
click node_text_model "https://github.com/miteshpanda/truelens-ai/blob/main/backend/models/fake_news_model.py"
click node_preprocess "https://github.com/miteshpanda/truelens-ai/blob/main/backend/utils/preprocess.py"
click node_web_verify "https://github.com/miteshpanda/truelens-ai/blob/main/backend/utils/web_verifier.py"
click node_deepfake "https://github.com/miteshpanda/truelens-ai/blob/main/backend/models/deepfake_model.py"
click node_result_card "https://github.com/miteshpanda/truelens-ai/blob/main/frontend/src/components/ResultCard.jsx"
click node_confidence "https://github.com/miteshpanda/truelens-ai/blob/main/frontend/src/components/ConfidenceMeter.jsx"
click node_evidence_panel "https://github.com/miteshpanda/truelens-ai/blob/main/frontend/src/components/WebEvidencePanel.jsx"
click node_frame_timeline "https://github.com/miteshpanda/truelens-ai/blob/main/frontend/src/components/FrameTimeline.jsx"

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_home,node_navbar,node_textpage,node_mediapage,node_result_card,node_confidence,node_evidence_panel,node_frame_timeline,node_visitor toneBlue
class node_api_client,node_fastapi toneAmber
class node_text_model,node_preprocess,node_web_verify,node_wikipedia toneMint
class node_deepfake toneRose
```

## Components

### Web application

- [App navigation](https://github.com/miteshpanda/truelens-ai/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Home page](https://github.com/miteshpanda/truelens-ai/blob/main/frontend/src/pages/Home.jsx): `frontend/src/pages/Home.jsx`
- [Navigation bar](https://github.com/miteshpanda/truelens-ai/blob/main/frontend/src/components/Navbar.jsx): `frontend/src/components/Navbar.jsx`
- [Text analysis page](https://github.com/miteshpanda/truelens-ai/blob/main/frontend/src/pages/TextAnalysis.jsx): `frontend/src/pages/TextAnalysis.jsx`
- [Media analysis page](https://github.com/miteshpanda/truelens-ai/blob/main/frontend/src/pages/MediaAnalysis.jsx): `frontend/src/pages/MediaAnalysis.jsx`
- [Verdict display](https://github.com/miteshpanda/truelens-ai/blob/main/frontend/src/components/ResultCard.jsx): `frontend/src/components/ResultCard.jsx`
- [Confidence meter](https://github.com/miteshpanda/truelens-ai/blob/main/frontend/src/components/ConfidenceMeter.jsx): `frontend/src/components/ConfidenceMeter.jsx`
- [Web evidence panel](https://github.com/miteshpanda/truelens-ai/blob/main/frontend/src/components/WebEvidencePanel.jsx): `frontend/src/components/WebEvidencePanel.jsx`
- [Frame timeline](https://github.com/miteshpanda/truelens-ai/blob/main/frontend/src/components/FrameTimeline.jsx): `frontend/src/components/FrameTimeline.jsx`

### API boundary

- [API client](https://github.com/miteshpanda/truelens-ai/blob/main/frontend/src/api.js): `frontend/src/api.js`
- [Detection API](https://github.com/miteshpanda/truelens-ai/blob/main/backend/main.py): `backend/main.py`

### Text analysis

- [Fake-news analysis](https://github.com/miteshpanda/truelens-ai/blob/main/backend/models/fake_news_model.py): `backend/models/fake_news_model.py`
- [Text preprocessing](https://github.com/miteshpanda/truelens-ai/blob/main/backend/utils/preprocess.py): `backend/utils/preprocess.py`
- [Claim verification](https://github.com/miteshpanda/truelens-ai/blob/main/backend/utils/web_verifier.py): `backend/utils/web_verifier.py`
- **Wikipedia API**

### Media analysis

- [Deepfake detection](https://github.com/miteshpanda/truelens-ai/blob/main/backend/models/deepfake_model.py): `backend/models/deepfake_model.py`

### Other components

- **User**

## Connections

- User → App navigation: uses (evidence: `README.md`)
- App navigation → Navigation bar: renders (evidence: `frontend/src/App.jsx`)
- App navigation → Home page: renders (evidence: `frontend/src/App.jsx`)
- App navigation → Text analysis page: renders (evidence: `frontend/src/App.jsx`)
- App navigation → Media analysis page: renders (evidence: `frontend/src/App.jsx`)
- User → Text analysis page: submits text (evidence: `frontend/src/pages/TextAnalysis.jsx`)
- User → Media analysis page: uploads media (evidence: `frontend/src/pages/MediaAnalysis.jsx`)
- Text analysis page → API client: requests text (evidence: `frontend/src/pages/TextAnalysis.jsx`)
- Media analysis page → API client: requests media (evidence: `frontend/src/pages/MediaAnalysis.jsx`)
- API client → Detection API: posts predictions (evidence: `frontend/src/api.js`)
- Detection API → Fake-news analysis: calls text model (evidence: `backend/main.py`)
- Fake-news analysis → Text preprocessing: uses token extraction (evidence: `backend/models/fake_news_model.py`)
- Fake-news analysis → Claim verification: verifies claims (evidence: `backend/models/fake_news_model.py`)
- Claim verification → Wikipedia API: queries (evidence: `backend/utils/web_verifier.py`)
- Detection API → Deepfake detection: invokes media analysis (evidence: `backend/main.py`)
- Text analysis page → Verdict display: renders result (evidence: `frontend/src/pages/TextAnalysis.jsx`)
- Media analysis page → Verdict display: renders result (evidence: `frontend/src/pages/MediaAnalysis.jsx`)
- Verdict display → Confidence meter: renders meter (evidence: `frontend/src/components/ResultCard.jsx`)
- Text analysis page → Web evidence panel: renders evidence (evidence: `frontend/src/pages/TextAnalysis.jsx`)
- Media analysis page → Frame timeline: renders frames (evidence: `frontend/src/pages/MediaAnalysis.jsx`)
