# shivanshm29/veritas architecture

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

- Interactive diagram: https://gitdiagram.com/shivanshm29/veritas
- Repository: https://github.com/shivanshm29/veritas

## Overview

Veritas is a multimodal investigation platform: analysts submit media or a post URL, then review forensic findings, claim assessments, and provenance. The sampled pipeline explicitly orchestrates image analysis, claim extraction, provenance matching, and verification; retrieval and verification internals are represented where source references support them. The README documents video/audio forensics, live monitoring, and reporting as product capabilities, but their runtime wiring is not fully shown in the excerpts, so uncertain links are omitted or marked dashed.

Main entry points: [`frontend/src/App.tsx`](https://github.com/shivanshm29/veritas/blob/main/frontend/src/App.tsx) (Investigation UI), [`backend/app/services/pipeline.py`](https://github.com/shivanshm29/veritas/blob/main/backend/app/services/pipeline.py) (Investigation Pipeline), [`backend/app/services/verification/service.py`](https://github.com/shivanshm29/veritas/blob/main/backend/app/services/verification/service.py) (Claim Verification), [`frontend/src/services/api.ts`](https://github.com/shivanshm29/veritas/blob/main/frontend/src/services/api.ts) (Frontend API Client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workspace["Investigator Workspace"]
  node_workspace_ui["Investigation UI<br/>[App.tsx]"]
  node_media_upload["Media Upload<br/>[MediaUploader.tsx]"]
  node_forensic_cards["Forensic Results"]
  node_live_feed_ui["Live Feed Radar<br/>[LiveFeedRadar.tsx]"]
  node_provenance_ui["Provenance Graph"]
  node_assessment_ui["Claim Assessment"]
  node_report_ui["Investigation Report"]
  node_api_client["Frontend API Client<br/>[api.ts]"]
end

subgraph group_api["API and Orchestration"]
  node_backend_app["FastAPI Application<br/>[main.py]"]
  node_api_router["Versioned API Router<br/>[router.py]"]
  node_api_endpoints["REST Endpoints"]
  node_pipeline["Investigation Pipeline<br/>[pipeline.py]"]
end

subgraph group_analysis["Analysis Engines"]
  node_image_analysis["Image Forensics"]
  node_video_analysis["Video Forensics"]
  node_audio_analysis["Audio Forensics"]
  node_nlp["Claim Intelligence"]
  node_provenance["Provenance Matching"]
end

subgraph group_evidence["Evidence and Verification"]
  node_retrieval["Evidence Retrieval<br/>[service.py]"]
  node_verification["Claim Verification<br/>[service.py]"]
  node_aggregation["Evidence Aggregation<br/>[aggregation.py]"]
  node_stance["Stance Classification"]
end

subgraph group_contracts["Contracts and Persistence"]
  node_storage[("Asset Storage<br/>[storage.py]")]
  node_data_models[("Domain Models")]
  node_repositories[("Data Repositories")]
  node_shared_contracts["Canonical Contracts<br/>[models.py]"]
end

node_analyst(("Investigator"))

node_analyst -->|"uses"| node_workspace_ui
node_workspace_ui -->|"renders"| node_media_upload
node_workspace_ui -->|"renders"| node_forensic_cards
node_workspace_ui -->|"renders"| node_live_feed_ui
node_workspace_ui -->|"renders"| node_provenance_ui
node_workspace_ui -->|"renders"| node_assessment_ui
node_workspace_ui -->|"renders"| node_report_ui
node_workspace_ui -->|"calls"| node_api_client
node_media_upload -.->|"submits media"| node_api_client
node_api_client -->|"requests analysis"| node_api_endpoints
node_backend_app -->|"mounts"| node_api_router
node_api_router -->|"includes routes"| node_api_endpoints
node_api_endpoints -.->|"dispatches"| node_pipeline
node_pipeline -->|"calls"| node_image_analysis
node_pipeline -->|"extracts claims"| node_nlp
node_pipeline -->|"matches references"| node_provenance
node_pipeline -->|"verifies claims"| node_verification
node_verification -->|"retrieves evidence"| node_retrieval
node_verification -->|"aggregates"| node_aggregation
node_verification -->|"classifies stance"| node_stance
node_retrieval -->|"uses contracts"| node_shared_contracts
node_aggregation -->|"uses classifier"| node_stance
node_verification -->|"persists records"| node_repositories
node_repositories -.->|"stores entities"| node_data_models
node_storage -.->|"stores assets"| node_shared_contracts

click node_workspace_ui "https://github.com/shivanshm29/veritas/blob/main/frontend/src/App.tsx"
click node_media_upload "https://github.com/shivanshm29/veritas/blob/main/frontend/src/components/MediaUploader.tsx"
click node_forensic_cards "https://github.com/shivanshm29/veritas/blob/main/frontend/src/components/ImageForensicsCard.tsx"
click node_live_feed_ui "https://github.com/shivanshm29/veritas/blob/main/frontend/src/components/LiveFeedRadar.tsx"
click node_provenance_ui "https://github.com/shivanshm29/veritas/blob/main/frontend/src/components/ProvenanceGraph.tsx"
click node_assessment_ui "https://github.com/shivanshm29/veritas/blob/main/frontend/src/components/ClaimAssessmentCard.tsx"
click node_report_ui "https://github.com/shivanshm29/veritas/blob/main/frontend/src/components/InvestigationReportModal.tsx"
click node_api_client "https://github.com/shivanshm29/veritas/blob/main/frontend/src/services/api.ts"
click node_backend_app "https://github.com/shivanshm29/veritas/blob/main/backend/app/main.py"
click node_api_router "https://github.com/shivanshm29/veritas/blob/main/backend/app/api/router.py"
click node_api_endpoints "https://github.com/shivanshm29/veritas/tree/main/backend/app/api/v1/endpoints"
click node_pipeline "https://github.com/shivanshm29/veritas/blob/main/backend/app/services/pipeline.py"
click node_image_analysis "https://github.com/shivanshm29/veritas/tree/main/backend/app/services/image_forensics"
click node_video_analysis "https://github.com/shivanshm29/veritas/tree/main/backend/app/services/video_forensics"
click node_audio_analysis "https://github.com/shivanshm29/veritas/tree/main/backend/app/services/audio_forensics"
click node_nlp "https://github.com/shivanshm29/veritas/tree/main/backend/app/services/nlp"
click node_provenance "https://github.com/shivanshm29/veritas/tree/main/backend/app/services/provenance"
click node_retrieval "https://github.com/shivanshm29/veritas/blob/main/backend/app/services/retrieval/service.py"
click node_verification "https://github.com/shivanshm29/veritas/blob/main/backend/app/services/verification/service.py"
click node_aggregation "https://github.com/shivanshm29/veritas/blob/main/backend/app/services/verification/aggregation.py"
click node_stance "https://github.com/shivanshm29/veritas/blob/main/backend/app/services/verification/stance_classifier.py"
click node_storage "https://github.com/shivanshm29/veritas/blob/main/backend/app/services/storage.py"
click node_data_models "https://github.com/shivanshm29/veritas/tree/main/backend/app/db/models"
click node_repositories "https://github.com/shivanshm29/veritas/tree/main/backend/app/db/repositories"
click node_shared_contracts "https://github.com/shivanshm29/veritas/blob/main/contracts/schemas/models.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_workspace_ui,node_media_upload,node_forensic_cards,node_live_feed_ui,node_provenance_ui,node_assessment_ui,node_report_ui,node_api_client toneBlue
class node_backend_app,node_api_router,node_api_endpoints,node_pipeline toneAmber
class node_image_analysis,node_video_analysis,node_audio_analysis,node_nlp,node_provenance toneMint
class node_retrieval,node_verification,node_aggregation,node_stance toneRose
class node_storage,node_data_models,node_repositories,node_shared_contracts,node_analyst toneIndigo
```

## Components

### Investigator Workspace

- [Investigation UI](https://github.com/shivanshm29/veritas/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`
- [Media Upload](https://github.com/shivanshm29/veritas/blob/main/frontend/src/components/MediaUploader.tsx): `frontend/src/components/MediaUploader.tsx`
- [Forensic Results](https://github.com/shivanshm29/veritas/blob/main/frontend/src/components/ImageForensicsCard.tsx): `frontend/src/components/ImageForensicsCard.tsx`
- [Live Feed Radar](https://github.com/shivanshm29/veritas/blob/main/frontend/src/components/LiveFeedRadar.tsx): `frontend/src/components/LiveFeedRadar.tsx`
- [Provenance Graph](https://github.com/shivanshm29/veritas/blob/main/frontend/src/components/ProvenanceGraph.tsx): `frontend/src/components/ProvenanceGraph.tsx`
- [Claim Assessment](https://github.com/shivanshm29/veritas/blob/main/frontend/src/components/ClaimAssessmentCard.tsx): `frontend/src/components/ClaimAssessmentCard.tsx`
- [Investigation Report](https://github.com/shivanshm29/veritas/blob/main/frontend/src/components/InvestigationReportModal.tsx): `frontend/src/components/InvestigationReportModal.tsx`
- [Frontend API Client](https://github.com/shivanshm29/veritas/blob/main/frontend/src/services/api.ts): `frontend/src/services/api.ts`

### API and Orchestration

- [FastAPI Application](https://github.com/shivanshm29/veritas/blob/main/backend/app/main.py): `backend/app/main.py`
- [Versioned API Router](https://github.com/shivanshm29/veritas/blob/main/backend/app/api/router.py): `backend/app/api/router.py`
- [REST Endpoints](https://github.com/shivanshm29/veritas/tree/main/backend/app/api/v1/endpoints): `backend/app/api/v1/endpoints`
- [Investigation Pipeline](https://github.com/shivanshm29/veritas/blob/main/backend/app/services/pipeline.py): `backend/app/services/pipeline.py`

### Analysis Engines

- [Image Forensics](https://github.com/shivanshm29/veritas/tree/main/backend/app/services/image_forensics): `backend/app/services/image_forensics`
- [Video Forensics](https://github.com/shivanshm29/veritas/tree/main/backend/app/services/video_forensics): `backend/app/services/video_forensics`
- [Audio Forensics](https://github.com/shivanshm29/veritas/tree/main/backend/app/services/audio_forensics): `backend/app/services/audio_forensics`
- [Claim Intelligence](https://github.com/shivanshm29/veritas/tree/main/backend/app/services/nlp): `backend/app/services/nlp`
- [Provenance Matching](https://github.com/shivanshm29/veritas/tree/main/backend/app/services/provenance): `backend/app/services/provenance`

### Evidence and Verification

- [Evidence Retrieval](https://github.com/shivanshm29/veritas/blob/main/backend/app/services/retrieval/service.py): `backend/app/services/retrieval/service.py`
- [Claim Verification](https://github.com/shivanshm29/veritas/blob/main/backend/app/services/verification/service.py): `backend/app/services/verification/service.py`
- [Evidence Aggregation](https://github.com/shivanshm29/veritas/blob/main/backend/app/services/verification/aggregation.py): `backend/app/services/verification/aggregation.py`
- [Stance Classification](https://github.com/shivanshm29/veritas/blob/main/backend/app/services/verification/stance_classifier.py): `backend/app/services/verification/stance_classifier.py`

### Contracts and Persistence

- [Asset Storage](https://github.com/shivanshm29/veritas/blob/main/backend/app/services/storage.py): `backend/app/services/storage.py`
- [Domain Models](https://github.com/shivanshm29/veritas/tree/main/backend/app/db/models): `backend/app/db/models`
- [Data Repositories](https://github.com/shivanshm29/veritas/tree/main/backend/app/db/repositories): `backend/app/db/repositories`
- [Canonical Contracts](https://github.com/shivanshm29/veritas/blob/main/contracts/schemas/models.py): `contracts/schemas/models.py`

### Other components

- **Investigator**

## Connections

- Investigator → Investigation UI: uses (evidence: `frontend/src/App.tsx`)
- Investigation UI → Media Upload: renders (evidence: `frontend/src/App.tsx`)
- Investigation UI → Forensic Results: renders (evidence: `frontend/src/App.tsx`)
- Investigation UI → Live Feed Radar: renders (evidence: `frontend/src/App.tsx`)
- Investigation UI → Provenance Graph: renders (evidence: `frontend/src/App.tsx`)
- Investigation UI → Claim Assessment: renders (evidence: `frontend/src/App.tsx`)
- Investigation UI → Investigation Report: renders (evidence: `frontend/src/App.tsx`)
- Investigation UI → Frontend API Client: calls (evidence: `frontend/src/App.tsx`)
- Media Upload → Frontend API Client: submits media
- Frontend API Client → REST Endpoints: requests analysis (evidence: `frontend/src/services/api.ts`)
- FastAPI Application → Versioned API Router: mounts (evidence: `backend/app/main.py`)
- Versioned API Router → REST Endpoints: includes routes (evidence: `backend/app/api/router.py`)
- REST Endpoints → Investigation Pipeline: dispatches
- Investigation Pipeline → Image Forensics: calls (evidence: `backend/app/services/pipeline.py`)
- Investigation Pipeline → Claim Intelligence: extracts claims (evidence: `backend/app/services/pipeline.py`)
- Investigation Pipeline → Provenance Matching: matches references (evidence: `backend/app/services/pipeline.py`)
- Investigation Pipeline → Claim Verification: verifies claims (evidence: `backend/app/services/pipeline.py`)
- Claim Verification → Evidence Retrieval: retrieves evidence (evidence: `backend/app/services/verification/service.py`)
- Claim Verification → Evidence Aggregation: aggregates (evidence: `backend/app/services/verification/service.py`)
- Claim Verification → Stance Classification: classifies stance (evidence: `backend/app/services/verification/service.py`)
- Evidence Retrieval → Canonical Contracts: uses contracts (evidence: `backend/app/services/retrieval/service.py`)
- Evidence Aggregation → Stance Classification: uses classifier (evidence: `backend/app/services/verification/aggregation.py`)
- Claim Verification → Data Repositories: persists records (evidence: `backend/app/services/verification/service.py`)
- Data Repositories → Domain Models: stores entities (evidence: `backend/app/db/repositories/evidence_item.py`)
- Asset Storage → Canonical Contracts: stores assets
