# deepanprasath23/global_news_hub architecture

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

- Interactive diagram: https://gitdiagram.com/deepanprasath23/global_news_hub
- Repository: https://github.com/deepanprasath23/global_news_hub

## Overview

Global Trends & Information Hub is a public news dashboard backed by a live aggregation API. Visitors browse or search categorized stories, open attributed story details, and view briefings, trending topics, and source information. The backend fetches publisher RSS and Hacker News data, normalizes and deduplicates articles, temporarily caches results in memory, and serves REST endpoints; trending analysis uses coverage, engagement, and recency signals. The graph includes README-documented capabilities whose implementation was not sampled; those links are cited to the README, and source-level edges use the indexed or excerpted files.

Main entry points: [`frontend/src/App.tsx`](https://github.com/deepanprasath23/global_news_hub/blob/main/frontend/src/App.tsx) (Dashboard App), [`backend/app/services/aggregator.py`](https://github.com/deepanprasath23/global_news_hub/blob/main/backend/app/services/aggregator.py) (Feed Aggregator), [`backend/app/api/routes.py`](https://github.com/deepanprasath23/global_news_hub/blob/main/backend/app/api/routes.py) (REST Endpoints), [`backend/app/schemas/models.py`](https://github.com/deepanprasath23/global_news_hub/blob/main/backend/app/schemas/models.py) (Response Models)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Visitor Dashboard"]
  node_app["Dashboard App<br/>[App.tsx]"]
  node_api_client["API Client<br/>[api.ts]"]
  node_story_views["Story Views<br/>[StoryCard.tsx]"]
  node_story_modal["Article Details<br/>[ArticleModal.tsx]"]
  node_trending_view["Trending View"]
  node_briefing_view["Daily Briefing<br/>[HeroBriefing.tsx]"]
  node_category_view["Category Filter<br/>[CategoryBar.tsx]"]
  node_source_view["Sources Directory"]
  node_docs_view["API Docs View<br/>[DevDocs.tsx]"]
  node_formatters["Display Formatters<br/>[formatters.ts]"]
end

subgraph group_api["API Service"]
  node_fastapi["FastAPI App<br/>[main.py]"]
  node_routes["REST Endpoints<br/>[routes.py]"]
  node_models["Response Models<br/>[models.py]"]
  node_cache[("RAM TTL Cache<br/>[cache.py]")]
end

subgraph group_ingest["Live Ingestion"]
  node_rss["RSS Fetcher<br/>[rss_fetcher.py]"]
  node_hn["Hacker News Fetcher<br/>[hacker_news.py]"]
end

subgraph group_domain["Feed Intelligence"]
  node_aggregator["Feed Aggregator<br/>[aggregator.py]"]
  node_trending["Trending Analysis<br/>[trending.py]"]
  node_deduplicator["Article Deduplication<br/>[deduplicator.py]"]
end

node_visitor(("Visitor"))
node_publishers["News Publishers"]
node_hn_service["Hacker News API"]

node_visitor -->|"browses"| node_app
node_app -->|"requests data"| node_api_client
node_api_client -->|"calls REST API"| node_routes
node_app -->|"renders"| node_story_views
node_app -->|"opens details"| node_story_modal
node_app -->|"renders"| node_trending_view
node_app -->|"renders"| node_briefing_view
node_app -->|"renders"| node_category_view
node_app -->|"renders"| node_source_view
node_app -->|"renders"| node_docs_view
node_story_views -->|"formats display"| node_formatters
node_trending_view -->|"renders stories"| node_story_views
node_fastapi -->|"registers routes"| node_routes
node_routes -->|"requests feed data"| node_aggregator
node_routes -->|"analyzes topics"| node_trending
node_routes -->|"reads health stats"| node_cache
node_aggregator -->|"reads and writes"| node_cache
node_aggregator -->|"fetches feeds"| node_rss
node_aggregator -->|"fetches stories"| node_hn
node_aggregator -->|"deduplicates articles"| node_deduplicator
node_trending -->|"tokenizes phrases"| node_deduplicator
node_rss -->|"fetches RSS"| node_publishers
node_hn -->|"fetches stories"| node_hn_service
node_aggregator -->|"creates responses"| node_models
node_rss -->|"creates articles"| node_models
node_hn -->|"creates articles"| node_models
node_routes -->|"returns typed responses"| node_models
node_aggregator -->|"serves search and briefing"| node_routes

click node_app "https://github.com/deepanprasath23/global_news_hub/blob/main/frontend/src/App.tsx"
click node_api_client "https://github.com/deepanprasath23/global_news_hub/blob/main/frontend/src/services/api.ts"
click node_story_views "https://github.com/deepanprasath23/global_news_hub/blob/main/frontend/src/components/StoryCard.tsx"
click node_story_modal "https://github.com/deepanprasath23/global_news_hub/blob/main/frontend/src/components/ArticleModal.tsx"
click node_trending_view "https://github.com/deepanprasath23/global_news_hub/blob/main/frontend/src/components/TrendingSection.tsx"
click node_briefing_view "https://github.com/deepanprasath23/global_news_hub/blob/main/frontend/src/components/HeroBriefing.tsx"
click node_category_view "https://github.com/deepanprasath23/global_news_hub/blob/main/frontend/src/components/CategoryBar.tsx"
click node_source_view "https://github.com/deepanprasath23/global_news_hub/blob/main/frontend/src/components/SourcesDirectory.tsx"
click node_docs_view "https://github.com/deepanprasath23/global_news_hub/blob/main/frontend/src/components/DevDocs.tsx"
click node_formatters "https://github.com/deepanprasath23/global_news_hub/blob/main/frontend/src/utils/formatters.ts"
click node_fastapi "https://github.com/deepanprasath23/global_news_hub/blob/main/backend/app/main.py"
click node_routes "https://github.com/deepanprasath23/global_news_hub/blob/main/backend/app/api/routes.py"
click node_models "https://github.com/deepanprasath23/global_news_hub/blob/main/backend/app/schemas/models.py"
click node_cache "https://github.com/deepanprasath23/global_news_hub/blob/main/backend/app/cache.py"
click node_aggregator "https://github.com/deepanprasath23/global_news_hub/blob/main/backend/app/services/aggregator.py"
click node_trending "https://github.com/deepanprasath23/global_news_hub/blob/main/backend/app/services/trending.py"
click node_deduplicator "https://github.com/deepanprasath23/global_news_hub/blob/main/backend/app/ingestion/deduplicator.py"
click node_rss "https://github.com/deepanprasath23/global_news_hub/blob/main/backend/app/ingestion/rss_fetcher.py"
click node_hn "https://github.com/deepanprasath23/global_news_hub/blob/main/backend/app/ingestion/hacker_news.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_api_client,node_story_views,node_story_modal,node_trending_view,node_briefing_view,node_category_view,node_source_view,node_docs_view,node_formatters toneBlue
class node_fastapi,node_routes,node_models,node_cache toneAmber
class node_rss,node_hn,node_hn_service toneMint
class node_aggregator,node_trending,node_deduplicator toneRose
class node_visitor,node_publishers toneIndigo
```

## Components

### Visitor Dashboard

- [Dashboard App](https://github.com/deepanprasath23/global_news_hub/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`
- [API Client](https://github.com/deepanprasath23/global_news_hub/blob/main/frontend/src/services/api.ts): `frontend/src/services/api.ts`
- [Story Views](https://github.com/deepanprasath23/global_news_hub/blob/main/frontend/src/components/StoryCard.tsx): `frontend/src/components/StoryCard.tsx`
- [Article Details](https://github.com/deepanprasath23/global_news_hub/blob/main/frontend/src/components/ArticleModal.tsx): `frontend/src/components/ArticleModal.tsx`
- [Trending View](https://github.com/deepanprasath23/global_news_hub/blob/main/frontend/src/components/TrendingSection.tsx): `frontend/src/components/TrendingSection.tsx`
- [Daily Briefing](https://github.com/deepanprasath23/global_news_hub/blob/main/frontend/src/components/HeroBriefing.tsx): `frontend/src/components/HeroBriefing.tsx`
- [Category Filter](https://github.com/deepanprasath23/global_news_hub/blob/main/frontend/src/components/CategoryBar.tsx): `frontend/src/components/CategoryBar.tsx`
- [Sources Directory](https://github.com/deepanprasath23/global_news_hub/blob/main/frontend/src/components/SourcesDirectory.tsx): `frontend/src/components/SourcesDirectory.tsx`
- [API Docs View](https://github.com/deepanprasath23/global_news_hub/blob/main/frontend/src/components/DevDocs.tsx): `frontend/src/components/DevDocs.tsx`
- [Display Formatters](https://github.com/deepanprasath23/global_news_hub/blob/main/frontend/src/utils/formatters.ts): `frontend/src/utils/formatters.ts`

### API Service

- [FastAPI App](https://github.com/deepanprasath23/global_news_hub/blob/main/backend/app/main.py): `backend/app/main.py`
- [REST Endpoints](https://github.com/deepanprasath23/global_news_hub/blob/main/backend/app/api/routes.py): `backend/app/api/routes.py`
- [Response Models](https://github.com/deepanprasath23/global_news_hub/blob/main/backend/app/schemas/models.py): `backend/app/schemas/models.py`
- [RAM TTL Cache](https://github.com/deepanprasath23/global_news_hub/blob/main/backend/app/cache.py): `backend/app/cache.py`

### Live Ingestion

- [RSS Fetcher](https://github.com/deepanprasath23/global_news_hub/blob/main/backend/app/ingestion/rss_fetcher.py): `backend/app/ingestion/rss_fetcher.py`
- [Hacker News Fetcher](https://github.com/deepanprasath23/global_news_hub/blob/main/backend/app/ingestion/hacker_news.py): `backend/app/ingestion/hacker_news.py`

### Feed Intelligence

- [Feed Aggregator](https://github.com/deepanprasath23/global_news_hub/blob/main/backend/app/services/aggregator.py): `backend/app/services/aggregator.py`
- [Trending Analysis](https://github.com/deepanprasath23/global_news_hub/blob/main/backend/app/services/trending.py): `backend/app/services/trending.py`
- [Article Deduplication](https://github.com/deepanprasath23/global_news_hub/blob/main/backend/app/ingestion/deduplicator.py): `backend/app/ingestion/deduplicator.py`

### Other components

- **Visitor**
- **News Publishers**
- **Hacker News API**

## Connections

- Visitor → Dashboard App: browses (evidence: `README.md`)
- Dashboard App → API Client: requests data (evidence: `frontend/src/App.tsx`)
- API Client → REST Endpoints: calls REST API (evidence: `README.md`)
- Dashboard App → Story Views: renders (evidence: `frontend/src/App.tsx`)
- Dashboard App → Article Details: opens details (evidence: `frontend/src/App.tsx`)
- Dashboard App → Trending View: renders (evidence: `frontend/src/App.tsx`)
- Dashboard App → Daily Briefing: renders (evidence: `frontend/src/App.tsx`)
- Dashboard App → Category Filter: renders (evidence: `frontend/src/App.tsx`)
- Dashboard App → Sources Directory: renders (evidence: `frontend/src/App.tsx`)
- Dashboard App → API Docs View: renders (evidence: `frontend/src/App.tsx`)
- Story Views → Display Formatters: formats display (evidence: `frontend/src/components/StoryCard.tsx`)
- Trending View → Story Views: renders stories (evidence: `frontend/src/components/TrendingSection.tsx`)
- FastAPI App → REST Endpoints: registers routes (evidence: `backend/app/main.py`)
- REST Endpoints → Feed Aggregator: requests feed data (evidence: `backend/app/api/routes.py`)
- REST Endpoints → Trending Analysis: analyzes topics (evidence: `backend/app/api/routes.py`)
- REST Endpoints → RAM TTL Cache: reads health stats (evidence: `backend/app/api/routes.py`)
- Feed Aggregator → RAM TTL Cache: reads and writes (evidence: `backend/app/services/aggregator.py`)
- Feed Aggregator → RSS Fetcher: fetches feeds (evidence: `backend/app/services/aggregator.py`)
- Feed Aggregator → Hacker News Fetcher: fetches stories (evidence: `backend/app/services/aggregator.py`)
- Feed Aggregator → Article Deduplication: deduplicates articles (evidence: `backend/app/services/aggregator.py`)
- Trending Analysis → Article Deduplication: tokenizes phrases (evidence: `backend/app/services/trending.py`)
- RSS Fetcher → News Publishers: fetches RSS (evidence: `backend/app/ingestion/rss_fetcher.py`)
- Hacker News Fetcher → Hacker News API: fetches stories (evidence: `backend/app/ingestion/hacker_news.py`)
- Feed Aggregator → Response Models: creates responses (evidence: `backend/app/services/aggregator.py`)
- RSS Fetcher → Response Models: creates articles (evidence: `backend/app/ingestion/rss_fetcher.py`)
- Hacker News Fetcher → Response Models: creates articles (evidence: `backend/app/ingestion/hacker_news.py`)
- REST Endpoints → Response Models: returns typed responses (evidence: `backend/app/api/routes.py`)
- Feed Aggregator → REST Endpoints: serves search and briefing (evidence: `README.md`)
