# prithvisb08/news-authenticity-analyzer architecture

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

- Interactive diagram: https://gitdiagram.com/prithvisb08/news-authenticity-analyzer
- Repository: https://github.com/prithvisb08/news-authenticity-analyzer

## Overview

News Authenticity Analyzer is a full-stack article-analysis workbench. Analysts submit manual text, a URL, or a live-feed article; the API extracts or accepts article content, runs an observable NLP/classification pipeline, and returns linguistic signals, explainability, sentence heatmaps, fact-check results, and publisher intelligence. Results are persisted for audit history. The README documents the frontend/API relationship and product capabilities; some frontend wiring and unsampled route/service internals are not shown, so those relationships are omitted or cited to the README rather than inferred from module names.

Main entry points: [`backend/app/services/analysis_service.py`](https://github.com/prithvisb08/news-authenticity-analyzer/blob/main/backend/app/services/analysis_service.py) (Analysis Orchestrator), [`backend/app/main.py`](https://github.com/prithvisb08/news-authenticity-analyzer/blob/main/backend/app/main.py) (FastAPI Application), [`backend/app/api/routes/analyze.py`](https://github.com/prithvisb08/news-authenticity-analyzer/blob/main/backend/app/api/routes/analyze.py) (Analysis Endpoint), [`backend/app/services/fact_check_service.py`](https://github.com/prithvisb08/news-authenticity-analyzer/blob/main/backend/app/services/fact_check_service.py) (Claim Fact-checking)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workbench["Analyst Workbench"]
  node_input["Article Workspace"]
  node_pipeline_ui["Pipeline Views"]
  node_results_ui["Analysis Diagnostics"]
  node_fact_ui["Fact-check View<br/>[FactCheckCard.tsx]"]
end

subgraph group_api["API and Ingestion"]
  node_api_app["FastAPI Application<br/>[main.py]"]
  node_analysis_route["Analysis Endpoint<br/>[analyze.py]"]
  node_news_route["News Endpoint<br/>[news.py]"]
  node_extractor["URL Article Extraction"]
  node_news_service["Live News Providers<br/>[news_service.py]"]
end

subgraph group_analysis["Analysis Engines"]
  node_analysis_orchestrator["Analysis Orchestrator"]
  node_preprocessing["Text Preprocessing<br/>[preprocessing.py]"]
  node_feature_extraction["TF-IDF Features"]
  node_classifier["Calibrated Classifier<br/>[classifier.py]"]
  node_explainability["Linear Explainability<br/>[explainability.py]"]
  node_signals["Linguistic Signals<br/>[signal_analyzer.py]"]
  node_heatmap["Sentence Heatmap"]
end

subgraph group_intelligence["External Intelligence"]
  node_fact_check["Claim Fact-checking"]
  node_domain_intel["Publisher Intelligence"]
  node_fact_service["Google Fact Check"]
  node_news_sources["News Providers"]
end

subgraph group_state["Audit and Model State"]
  node_repository["Analysis Repository<br/>[repository.py]"]
  node_database[("SQLite Audit Store<br/>[database.py]")]
  node_model_registry["Model Registry<br/>[model_loader.py]"]
end

node_analyst(("Analyst"))

node_analyst -->|"submits article"| node_input
node_input -->|"sends analysis"| node_api_app
node_api_app -->|"routes requests"| node_analysis_route
node_api_app -->|"routes requests"| node_news_route
node_analysis_route -->|"invokes analysis"| node_analysis_orchestrator
node_analysis_route -->|"requests extraction"| node_extractor
node_news_route -->|"fetches feed"| node_news_service
node_news_service -->|"fetches articles"| node_news_sources
node_analysis_orchestrator -->|"preprocesses text"| node_preprocessing
node_analysis_orchestrator -->|"extracts features"| node_feature_extraction
node_analysis_orchestrator -->|"classifies features"| node_classifier
node_analysis_orchestrator -->|"explains prediction"| node_explainability
node_analysis_orchestrator -->|"analyzes signals"| node_signals
node_analysis_orchestrator -->|"builds heatmap"| node_heatmap
node_analysis_orchestrator -->|"checks claims"| node_fact_check
node_fact_check -->|"queries registry"| node_fact_service
node_analysis_orchestrator -->|"audits publisher"| node_domain_intel
node_analysis_orchestrator -->|"saves audit"| node_repository
node_repository -->|"writes records"| node_database
node_api_app -->|"loads artifacts"| node_model_registry
node_analysis_orchestrator -->|"uses model components"| node_model_registry
node_api_app -->|"serves workbench"| node_input
node_analysis_orchestrator -->|"returns analysis"| node_results_ui
node_analysis_orchestrator -->|"returns pipeline data"| node_pipeline_ui
node_fact_check -->|"returns claim results"| node_fact_ui

click node_input "https://github.com/prithvisb08/news-authenticity-analyzer/blob/main/frontend/components/analyzer/ArticleInputPanel.tsx"
click node_pipeline_ui "https://github.com/prithvisb08/news-authenticity-analyzer/blob/main/frontend/components/pipeline/PipelineExecutionGraph.tsx"
click node_results_ui "https://github.com/prithvisb08/news-authenticity-analyzer/blob/main/frontend/components/prediction/PredictionDashboard.tsx"
click node_fact_ui "https://github.com/prithvisb08/news-authenticity-analyzer/blob/main/frontend/components/diagnostics/FactCheckCard.tsx"
click node_api_app "https://github.com/prithvisb08/news-authenticity-analyzer/blob/main/backend/app/main.py"
click node_analysis_route "https://github.com/prithvisb08/news-authenticity-analyzer/blob/main/backend/app/api/routes/analyze.py"
click node_news_route "https://github.com/prithvisb08/news-authenticity-analyzer/blob/main/backend/app/api/routes/news.py"
click node_extractor "https://github.com/prithvisb08/news-authenticity-analyzer/blob/main/backend/app/services/article_extractor.py"
click node_news_service "https://github.com/prithvisb08/news-authenticity-analyzer/blob/main/backend/app/services/news_service.py"
click node_analysis_orchestrator "https://github.com/prithvisb08/news-authenticity-analyzer/blob/main/backend/app/services/analysis_service.py"
click node_preprocessing "https://github.com/prithvisb08/news-authenticity-analyzer/blob/main/backend/app/ml/preprocessing.py"
click node_feature_extraction "https://github.com/prithvisb08/news-authenticity-analyzer/blob/main/backend/app/ml/feature_extraction.py"
click node_classifier "https://github.com/prithvisb08/news-authenticity-analyzer/blob/main/backend/app/ml/classifier.py"
click node_explainability "https://github.com/prithvisb08/news-authenticity-analyzer/blob/main/backend/app/ml/explainability.py"
click node_signals "https://github.com/prithvisb08/news-authenticity-analyzer/blob/main/backend/app/services/signal_analyzer.py"
click node_heatmap "https://github.com/prithvisb08/news-authenticity-analyzer/blob/main/backend/app/services/sentence_heatmap_service.py"
click node_fact_check "https://github.com/prithvisb08/news-authenticity-analyzer/blob/main/backend/app/services/fact_check_service.py"
click node_domain_intel "https://github.com/prithvisb08/news-authenticity-analyzer/blob/main/backend/app/services/domain_intel_service.py"
click node_repository "https://github.com/prithvisb08/news-authenticity-analyzer/blob/main/backend/app/db/repository.py"
click node_database "https://github.com/prithvisb08/news-authenticity-analyzer/blob/main/backend/app/db/database.py"
click node_model_registry "https://github.com/prithvisb08/news-authenticity-analyzer/blob/main/backend/app/ml/model_loader.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_input,node_pipeline_ui,node_results_ui,node_fact_ui toneBlue
class node_api_app,node_analysis_route,node_news_route,node_extractor,node_news_service toneAmber
class node_analysis_orchestrator,node_preprocessing,node_feature_extraction,node_classifier,node_explainability,node_signals,node_heatmap toneMint
class node_fact_check,node_domain_intel,node_fact_service,node_news_sources toneRose
class node_repository,node_database,node_model_registry,node_analyst toneIndigo
```

## Components

### Analyst Workbench

- [Article Workspace](https://github.com/prithvisb08/news-authenticity-analyzer/blob/main/frontend/components/analyzer/ArticleInputPanel.tsx): `frontend/components/analyzer/ArticleInputPanel.tsx`
- [Pipeline Views](https://github.com/prithvisb08/news-authenticity-analyzer/blob/main/frontend/components/pipeline/PipelineExecutionGraph.tsx): `frontend/components/pipeline/PipelineExecutionGraph.tsx`
- [Analysis Diagnostics](https://github.com/prithvisb08/news-authenticity-analyzer/blob/main/frontend/components/prediction/PredictionDashboard.tsx): `frontend/components/prediction/PredictionDashboard.tsx`
- [Fact-check View](https://github.com/prithvisb08/news-authenticity-analyzer/blob/main/frontend/components/diagnostics/FactCheckCard.tsx): `frontend/components/diagnostics/FactCheckCard.tsx`

### API and Ingestion

- [FastAPI Application](https://github.com/prithvisb08/news-authenticity-analyzer/blob/main/backend/app/main.py): `backend/app/main.py`
- [Analysis Endpoint](https://github.com/prithvisb08/news-authenticity-analyzer/blob/main/backend/app/api/routes/analyze.py): `backend/app/api/routes/analyze.py`
- [News Endpoint](https://github.com/prithvisb08/news-authenticity-analyzer/blob/main/backend/app/api/routes/news.py): `backend/app/api/routes/news.py`
- [URL Article Extraction](https://github.com/prithvisb08/news-authenticity-analyzer/blob/main/backend/app/services/article_extractor.py): `backend/app/services/article_extractor.py`
- [Live News Providers](https://github.com/prithvisb08/news-authenticity-analyzer/blob/main/backend/app/services/news_service.py): `backend/app/services/news_service.py`

### Analysis Engines

- [Analysis Orchestrator](https://github.com/prithvisb08/news-authenticity-analyzer/blob/main/backend/app/services/analysis_service.py): `backend/app/services/analysis_service.py`
- [Text Preprocessing](https://github.com/prithvisb08/news-authenticity-analyzer/blob/main/backend/app/ml/preprocessing.py): `backend/app/ml/preprocessing.py`
- [TF-IDF Features](https://github.com/prithvisb08/news-authenticity-analyzer/blob/main/backend/app/ml/feature_extraction.py): `backend/app/ml/feature_extraction.py`
- [Calibrated Classifier](https://github.com/prithvisb08/news-authenticity-analyzer/blob/main/backend/app/ml/classifier.py): `backend/app/ml/classifier.py`
- [Linear Explainability](https://github.com/prithvisb08/news-authenticity-analyzer/blob/main/backend/app/ml/explainability.py): `backend/app/ml/explainability.py`
- [Linguistic Signals](https://github.com/prithvisb08/news-authenticity-analyzer/blob/main/backend/app/services/signal_analyzer.py): `backend/app/services/signal_analyzer.py`
- [Sentence Heatmap](https://github.com/prithvisb08/news-authenticity-analyzer/blob/main/backend/app/services/sentence_heatmap_service.py): `backend/app/services/sentence_heatmap_service.py`

### External Intelligence

- [Claim Fact-checking](https://github.com/prithvisb08/news-authenticity-analyzer/blob/main/backend/app/services/fact_check_service.py): `backend/app/services/fact_check_service.py`
- [Publisher Intelligence](https://github.com/prithvisb08/news-authenticity-analyzer/blob/main/backend/app/services/domain_intel_service.py): `backend/app/services/domain_intel_service.py`
- **Google Fact Check**
- **News Providers**

### Audit and Model State

- [Analysis Repository](https://github.com/prithvisb08/news-authenticity-analyzer/blob/main/backend/app/db/repository.py): `backend/app/db/repository.py`
- [SQLite Audit Store](https://github.com/prithvisb08/news-authenticity-analyzer/blob/main/backend/app/db/database.py): `backend/app/db/database.py`
- [Model Registry](https://github.com/prithvisb08/news-authenticity-analyzer/blob/main/backend/app/ml/model_loader.py): `backend/app/ml/model_loader.py`

### Other components

- **Analyst**

## Connections

- Analyst → Article Workspace: submits article (evidence: `README.md`)
- Article Workspace → FastAPI Application: sends analysis (evidence: `README.md`)
- FastAPI Application → Analysis Endpoint: routes requests (evidence: `backend/app/main.py`)
- FastAPI Application → News Endpoint: routes requests (evidence: `backend/app/main.py`)
- Analysis Endpoint → Analysis Orchestrator: invokes analysis (evidence: `backend/app/api/routes/analyze.py`)
- Analysis Endpoint → URL Article Extraction: requests extraction (evidence: `backend/app/api/routes/analyze.py`)
- News Endpoint → Live News Providers: fetches feed (evidence: `backend/app/api/routes/news.py`)
- Live News Providers → News Providers: fetches articles (evidence: `backend/app/services/news_service.py`)
- Analysis Orchestrator → Text Preprocessing: preprocesses text (evidence: `backend/app/services/analysis_service.py`)
- Analysis Orchestrator → TF-IDF Features: extracts features (evidence: `backend/app/services/analysis_service.py`)
- Analysis Orchestrator → Calibrated Classifier: classifies features (evidence: `backend/app/services/analysis_service.py`)
- Analysis Orchestrator → Linear Explainability: explains prediction
- Analysis Orchestrator → Linguistic Signals: analyzes signals (evidence: `backend/app/services/analysis_service.py`)
- Analysis Orchestrator → Sentence Heatmap: builds heatmap (evidence: `backend/app/services/analysis_service.py`)
- Analysis Orchestrator → Claim Fact-checking: checks claims (evidence: `backend/app/services/analysis_service.py`)
- Claim Fact-checking → Google Fact Check: queries registry (evidence: `backend/app/services/fact_check_service.py`)
- Analysis Orchestrator → Publisher Intelligence: audits publisher (evidence: `backend/app/services/analysis_service.py`)
- Analysis Orchestrator → Analysis Repository: saves audit (evidence: `backend/app/services/analysis_service.py`)
- Analysis Repository → SQLite Audit Store: writes records (evidence: `backend/app/db/repository.py`)
- FastAPI Application → Model Registry: loads artifacts (evidence: `backend/app/main.py`)
- Analysis Orchestrator → Model Registry: uses model components (evidence: `backend/app/ml/model_loader.py`)
- FastAPI Application → Article Workspace: serves workbench (evidence: `README.md`)
- Analysis Orchestrator → Analysis Diagnostics: returns analysis (evidence: `README.md`)
- Analysis Orchestrator → Pipeline Views: returns pipeline data (evidence: `README.md`)
- Claim Fact-checking → Fact-check View: returns claim results (evidence: `README.md`)
