# varshithagudipudi/news_ai_demo architecture

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

- Interactive diagram: https://gitdiagram.com/varshithagudipudi/news_ai_demo
- Repository: https://github.com/varshithagudipudi/news_ai_demo

## Overview

bellora.pulse is a news aggregator and AI-career resource portal. Its main news workflow collects provider headlines, filters and deduplicates them, optionally enriches them, and stores article metadata for browsing. Users can also explore jobs, interview practice, podcasts, and tools, with saved-resource state in browser storage. The collection route and several catalog/UI relationships are supported by excerpts or the source index; finer internal collection calls are documented in the README but their implementation was not sampled.

Main entry points: [`lib/news/collectNews.ts`](https://github.com/varshithagudipudi/news_ai_demo/blob/main/lib/news/collectNews.ts) (Collection processing), [`lib/db/repository.ts`](https://github.com/varshithagudipudi/news_ai_demo/blob/main/lib/db/repository.ts) (Repository contract), [`components/interviews/InterviewDirectory.tsx`](https://github.com/varshithagudipudi/news_ai_demo/blob/main/components/interviews/InterviewDirectory.tsx) (Interview practice), [`components/podcasts/PodcastDirectory.tsx`](https://github.com/varshithagudipudi/news_ai_demo/blob/main/components/podcasts/PodcastDirectory.tsx) (Podcast directory)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_news["News collection and feed"]
  node_collect_route["Collection endpoint<br/>[route.ts]"]
  node_collection["Collection processing<br/>[collectNews.ts]"]
  node_normalize["Normalize and deduplicate<br/>[normalize.ts]"]
  node_relevance["Relevance filtering<br/>[relevance.ts]"]
  node_enrichment["Optional AI enrichment<br/>[enrichArticle.ts]"]
  node_feed_page["Home feed entry<br/>[page.tsx]"]
  node_home_view["Feed browsing<br/>[HomeView.tsx]"]
end

subgraph group_storage["Article storage and API"]
  node_articles_api["Articles API<br/>[route.ts]"]
  node_article_validation["Article validation<br/>[article.ts]"]
  node_article_service["Article access<br/>[articles.ts]"]
  node_repository["Repository contract<br/>[repository.ts]"]
  node_local_store[("Local JSON store<br/>[localRepository.ts]")]
  node_supabase_store[("Supabase store")]
end

subgraph group_career["Career resources"]
  node_jobs["Jobs board and detail<br/>[JobsBoard.tsx]"]
  node_live_jobs["Live job catalog<br/>[live.ts]"]
  node_interviews["Interview practice"]
  node_interview_catalog["Interview catalog<br/>[catalog.ts]"]
end

subgraph group_directories["Learning directories"]
  node_podcasts["Podcast directory"]
  node_podcast_catalog["Podcast catalog<br/>[catalog.ts]"]
  node_tools["Tools directory<br/>[ToolsDirectory.tsx]"]
  node_tool_catalog["Tools catalog<br/>[catalog.ts]"]
  node_saved_resources["Saved resource state"]
  node_directory_ui["Shared directory UI<br/>[DirectoryUI.tsx]"]
end

node_reader(("News reader"))
node_collector(("Scheduled or manual collector"))
node_gnews{{"GNews API"}}

node_collector -->|"invokes"| node_collect_route
node_collect_route -->|"runs"| node_collection
node_collection -->|"queries"| node_gnews
node_collection -->|"normalizes and deduplicates"| node_normalize
node_collection -->|"scores and filters"| node_relevance
node_collection -->|"optionally enriches"| node_enrichment
node_collection -.->|"inserts articles"| node_repository
node_reader -.->|"opens"| node_feed_page
node_feed_page -->|"renders"| node_home_view
node_articles_api -->|"validates query"| node_article_validation
node_articles_api -->|"lists articles"| node_article_service
node_article_service -.->|"uses"| node_repository
node_repository -->|"implemented by"| node_local_store
node_repository -->|"implemented by"| node_supabase_store
node_jobs -->|"loads listings"| node_live_jobs
node_interviews -->|"filters questions"| node_interview_catalog
node_interviews -->|"reads saved practice"| node_saved_resources
node_interviews -->|"renders controls"| node_directory_ui
node_podcasts -->|"filters episodes"| node_podcast_catalog
node_podcasts -->|"reads saved items"| node_saved_resources
node_podcasts -->|"renders controls"| node_directory_ui
node_tools -->|"uses catalog"| node_tool_catalog
node_tools -->|"reads saved tools"| node_saved_resources
node_tools -->|"renders controls"| node_directory_ui

click node_collect_route "https://github.com/varshithagudipudi/news_ai_demo/blob/main/app/api/internal/collect-news/route.ts"
click node_collection "https://github.com/varshithagudipudi/news_ai_demo/blob/main/lib/news/collectNews.ts"
click node_normalize "https://github.com/varshithagudipudi/news_ai_demo/blob/main/lib/news/normalize.ts"
click node_relevance "https://github.com/varshithagudipudi/news_ai_demo/blob/main/lib/news/relevance.ts"
click node_enrichment "https://github.com/varshithagudipudi/news_ai_demo/blob/main/lib/ai/enrichArticle.ts"
click node_feed_page "https://github.com/varshithagudipudi/news_ai_demo/blob/main/app/page.tsx"
click node_home_view "https://github.com/varshithagudipudi/news_ai_demo/blob/main/components/HomeView.tsx"
click node_articles_api "https://github.com/varshithagudipudi/news_ai_demo/blob/main/app/api/articles/route.ts"
click node_article_validation "https://github.com/varshithagudipudi/news_ai_demo/blob/main/lib/validation/article.ts"
click node_article_service "https://github.com/varshithagudipudi/news_ai_demo/blob/main/lib/db/articles.ts"
click node_repository "https://github.com/varshithagudipudi/news_ai_demo/blob/main/lib/db/repository.ts"
click node_local_store "https://github.com/varshithagudipudi/news_ai_demo/blob/main/lib/db/localRepository.ts"
click node_supabase_store "https://github.com/varshithagudipudi/news_ai_demo/blob/main/lib/db/supabaseRepository.ts"
click node_jobs "https://github.com/varshithagudipudi/news_ai_demo/blob/main/components/jobs/JobsBoard.tsx"
click node_live_jobs "https://github.com/varshithagudipudi/news_ai_demo/blob/main/lib/jobs/live.ts"
click node_interviews "https://github.com/varshithagudipudi/news_ai_demo/blob/main/components/interviews/InterviewDirectory.tsx"
click node_interview_catalog "https://github.com/varshithagudipudi/news_ai_demo/blob/main/lib/interviews/catalog.ts"
click node_podcasts "https://github.com/varshithagudipudi/news_ai_demo/blob/main/components/podcasts/PodcastDirectory.tsx"
click node_podcast_catalog "https://github.com/varshithagudipudi/news_ai_demo/blob/main/lib/podcasts/catalog.ts"
click node_tools "https://github.com/varshithagudipudi/news_ai_demo/blob/main/components/tools/ToolsDirectory.tsx"
click node_tool_catalog "https://github.com/varshithagudipudi/news_ai_demo/blob/main/lib/tools/catalog.ts"
click node_saved_resources "https://github.com/varshithagudipudi/news_ai_demo/blob/main/lib/hooks/useSavedResources.ts"
click node_directory_ui "https://github.com/varshithagudipudi/news_ai_demo/blob/main/components/directory/DirectoryUI.tsx"

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_collect_route,node_collection,node_normalize,node_relevance,node_enrichment,node_feed_page,node_home_view toneBlue
class node_articles_api,node_article_validation,node_article_service,node_repository,node_local_store,node_supabase_store toneAmber
class node_jobs,node_live_jobs,node_interviews,node_interview_catalog,node_gnews toneMint
class node_podcasts,node_podcast_catalog,node_tools,node_tool_catalog,node_saved_resources,node_directory_ui toneRose
class node_reader,node_collector toneIndigo
```

## Components

### News collection and feed

- [Collection endpoint](https://github.com/varshithagudipudi/news_ai_demo/blob/main/app/api/internal/collect-news/route.ts): `app/api/internal/collect-news/route.ts`
- [Collection processing](https://github.com/varshithagudipudi/news_ai_demo/blob/main/lib/news/collectNews.ts): `lib/news/collectNews.ts`
- [Normalize and deduplicate](https://github.com/varshithagudipudi/news_ai_demo/blob/main/lib/news/normalize.ts): `lib/news/normalize.ts`
- [Relevance filtering](https://github.com/varshithagudipudi/news_ai_demo/blob/main/lib/news/relevance.ts): `lib/news/relevance.ts`
- [Optional AI enrichment](https://github.com/varshithagudipudi/news_ai_demo/blob/main/lib/ai/enrichArticle.ts): `lib/ai/enrichArticle.ts`
- [Home feed entry](https://github.com/varshithagudipudi/news_ai_demo/blob/main/app/page.tsx): `app/page.tsx`
- [Feed browsing](https://github.com/varshithagudipudi/news_ai_demo/blob/main/components/HomeView.tsx): `components/HomeView.tsx`

### Article storage and API

- [Articles API](https://github.com/varshithagudipudi/news_ai_demo/blob/main/app/api/articles/route.ts): `app/api/articles/route.ts`
- [Article validation](https://github.com/varshithagudipudi/news_ai_demo/blob/main/lib/validation/article.ts): `lib/validation/article.ts`
- [Article access](https://github.com/varshithagudipudi/news_ai_demo/blob/main/lib/db/articles.ts): `lib/db/articles.ts`
- [Repository contract](https://github.com/varshithagudipudi/news_ai_demo/blob/main/lib/db/repository.ts): `lib/db/repository.ts`
- [Local JSON store](https://github.com/varshithagudipudi/news_ai_demo/blob/main/lib/db/localRepository.ts): `lib/db/localRepository.ts`
- [Supabase store](https://github.com/varshithagudipudi/news_ai_demo/blob/main/lib/db/supabaseRepository.ts): `lib/db/supabaseRepository.ts`

### Career resources

- [Jobs board and detail](https://github.com/varshithagudipudi/news_ai_demo/blob/main/components/jobs/JobsBoard.tsx): `components/jobs/JobsBoard.tsx`
- [Live job catalog](https://github.com/varshithagudipudi/news_ai_demo/blob/main/lib/jobs/live.ts): `lib/jobs/live.ts`
- [Interview practice](https://github.com/varshithagudipudi/news_ai_demo/blob/main/components/interviews/InterviewDirectory.tsx): `components/interviews/InterviewDirectory.tsx`
- [Interview catalog](https://github.com/varshithagudipudi/news_ai_demo/blob/main/lib/interviews/catalog.ts): `lib/interviews/catalog.ts`

### Learning directories

- [Podcast directory](https://github.com/varshithagudipudi/news_ai_demo/blob/main/components/podcasts/PodcastDirectory.tsx): `components/podcasts/PodcastDirectory.tsx`
- [Podcast catalog](https://github.com/varshithagudipudi/news_ai_demo/blob/main/lib/podcasts/catalog.ts): `lib/podcasts/catalog.ts`
- [Tools directory](https://github.com/varshithagudipudi/news_ai_demo/blob/main/components/tools/ToolsDirectory.tsx): `components/tools/ToolsDirectory.tsx`
- [Tools catalog](https://github.com/varshithagudipudi/news_ai_demo/blob/main/lib/tools/catalog.ts): `lib/tools/catalog.ts`
- [Saved resource state](https://github.com/varshithagudipudi/news_ai_demo/blob/main/lib/hooks/useSavedResources.ts): `lib/hooks/useSavedResources.ts`
- [Shared directory UI](https://github.com/varshithagudipudi/news_ai_demo/blob/main/components/directory/DirectoryUI.tsx): `components/directory/DirectoryUI.tsx`

### Other components

- **News reader**
- **Scheduled or manual collector**
- **GNews API**

## Connections

- Scheduled or manual collector → Collection endpoint: invokes (evidence: `README.md`)
- Collection endpoint → Collection processing: runs (evidence: `app/api/internal/collect-news/route.ts`)
- Collection processing → GNews API: queries (evidence: `README.md`)
- Collection processing → Normalize and deduplicate: normalizes and deduplicates (evidence: `README.md`)
- Collection processing → Relevance filtering: scores and filters (evidence: `README.md`)
- Collection processing → Optional AI enrichment: optionally enriches (evidence: `README.md`)
- Collection processing → Repository contract: inserts articles
- News reader → Home feed entry: opens
- Home feed entry → Feed browsing: renders (evidence: `app/page.tsx`)
- Articles API → Article validation: validates query (evidence: `app/api/articles/route.ts`)
- Articles API → Article access: lists articles (evidence: `app/api/articles/route.ts`)
- Article access → Repository contract: uses
- Repository contract → Local JSON store: implemented by (evidence: `lib/db/repository.ts`)
- Repository contract → Supabase store: implemented by (evidence: `lib/db/repository.ts`)
- Jobs board and detail → Live job catalog: loads listings (evidence: `components/jobs/JobsBoard.tsx`)
- Interview practice → Interview catalog: filters questions (evidence: `components/interviews/InterviewDirectory.tsx`)
- Interview practice → Saved resource state: reads saved practice (evidence: `components/interviews/InterviewDirectory.tsx`)
- Interview practice → Shared directory UI: renders controls (evidence: `components/interviews/InterviewDirectory.tsx`)
- Podcast directory → Podcast catalog: filters episodes (evidence: `components/podcasts/PodcastDirectory.tsx`)
- Podcast directory → Saved resource state: reads saved items (evidence: `components/podcasts/PodcastDirectory.tsx`)
- Podcast directory → Shared directory UI: renders controls (evidence: `components/podcasts/PodcastDirectory.tsx`)
- Tools directory → Tools catalog: uses catalog (evidence: `components/tools/ToolsDirectory.tsx`)
- Tools directory → Saved resource state: reads saved tools (evidence: `lib/hooks/useSavedResources.ts`)
- Tools directory → Shared directory UI: renders controls (evidence: `components/tools/ToolsDirectory.tsx`)
