# anuraviikhandelwal06/zevrith architecture

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

- Interactive diagram: https://gitdiagram.com/anuraviikhandelwal06/zevrith
- Repository: https://github.com/anuraviikhandelwal06/zevrith

## Overview

Zevrith is a web app for investigating claims: users submit a claim, the backend retrieves web evidence, Gemini assesses it, and the report is saved and displayed with source reasoning and limitations. Users can revisit, import, delete, or clear investigation history, and read the methodology. The graph follows sampled frontend and backend calls plus README-documented capabilities and endpoints; some frontend API and storage wiring is only partially sampled.

Main entry points: [`backend/main.py`](https://github.com/anuraviikhandelwal06/zevrith/blob/main/backend/main.py) (FastAPI routes), [`frontend/src/pages/History.tsx`](https://github.com/anuraviikhandelwal06/zevrith/blob/main/frontend/src/pages/History.tsx) (History page), [`frontend/src/hooks/useInvestigationSession.tsx`](https://github.com/anuraviikhandelwal06/zevrith/blob/main/frontend/src/hooks/useInvestigationSession.tsx) (Investigation session), [`frontend/src/App.tsx`](https://github.com/anuraviikhandelwal06/zevrith/blob/main/frontend/src/App.tsx) (App routes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Claim investigation UI"]
  node_app["App routes<br/>[App.tsx]"]
  node_home["Home page<br/>[Home.tsx]"]
  node_claimform["Claim form<br/>[ClaimForm.tsx]"]
  node_results_page["Results page<br/>[Results.tsx]"]
  node_report["Evidence report"]
  node_history_page["History page<br/>[History.tsx]"]
  node_methodology["Methodology page<br/>[Methodology.tsx]"]
end

subgraph group_client["Frontend state and data"]
  node_session["Investigation session"]
  node_browser_history[("Browser history<br/>[history.ts]")]
  node_validation["Result validation<br/>[validation.ts]"]
  node_investigate_client["Investigation API client<br/>[investigateApi.ts]"]
  node_api_client["History API client<br/>[api.ts]"]
  node_dates["Date formatting<br/>[dates.ts]"]
  node_types["Investigation types<br/>[investigation.ts]"]
end

subgraph group_api["Investigation services"]
  node_backend["FastAPI routes<br/>[main.py]"]
  node_investigator["Claim investigation<br/>[investigation.py]"]
  node_search["Web search<br/>[exa_search.py]"]
end

subgraph group_history["Persistent history"]
  node_record["Investigation record<br/>[models.py]"]
  node_db_config["Database sessions<br/>[database.py]"]
end

node_user(("User"))
node_exa{{"Exa search"}}
node_gemini{{"Gemini analysis"}}
node_postgres[("PostgreSQL")]

node_user -->|"opens"| node_home
node_app -->|"routes to"| node_home
node_app -->|"routes to"| node_results_page
node_app -->|"routes to"| node_history_page
node_app -->|"routes to"| node_methodology
node_home -->|"renders"| node_claimform
node_claimform -->|"submits claim"| node_investigate_client
node_claimform -->|"updates"| node_session
node_investigate_client -->|"POSTs claim"| node_backend
node_backend -->|"investigates"| node_investigator
node_investigator -->|"retrieves sources"| node_search
node_search -->|"searches web"| node_exa
node_investigator -->|"assesses evidence"| node_gemini
node_backend -->|"creates records"| node_record
node_backend -->|"opens sessions"| node_db_config
node_db_config -->|"connects"| node_postgres
node_record -->|"persists reports"| node_postgres
node_backend -->|"reads and manages history"| node_postgres
node_session -->|"stores current result"| node_browser_history
node_results_page -->|"loads result"| node_session
node_results_page -->|"renders"| node_report
node_report -->|"formats dates"| node_dates
node_history_page -->|"manages saved reports"| node_api_client
node_history_page -->|"loads legacy entries"| node_browser_history
node_history_page -->|"opens report"| node_session
node_api_client -->|"calls history endpoints"| node_backend
node_investigate_client -->|"validates response"| node_validation
node_browser_history -->|"parses stored results"| node_validation
node_report -->|"uses result types"| node_types
node_history_page -->|"formats saved dates"| node_dates
node_session -->|"types session result"| node_types

click node_app "https://github.com/anuraviikhandelwal06/zevrith/blob/main/frontend/src/App.tsx"
click node_home "https://github.com/anuraviikhandelwal06/zevrith/blob/main/frontend/src/pages/Home.tsx"
click node_claimform "https://github.com/anuraviikhandelwal06/zevrith/blob/main/frontend/src/components/landing/ClaimForm.tsx"
click node_results_page "https://github.com/anuraviikhandelwal06/zevrith/blob/main/frontend/src/pages/Results.tsx"
click node_report "https://github.com/anuraviikhandelwal06/zevrith/blob/main/frontend/src/components/investigation/InvestigationResults.tsx"
click node_history_page "https://github.com/anuraviikhandelwal06/zevrith/blob/main/frontend/src/pages/History.tsx"
click node_methodology "https://github.com/anuraviikhandelwal06/zevrith/blob/main/frontend/src/pages/Methodology.tsx"
click node_session "https://github.com/anuraviikhandelwal06/zevrith/blob/main/frontend/src/hooks/useInvestigationSession.tsx"
click node_browser_history "https://github.com/anuraviikhandelwal06/zevrith/blob/main/frontend/src/lib/history.ts"
click node_validation "https://github.com/anuraviikhandelwal06/zevrith/blob/main/frontend/src/lib/validation.ts"
click node_investigate_client "https://github.com/anuraviikhandelwal06/zevrith/blob/main/frontend/src/services/investigateApi.ts"
click node_api_client "https://github.com/anuraviikhandelwal06/zevrith/blob/main/frontend/src/lib/api.ts"
click node_backend "https://github.com/anuraviikhandelwal06/zevrith/blob/main/backend/main.py"
click node_investigator "https://github.com/anuraviikhandelwal06/zevrith/blob/main/backend/services/investigation.py"
click node_search "https://github.com/anuraviikhandelwal06/zevrith/blob/main/backend/services/exa_search.py"
click node_record "https://github.com/anuraviikhandelwal06/zevrith/blob/main/backend/models.py"
click node_db_config "https://github.com/anuraviikhandelwal06/zevrith/blob/main/backend/database.py"
click node_dates "https://github.com/anuraviikhandelwal06/zevrith/blob/main/frontend/src/lib/dates.ts"
click node_types "https://github.com/anuraviikhandelwal06/zevrith/blob/main/frontend/src/types/investigation.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_home,node_claimform,node_results_page,node_report,node_history_page,node_methodology,node_user toneBlue
class node_session,node_browser_history,node_validation,node_investigate_client,node_api_client,node_dates,node_types,node_postgres toneAmber
class node_backend,node_investigator,node_search toneMint
class node_record,node_db_config toneRose
class node_exa,node_gemini toneIndigo
```

## Components

### Claim investigation UI

- [App routes](https://github.com/anuraviikhandelwal06/zevrith/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`
- [Home page](https://github.com/anuraviikhandelwal06/zevrith/blob/main/frontend/src/pages/Home.tsx): `frontend/src/pages/Home.tsx`
- [Claim form](https://github.com/anuraviikhandelwal06/zevrith/blob/main/frontend/src/components/landing/ClaimForm.tsx): `frontend/src/components/landing/ClaimForm.tsx`
- [Results page](https://github.com/anuraviikhandelwal06/zevrith/blob/main/frontend/src/pages/Results.tsx): `frontend/src/pages/Results.tsx`
- [Evidence report](https://github.com/anuraviikhandelwal06/zevrith/blob/main/frontend/src/components/investigation/InvestigationResults.tsx): `frontend/src/components/investigation/InvestigationResults.tsx`
- [History page](https://github.com/anuraviikhandelwal06/zevrith/blob/main/frontend/src/pages/History.tsx): `frontend/src/pages/History.tsx`
- [Methodology page](https://github.com/anuraviikhandelwal06/zevrith/blob/main/frontend/src/pages/Methodology.tsx): `frontend/src/pages/Methodology.tsx`

### Frontend state and data

- [Investigation session](https://github.com/anuraviikhandelwal06/zevrith/blob/main/frontend/src/hooks/useInvestigationSession.tsx): `frontend/src/hooks/useInvestigationSession.tsx`
- [Browser history](https://github.com/anuraviikhandelwal06/zevrith/blob/main/frontend/src/lib/history.ts): `frontend/src/lib/history.ts`
- [Result validation](https://github.com/anuraviikhandelwal06/zevrith/blob/main/frontend/src/lib/validation.ts): `frontend/src/lib/validation.ts`
- [Investigation API client](https://github.com/anuraviikhandelwal06/zevrith/blob/main/frontend/src/services/investigateApi.ts): `frontend/src/services/investigateApi.ts`
- [History API client](https://github.com/anuraviikhandelwal06/zevrith/blob/main/frontend/src/lib/api.ts): `frontend/src/lib/api.ts`
- [Date formatting](https://github.com/anuraviikhandelwal06/zevrith/blob/main/frontend/src/lib/dates.ts): `frontend/src/lib/dates.ts`
- [Investigation types](https://github.com/anuraviikhandelwal06/zevrith/blob/main/frontend/src/types/investigation.ts): `frontend/src/types/investigation.ts`

### Investigation services

- [FastAPI routes](https://github.com/anuraviikhandelwal06/zevrith/blob/main/backend/main.py): `backend/main.py`
- [Claim investigation](https://github.com/anuraviikhandelwal06/zevrith/blob/main/backend/services/investigation.py): `backend/services/investigation.py`
- [Web search](https://github.com/anuraviikhandelwal06/zevrith/blob/main/backend/services/exa_search.py): `backend/services/exa_search.py`

### Persistent history

- [Investigation record](https://github.com/anuraviikhandelwal06/zevrith/blob/main/backend/models.py): `backend/models.py`
- [Database sessions](https://github.com/anuraviikhandelwal06/zevrith/blob/main/backend/database.py): `backend/database.py`

### Other components

- **User**
- **Exa search**
- **Gemini analysis**
- **PostgreSQL**

## Connections

- User → Home page: opens
- App routes → Home page: routes to (evidence: `frontend/src/App.tsx`)
- App routes → Results page: routes to (evidence: `frontend/src/App.tsx`)
- App routes → History page: routes to (evidence: `frontend/src/App.tsx`)
- App routes → Methodology page: routes to (evidence: `frontend/src/App.tsx`)
- Home page → Claim form: renders (evidence: `frontend/src/pages/Home.tsx`)
- Claim form → Investigation API client: submits claim (evidence: `frontend/src/components/landing/ClaimForm.tsx`)
- Claim form → Investigation session: updates (evidence: `frontend/src/components/landing/ClaimForm.tsx`)
- Investigation API client → FastAPI routes: POSTs claim (evidence: `frontend/src/services/investigateApi.ts`)
- FastAPI routes → Claim investigation: investigates (evidence: `backend/main.py`)
- Claim investigation → Web search: retrieves sources (evidence: `backend/services/investigation.py`)
- Web search → Exa search: searches web (evidence: `README.md`)
- Claim investigation → Gemini analysis: assesses evidence (evidence: `README.md`)
- FastAPI routes → Investigation record: creates records (evidence: `backend/main.py`)
- FastAPI routes → Database sessions: opens sessions (evidence: `backend/main.py`)
- Database sessions → PostgreSQL: connects (evidence: `backend/database.py`)
- Investigation record → PostgreSQL: persists reports (evidence: `README.md`)
- FastAPI routes → PostgreSQL: reads and manages history (evidence: `backend/main.py`)
- Investigation session → Browser history: stores current result (evidence: `frontend/src/hooks/useInvestigationSession.tsx`)
- Results page → Investigation session: loads result (evidence: `frontend/src/pages/Results.tsx`)
- Results page → Evidence report: renders (evidence: `frontend/src/pages/Results.tsx`)
- Evidence report → Date formatting: formats dates (evidence: `frontend/src/components/investigation/InvestigationResults.tsx`)
- History page → History API client: manages saved reports (evidence: `frontend/src/pages/History.tsx`)
- History page → Browser history: loads legacy entries (evidence: `frontend/src/pages/History.tsx`)
- History page → Investigation session: opens report (evidence: `frontend/src/pages/History.tsx`)
- History API client → FastAPI routes: calls history endpoints (evidence: `README.md`)
- Investigation API client → Result validation: validates response (evidence: `frontend/src/services/investigateApi.ts`)
- Browser history → Result validation: parses stored results (evidence: `frontend/src/lib/history.ts`)
- Evidence report → Investigation types: uses result types (evidence: `frontend/src/components/investigation/InvestigationResults.tsx`)
- History page → Date formatting: formats saved dates (evidence: `frontend/src/pages/History.tsx`)
- Investigation session → Investigation types: types session result (evidence: `frontend/src/hooks/useInvestigationSession.tsx`)
