# tintunaung124/opennews-auditor architecture

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

- Interactive diagram: https://gitdiagram.com/tintunaung124/opennews-auditor
- Repository: https://github.com/tintunaung124/opennews-auditor

## Overview

OpenNews Auditor takes an article URL through a browser interface, extracts its content and claims, gathers external reporting, verifies claims with AI, and presents an explainable Trust Score. The backend’s domain stages are described in the README but implemented in the single sampled backend module; the graph separates them for clarity. The excerpts show the browser request and result handling, but not the backend audit route or its internal calls, so those backend relationships rely on README documentation.

Main entry points: [`backend/main.py`](https://github.com/tintunaung124/opennews-auditor/blob/main/backend/main.py) (Audit results), [`frontend/script.js`](https://github.com/tintunaung124/opennews-auditor/blob/main/frontend/script.js) (Request and rendering), [`frontend/index.html`](https://github.com/tintunaung124/opennews-auditor/blob/main/frontend/index.html) (Audit interface)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Browser client"]
  node_web_ui["Audit interface<br/>[index.html]"]
  node_client_request["Request and rendering<br/>[script.js]"]
end

subgraph group_audit["Audit workflow"]
  node_audit_api["Audit endpoint<br/>[main.py]"]
  node_article_fetch["Article retrieval<br/>[main.py]"]
  node_content_extract["Content extraction<br/>[main.py]"]
  node_claim_extract["Claim extraction<br/>[main.py]"]
end

subgraph group_evidence["Evidence and verification"]
  node_news_search["News search<br/>[main.py]"]
  node_evidence_build["Evidence preparation<br/>[main.py]"]
  node_ai_verify["Claim verification<br/>[main.py]"]
end

subgraph group_results["Scoring and results"]
  node_score_calc["Trust scoring<br/>[main.py]"]
  node_explanation["Score explanation<br/>[main.py]"]
  node_audit_response["Audit results<br/>[main.py]"]
end

node_user(("Article submitter"))
node_news_sources["External news"]
node_ai_providers["AI providers"]

node_user -->|"opens"| node_web_ui
node_web_ui -->|"uses"| node_client_request
node_client_request -->|"posts URL"| node_audit_api
node_audit_api -->|"retrieves"| node_article_fetch
node_article_fetch -->|"extracts content"| node_content_extract
node_content_extract -->|"identifies claims"| node_claim_extract
node_claim_extract -->|"searches claims"| node_news_search
node_news_search -->|"searches"| node_news_sources
node_news_search -->|"gathers evidence"| node_evidence_build
node_evidence_build -->|"provides evidence"| node_ai_verify
node_ai_verify -->|"verifies claims"| node_ai_providers
node_ai_verify -->|"supplies results"| node_score_calc
node_score_calc -->|"explains score"| node_explanation
node_score_calc -->|"includes score"| node_audit_response
node_explanation -->|"includes explanation"| node_audit_response
node_audit_api -.->|"returns results"| node_audit_response
node_client_request -->|"renders response"| node_audit_response

click node_web_ui "https://github.com/tintunaung124/opennews-auditor/blob/main/frontend/index.html"
click node_client_request "https://github.com/tintunaung124/opennews-auditor/blob/main/frontend/script.js"
click node_audit_api "https://github.com/tintunaung124/opennews-auditor/blob/main/backend/main.py"
click node_article_fetch "https://github.com/tintunaung124/opennews-auditor/blob/main/backend/main.py"
click node_content_extract "https://github.com/tintunaung124/opennews-auditor/blob/main/backend/main.py"
click node_claim_extract "https://github.com/tintunaung124/opennews-auditor/blob/main/backend/main.py"
click node_news_search "https://github.com/tintunaung124/opennews-auditor/blob/main/backend/main.py"
click node_evidence_build "https://github.com/tintunaung124/opennews-auditor/blob/main/backend/main.py"
click node_ai_verify "https://github.com/tintunaung124/opennews-auditor/blob/main/backend/main.py"
click node_score_calc "https://github.com/tintunaung124/opennews-auditor/blob/main/backend/main.py"
click node_explanation "https://github.com/tintunaung124/opennews-auditor/blob/main/backend/main.py"
click node_audit_response "https://github.com/tintunaung124/opennews-auditor/blob/main/backend/main.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_web_ui,node_client_request toneBlue
class node_audit_api,node_article_fetch,node_content_extract,node_claim_extract toneAmber
class node_news_search,node_evidence_build,node_ai_verify toneMint
class node_score_calc,node_explanation,node_audit_response toneRose
class node_user,node_news_sources,node_ai_providers toneIndigo
```

## Components

### Browser client

- [Audit interface](https://github.com/tintunaung124/opennews-auditor/blob/main/frontend/index.html): `frontend/index.html`
- [Request and rendering](https://github.com/tintunaung124/opennews-auditor/blob/main/frontend/script.js): `frontend/script.js`

### Audit workflow

- [Audit endpoint](https://github.com/tintunaung124/opennews-auditor/blob/main/backend/main.py): `backend/main.py`
- [Article retrieval](https://github.com/tintunaung124/opennews-auditor/blob/main/backend/main.py): `backend/main.py`
- [Content extraction](https://github.com/tintunaung124/opennews-auditor/blob/main/backend/main.py): `backend/main.py`
- [Claim extraction](https://github.com/tintunaung124/opennews-auditor/blob/main/backend/main.py): `backend/main.py`

### Evidence and verification

- [News search](https://github.com/tintunaung124/opennews-auditor/blob/main/backend/main.py): `backend/main.py`
- [Evidence preparation](https://github.com/tintunaung124/opennews-auditor/blob/main/backend/main.py): `backend/main.py`
- [Claim verification](https://github.com/tintunaung124/opennews-auditor/blob/main/backend/main.py): `backend/main.py`

### Scoring and results

- [Trust scoring](https://github.com/tintunaung124/opennews-auditor/blob/main/backend/main.py): `backend/main.py`
- [Score explanation](https://github.com/tintunaung124/opennews-auditor/blob/main/backend/main.py): `backend/main.py`
- [Audit results](https://github.com/tintunaung124/opennews-auditor/blob/main/backend/main.py): `backend/main.py`

### Other components

- **Article submitter**
- **External news**
- **AI providers**

## Connections

- Article submitter → Audit interface: opens (evidence: `README.md`)
- Audit interface → Request and rendering: uses (evidence: `frontend/script.js`)
- Request and rendering → Audit endpoint: posts URL (evidence: `frontend/script.js`)
- Audit endpoint → Article retrieval: retrieves (evidence: `README.md`)
- Article retrieval → Content extraction: extracts content (evidence: `README.md`)
- Content extraction → Claim extraction: identifies claims (evidence: `README.md`)
- Claim extraction → News search: searches claims (evidence: `README.md`)
- News search → External news: searches (evidence: `README.md`)
- News search → Evidence preparation: gathers evidence (evidence: `README.md`)
- Evidence preparation → Claim verification: provides evidence (evidence: `README.md`)
- Claim verification → AI providers: verifies claims (evidence: `README.md`)
- Claim verification → Trust scoring: supplies results (evidence: `README.md`)
- Trust scoring → Score explanation: explains score (evidence: `README.md`)
- Trust scoring → Audit results: includes score (evidence: `README.md`)
- Score explanation → Audit results: includes explanation (evidence: `README.md`)
- Audit endpoint → Audit results: returns results (evidence: `backend/main.py`)
- Request and rendering → Audit results: renders response (evidence: `frontend/script.js`)
