# atharvs7/veritasai-v2 architecture

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

- Interactive diagram: https://gitdiagram.com/atharvs7/veritasai-v2
- Repository: https://github.com/atharvs7/veritasai-v2

## Overview

VeritasAI verifies submitted articles, URLs, text, or files at the claim level: it extracts and gates claims, gathers evidence, evaluates signals, and returns an explainable verdict. The React client also exposes authentication, history, analytics, dataset, community feed, and trending-claim views. The README documents the verification stages and product capabilities; source excerpts and the index show selected wiring, but not every backend call or UI data flow, so unsampled relationships are omitted.

Main entry points: [`backend/routes/analyze.py`](https://github.com/atharvs7/veritasai-v2/blob/main/backend/routes/analyze.py) (Analysis route), [`src/lib/api.js`](https://github.com/atharvs7/veritasai-v2/blob/main/src/lib/api.js) (API client), [`backend/jobs/trending_cron.py`](https://github.com/atharvs7/veritasai-v2/blob/main/backend/jobs/trending_cron.py) (Trending analysis job), [`src/pages/DetectPage.jsx`](https://github.com/atharvs7/veritasai-v2/blob/main/src/pages/DetectPage.jsx) (Analysis page)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Web client"]
  node_app["Application routes<br/>[App.jsx]"]
  node_detect["Analysis page<br/>[DetectPage.jsx]"]
  node_inputui["Article input<br/>[ArticleInput.jsx]"]
  node_resultui["Verdict display<br/>[ResultCard.jsx]"]
  node_api["API client<br/>[api.js]"]
end

subgraph group_verification["Claim verification"]
  node_analyze["Analysis route<br/>[analyze.py]"]
  node_normalize["Input normalization<br/>[input_handler.py]"]
  node_fileparse["File extraction<br/>[file_parser.py]"]
  node_claims["Claim extraction<br/>[claim_extractor.py]"]
  node_checkworthy["Check-worthiness gate<br/>[ml_model.py]"]
  node_evidence["Evidence retrieval"]
  node_credibility["Source credibility"]
  node_reasoning["Evidence reasoning"]
  node_signals["Language signals<br/>[heuristics.py]"]
  node_ensemble["Verdict ensemble"]
  node_explain["Decision explanation"]
end

subgraph group_data["Evidence and persistence"]
  node_cache[("Result cache<br/>[cache.py]")]
  node_supabase[("Public data store<br/>[supabase_client.py]")]
  node_feedmanager["Feed persistence<br/>[feed_manager.py]"]
end

subgraph group_accounts["Accounts and controls"]
  node_authui["Auth state<br/>[AuthContext.jsx]"]
  node_authroute["Authentication routes<br/>[auth.py]"]
  node_authlib["JWT authentication<br/>[auth.py]"]
  node_quota["Daily quota<br/>[daily_quota.py]"]
  node_limiter["Rate limiting<br/>[limiter.py]"]
end

subgraph group_community["Community and analytics"]
  node_dashboard["Analytics dashboard<br/>[DashboardPage.jsx]"]
  node_feedpage["Community feed<br/>[FeedPage.jsx]"]
  node_datasetpage["Dataset browser<br/>[DatasetPage.jsx]"]
  node_historypage["Private history<br/>[HistoryPage.jsx]"]
  node_trending["Trending analysis job<br/>[trending_cron.py]"]
  node_statsroute["Statistics route<br/>[stats.py]"]
  node_feedroute["Feed route<br/>[feed.py]"]
  node_datasetroute["Dataset route<br/>[dataset.py]"]
  node_trendingroute["Trending route<br/>[trending.py]"]
end

node_user(("User"))

node_user -->|"uses"| node_app
node_app -->|"routes to"| node_detect
node_detect -->|"renders"| node_inputui
node_detect -->|"requests analysis"| node_api
node_api -->|"calls API"| node_analyze
node_analyze -->|"normalizes input"| node_normalize
node_normalize -->|"extracts URL text"| node_fileparse
node_analyze -->|"extracts claims"| node_claims
node_analyze -->|"gates claims"| node_checkworthy
node_analyze -->|"retrieves evidence"| node_evidence
node_evidence -->|"caches searches"| node_cache
node_analyze -->|"scores sources"| node_credibility
node_analyze -->|"reasons over evidence"| node_reasoning
node_analyze -->|"evaluates signals"| node_signals
node_analyze -->|"aggregates verdict"| node_ensemble
node_analyze -->|"formats explanation"| node_explain
node_analyze -->|"returns verdict"| node_resultui
node_authui -->|"sends auth requests"| node_api
node_api -->|"calls API"| node_authroute
node_authroute -->|"uses auth"| node_authlib
node_analyze -->|"checks quota"| node_quota
node_analyze -->|"applies limits"| node_limiter
node_analyze -->|"stores analysis"| node_feedmanager
node_feedmanager -->|"writes feed data"| node_supabase
node_trending -->|"runs pipeline"| node_analyze
node_trending -->|"stores results"| node_feedmanager
node_trending -->|"checks recent items"| node_supabase
node_dashboard -->|"requests stats"| node_api
node_api -->|"calls API"| node_statsroute
node_feedpage -->|"requests feed"| node_api
node_api -->|"calls API"| node_feedroute
node_datasetpage -->|"requests dataset"| node_api
node_api -->|"calls API"| node_datasetroute
node_historypage -->|"requests history"| node_api
node_api -->|"calls API"| node_trendingroute

click node_app "https://github.com/atharvs7/veritasai-v2/blob/main/src/App.jsx"
click node_detect "https://github.com/atharvs7/veritasai-v2/blob/main/src/pages/DetectPage.jsx"
click node_inputui "https://github.com/atharvs7/veritasai-v2/blob/main/src/components/ArticleInput.jsx"
click node_resultui "https://github.com/atharvs7/veritasai-v2/blob/main/src/components/ResultCard.jsx"
click node_api "https://github.com/atharvs7/veritasai-v2/blob/main/src/lib/api.js"
click node_analyze "https://github.com/atharvs7/veritasai-v2/blob/main/backend/routes/analyze.py"
click node_normalize "https://github.com/atharvs7/veritasai-v2/blob/main/backend/lib/input_handler.py"
click node_fileparse "https://github.com/atharvs7/veritasai-v2/blob/main/backend/lib/file_parser.py"
click node_claims "https://github.com/atharvs7/veritasai-v2/blob/main/backend/lib/claim_extractor.py"
click node_checkworthy "https://github.com/atharvs7/veritasai-v2/blob/main/backend/lib/ml_model.py"
click node_evidence "https://github.com/atharvs7/veritasai-v2/blob/main/backend/lib/evidence_retriever.py"
click node_credibility "https://github.com/atharvs7/veritasai-v2/blob/main/backend/lib/source_credibility.py"
click node_reasoning "https://github.com/atharvs7/veritasai-v2/blob/main/backend/lib/evidence_reasoner.py"
click node_signals "https://github.com/atharvs7/veritasai-v2/blob/main/backend/lib/heuristics.py"
click node_ensemble "https://github.com/atharvs7/veritasai-v2/blob/main/backend/lib/ensemble_verdict_v2.py"
click node_explain "https://github.com/atharvs7/veritasai-v2/blob/main/backend/lib/explainability_formatter.py"
click node_cache "https://github.com/atharvs7/veritasai-v2/blob/main/backend/lib/cache.py"
click node_supabase "https://github.com/atharvs7/veritasai-v2/blob/main/backend/lib/supabase_client.py"
click node_feedmanager "https://github.com/atharvs7/veritasai-v2/blob/main/backend/lib/feed_manager.py"
click node_authui "https://github.com/atharvs7/veritasai-v2/blob/main/src/context/AuthContext.jsx"
click node_authroute "https://github.com/atharvs7/veritasai-v2/blob/main/backend/routes/auth.py"
click node_authlib "https://github.com/atharvs7/veritasai-v2/blob/main/backend/lib/auth.py"
click node_quota "https://github.com/atharvs7/veritasai-v2/blob/main/backend/lib/daily_quota.py"
click node_limiter "https://github.com/atharvs7/veritasai-v2/blob/main/backend/lib/limiter.py"
click node_dashboard "https://github.com/atharvs7/veritasai-v2/blob/main/src/pages/DashboardPage.jsx"
click node_feedpage "https://github.com/atharvs7/veritasai-v2/blob/main/src/pages/FeedPage.jsx"
click node_datasetpage "https://github.com/atharvs7/veritasai-v2/blob/main/src/pages/DatasetPage.jsx"
click node_historypage "https://github.com/atharvs7/veritasai-v2/blob/main/src/pages/HistoryPage.jsx"
click node_trending "https://github.com/atharvs7/veritasai-v2/blob/main/backend/jobs/trending_cron.py"
click node_statsroute "https://github.com/atharvs7/veritasai-v2/blob/main/backend/routes/stats.py"
click node_feedroute "https://github.com/atharvs7/veritasai-v2/blob/main/backend/routes/feed.py"
click node_datasetroute "https://github.com/atharvs7/veritasai-v2/blob/main/backend/routes/dataset.py"
click node_trendingroute "https://github.com/atharvs7/veritasai-v2/blob/main/backend/routes/trending.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_app,node_detect,node_inputui,node_resultui,node_api,node_user toneBlue
class node_analyze,node_normalize,node_fileparse,node_claims,node_checkworthy,node_evidence,node_credibility,node_reasoning,node_signals,node_ensemble,node_explain toneAmber
class node_cache,node_supabase,node_feedmanager toneMint
class node_authui,node_authroute,node_authlib,node_quota,node_limiter toneRose
class node_dashboard,node_feedpage,node_datasetpage,node_historypage,node_trending,node_statsroute,node_feedroute,node_datasetroute,node_trendingroute toneIndigo
```

## Components

### Web client

- [Application routes](https://github.com/atharvs7/veritasai-v2/blob/main/src/App.jsx): `src/App.jsx`
- [Analysis page](https://github.com/atharvs7/veritasai-v2/blob/main/src/pages/DetectPage.jsx): `src/pages/DetectPage.jsx`
- [Article input](https://github.com/atharvs7/veritasai-v2/blob/main/src/components/ArticleInput.jsx): `src/components/ArticleInput.jsx`
- [Verdict display](https://github.com/atharvs7/veritasai-v2/blob/main/src/components/ResultCard.jsx): `src/components/ResultCard.jsx`
- [API client](https://github.com/atharvs7/veritasai-v2/blob/main/src/lib/api.js): `src/lib/api.js`

### Claim verification

- [Analysis route](https://github.com/atharvs7/veritasai-v2/blob/main/backend/routes/analyze.py): `backend/routes/analyze.py`
- [Input normalization](https://github.com/atharvs7/veritasai-v2/blob/main/backend/lib/input_handler.py): `backend/lib/input_handler.py`
- [File extraction](https://github.com/atharvs7/veritasai-v2/blob/main/backend/lib/file_parser.py): `backend/lib/file_parser.py`
- [Claim extraction](https://github.com/atharvs7/veritasai-v2/blob/main/backend/lib/claim_extractor.py): `backend/lib/claim_extractor.py`
- [Check-worthiness gate](https://github.com/atharvs7/veritasai-v2/blob/main/backend/lib/ml_model.py): `backend/lib/ml_model.py`
- [Evidence retrieval](https://github.com/atharvs7/veritasai-v2/blob/main/backend/lib/evidence_retriever.py): `backend/lib/evidence_retriever.py`
- [Source credibility](https://github.com/atharvs7/veritasai-v2/blob/main/backend/lib/source_credibility.py): `backend/lib/source_credibility.py`
- [Evidence reasoning](https://github.com/atharvs7/veritasai-v2/blob/main/backend/lib/evidence_reasoner.py): `backend/lib/evidence_reasoner.py`
- [Language signals](https://github.com/atharvs7/veritasai-v2/blob/main/backend/lib/heuristics.py): `backend/lib/heuristics.py`
- [Verdict ensemble](https://github.com/atharvs7/veritasai-v2/blob/main/backend/lib/ensemble_verdict_v2.py): `backend/lib/ensemble_verdict_v2.py`
- [Decision explanation](https://github.com/atharvs7/veritasai-v2/blob/main/backend/lib/explainability_formatter.py): `backend/lib/explainability_formatter.py`

### Evidence and persistence

- [Result cache](https://github.com/atharvs7/veritasai-v2/blob/main/backend/lib/cache.py): `backend/lib/cache.py`
- [Public data store](https://github.com/atharvs7/veritasai-v2/blob/main/backend/lib/supabase_client.py): `backend/lib/supabase_client.py`
- [Feed persistence](https://github.com/atharvs7/veritasai-v2/blob/main/backend/lib/feed_manager.py): `backend/lib/feed_manager.py`

### Accounts and controls

- [Auth state](https://github.com/atharvs7/veritasai-v2/blob/main/src/context/AuthContext.jsx): `src/context/AuthContext.jsx`
- [Authentication routes](https://github.com/atharvs7/veritasai-v2/blob/main/backend/routes/auth.py): `backend/routes/auth.py`
- [JWT authentication](https://github.com/atharvs7/veritasai-v2/blob/main/backend/lib/auth.py): `backend/lib/auth.py`
- [Daily quota](https://github.com/atharvs7/veritasai-v2/blob/main/backend/lib/daily_quota.py): `backend/lib/daily_quota.py`
- [Rate limiting](https://github.com/atharvs7/veritasai-v2/blob/main/backend/lib/limiter.py): `backend/lib/limiter.py`

### Community and analytics

- [Analytics dashboard](https://github.com/atharvs7/veritasai-v2/blob/main/src/pages/DashboardPage.jsx): `src/pages/DashboardPage.jsx`
- [Community feed](https://github.com/atharvs7/veritasai-v2/blob/main/src/pages/FeedPage.jsx): `src/pages/FeedPage.jsx`
- [Dataset browser](https://github.com/atharvs7/veritasai-v2/blob/main/src/pages/DatasetPage.jsx): `src/pages/DatasetPage.jsx`
- [Private history](https://github.com/atharvs7/veritasai-v2/blob/main/src/pages/HistoryPage.jsx): `src/pages/HistoryPage.jsx`
- [Trending analysis job](https://github.com/atharvs7/veritasai-v2/blob/main/backend/jobs/trending_cron.py): `backend/jobs/trending_cron.py`
- [Statistics route](https://github.com/atharvs7/veritasai-v2/blob/main/backend/routes/stats.py): `backend/routes/stats.py`
- [Feed route](https://github.com/atharvs7/veritasai-v2/blob/main/backend/routes/feed.py): `backend/routes/feed.py`
- [Dataset route](https://github.com/atharvs7/veritasai-v2/blob/main/backend/routes/dataset.py): `backend/routes/dataset.py`
- [Trending route](https://github.com/atharvs7/veritasai-v2/blob/main/backend/routes/trending.py): `backend/routes/trending.py`

### Other components

- **User**

## Connections

- User → Application routes: uses (evidence: `src/App.jsx`)
- Application routes → Analysis page: routes to (evidence: `src/App.jsx`)
- Analysis page → Article input: renders (evidence: `src/pages/DetectPage.jsx`)
- Analysis page → API client: requests analysis (evidence: `src/pages/DetectPage.jsx`)
- API client → Analysis route: calls API (evidence: `src/lib/api.js`)
- Analysis route → Input normalization: normalizes input (evidence: `backend/routes/analyze.py`)
- Input normalization → File extraction: extracts URL text (evidence: `backend/lib/input_handler.py`)
- Analysis route → Claim extraction: extracts claims (evidence: `README.md`)
- Analysis route → Check-worthiness gate: gates claims (evidence: `backend/routes/analyze.py`)
- Analysis route → Evidence retrieval: retrieves evidence (evidence: `README.md`)
- Evidence retrieval → Result cache: caches searches (evidence: `backend/lib/evidence_retriever.py`)
- Analysis route → Source credibility: scores sources (evidence: `README.md`)
- Analysis route → Evidence reasoning: reasons over evidence (evidence: `README.md`)
- Analysis route → Language signals: evaluates signals (evidence: `README.md`)
- Analysis route → Verdict ensemble: aggregates verdict (evidence: `README.md`)
- Analysis route → Decision explanation: formats explanation (evidence: `README.md`)
- Analysis route → Verdict display: returns verdict
- Auth state → API client: sends auth requests (evidence: `src/context/AuthContext.jsx`)
- API client → Authentication routes: calls API (evidence: `src/lib/api.js`)
- Authentication routes → JWT authentication: uses auth (evidence: `backend/routes/auth.py`)
- Analysis route → Daily quota: checks quota (evidence: `backend/routes/analyze.py`)
- Analysis route → Rate limiting: applies limits (evidence: `backend/routes/analyze.py`)
- Analysis route → Feed persistence: stores analysis (evidence: `backend/routes/analyze.py`)
- Feed persistence → Public data store: writes feed data (evidence: `backend/lib/feed_manager.py`)
- Trending analysis job → Analysis route: runs pipeline (evidence: `backend/jobs/trending_cron.py`)
- Trending analysis job → Feed persistence: stores results (evidence: `backend/jobs/trending_cron.py`)
- Trending analysis job → Public data store: checks recent items (evidence: `backend/jobs/trending_cron.py`)
- Analytics dashboard → API client: requests stats (evidence: `src/pages/DashboardPage.jsx`)
- API client → Statistics route: calls API (evidence: `src/lib/api.js`)
- Community feed → API client: requests feed (evidence: `src/pages/FeedPage.jsx`)
- API client → Feed route: calls API (evidence: `src/lib/api.js`)
- Dataset browser → API client: requests dataset (evidence: `src/pages/DatasetPage.jsx`)
- API client → Dataset route: calls API (evidence: `src/lib/api.js`)
- Private history → API client: requests history (evidence: `src/pages/HistoryPage.jsx`)
- API client → Trending route: calls API (evidence: `src/lib/api.js`)
