# rishikesh-193/personalized-news-paper-and-research-digestion architecture

> Architecture diagram of the GitHub repository rishikesh-193/personalized-news-paper-and-research-digestion, 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/rishikesh-193/personalized-news-paper-and-research-digestion
- Repository: https://github.com/rishikesh-193/personalized-news-paper-and-research-digestion

## Overview

Chronicle is a personalized news and research briefing app. Users authenticate, set interests, read a ranked Today briefing, save content to a Library, upload PDFs for research digests and comparisons, discover papers and web results, and ask citation-grounded questions over saved material. The graph preserves these distinct workflows and the scheduled ingestion pipeline. Some UI-to-route wiring and unsampled implementation details are only documented at the product level, so those relationships cite the README rather than implying inspected source calls.

Main entry points: [`src/lib/supabase/server.ts`](https://github.com/rishikesh-193/personalized-news-paper-and-research-digestion/blob/main/src/lib/supabase/server.ts) (Supabase data and auth), [`scripts/ingest/index.ts`](https://github.com/rishikesh-193/personalized-news-paper-and-research-digestion/blob/main/scripts/ingest/index.ts) (Ingestion coordinator), [`src/app/api/ask/route.ts`](https://github.com/rishikesh-193/personalized-news-paper-and-research-digestion/blob/main/src/app/api/ask/route.ts) (Ask answers), [`src/app/api/research/digest/route.ts`](https://github.com/rishikesh-193/personalized-news-paper-and-research-digestion/blob/main/src/app/api/research/digest/route.ts) (PDF digest and indexing)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Reader experience"]
  node_today["Today briefing<br/>[page.tsx]"]
  node_library["Saved Library<br/>[page.tsx]"]
  node_articleactions["Article actions<br/>[article-actions.ts]"]
end

subgraph group_research["Research workflows"]
  node_ask["Ask answers<br/>[route.ts]"]
  node_askcore["Retrieval and citations<br/>[ask-core.ts]"]
  node_researchui["Research Lab<br/>[research-view.tsx]"]
  node_digest["PDF digest and indexing<br/>[route.ts]"]
  node_compare["Document comparison<br/>[route.ts]"]
  node_discoverui["Discovery interface<br/>[discover-view.tsx]"]
  node_search["Paper and web search<br/>[route.ts]"]
  node_brief["Research brief<br/>[route.ts]"]
end

subgraph group_ingestion["News ingestion"]
  node_ingest["Ingestion coordinator<br/>[index.ts]"]
  node_feeds["Feed registry and fetch<br/>[feeds.ts]"]
  node_allocation["Fair allocation<br/>[allocate.ts]"]
  node_classification["Topic classification<br/>[classify.ts]"]
  node_summaries["Validated summaries<br/>[groq.ts]"]
end

subgraph group_services["Shared services"]
  node_embeddings["Local embeddings<br/>[embeddings.ts]"]
  node_supabase[("Supabase data and auth<br/>[server.ts]")]
end

subgraph group_identity["Identity and access"]
  node_auth["Sign-in and onboarding<br/>[route.ts]"]
  node_interests["Interest preferences"]
end

node_reader(("Reader"))
node_groq{{"Groq model API"}}
node_arxiv{{"arXiv API"}}
node_tavily{{"Tavily search"}}

node_reader -->|"signs in"| node_auth
node_auth -->|"verifies identity"| node_supabase
node_reader -->|"sets interests"| node_interests
node_reader -->|"reads briefing"| node_today
node_today -->|"loads feed"| node_supabase
node_reader -->|"saves reading"| node_library
node_library -.->|"manages articles"| node_articleactions
node_reader -->|"asks question"| node_ask
node_ask -->|"retrieves chunks"| node_supabase
node_ask -->|"embeds query"| node_embeddings
node_ask -->|"ranks and audits"| node_askcore
node_ask -->|"generates answer"| node_groq
node_reader -->|"opens Research Lab"| node_researchui
node_researchui -->|"uploads PDF"| node_digest
node_digest -->|"stores document"| node_supabase
node_digest -->|"embeds chunks"| node_embeddings
node_digest -->|"creates digest"| node_groq
node_researchui -->|"requests comparison"| node_compare
node_compare -->|"compares documents"| node_groq
node_reader -->|"discovers sources"| node_discoverui
node_discoverui -->|"submits search"| node_search
node_search -->|"searches papers"| node_arxiv
node_search -.->|"searches web"| node_tavily
node_search -->|"caches results"| node_supabase
node_discoverui -->|"requests brief"| node_brief
node_brief -->|"writes brief"| node_groq
node_brief -->|"loads and caches"| node_supabase
node_ingest -->|"fetches sources"| node_feeds
node_ingest -->|"allocates candidates"| node_allocation
node_ingest -->|"assigns topics"| node_classification
node_ingest -->|"generates summaries"| node_summaries
node_summaries -->|"calls model"| node_groq
node_ingest -->|"stores articles"| node_supabase

click node_auth "https://github.com/rishikesh-193/personalized-news-paper-and-research-digestion/blob/main/src/app/auth/callback/route.ts"
click node_interests "https://github.com/rishikesh-193/personalized-news-paper-and-research-digestion/blob/main/src/lib/interests-actions.ts"
click node_today "https://github.com/rishikesh-193/personalized-news-paper-and-research-digestion/blob/main/src/app/(app)/today/page.tsx"
click node_library "https://github.com/rishikesh-193/personalized-news-paper-and-research-digestion/blob/main/src/app/(app)/library/page.tsx"
click node_articleactions "https://github.com/rishikesh-193/personalized-news-paper-and-research-digestion/blob/main/src/lib/article-actions.ts"
click node_ask "https://github.com/rishikesh-193/personalized-news-paper-and-research-digestion/blob/main/src/app/api/ask/route.ts"
click node_askcore "https://github.com/rishikesh-193/personalized-news-paper-and-research-digestion/blob/main/src/lib/ask-core.ts"
click node_researchui "https://github.com/rishikesh-193/personalized-news-paper-and-research-digestion/blob/main/src/components/views/research-view.tsx"
click node_digest "https://github.com/rishikesh-193/personalized-news-paper-and-research-digestion/blob/main/src/app/api/research/digest/route.ts"
click node_compare "https://github.com/rishikesh-193/personalized-news-paper-and-research-digestion/blob/main/src/app/api/research/compare/route.ts"
click node_discoverui "https://github.com/rishikesh-193/personalized-news-paper-and-research-digestion/blob/main/src/components/views/discover-view.tsx"
click node_search "https://github.com/rishikesh-193/personalized-news-paper-and-research-digestion/blob/main/src/app/api/research/discover/search/route.ts"
click node_brief "https://github.com/rishikesh-193/personalized-news-paper-and-research-digestion/blob/main/src/app/api/research/discover/brief/route.ts"
click node_ingest "https://github.com/rishikesh-193/personalized-news-paper-and-research-digestion/blob/main/scripts/ingest/index.ts"
click node_feeds "https://github.com/rishikesh-193/personalized-news-paper-and-research-digestion/blob/main/scripts/ingest/feeds.ts"
click node_allocation "https://github.com/rishikesh-193/personalized-news-paper-and-research-digestion/blob/main/scripts/ingest/allocate.ts"
click node_classification "https://github.com/rishikesh-193/personalized-news-paper-and-research-digestion/blob/main/scripts/ingest/classify.ts"
click node_summaries "https://github.com/rishikesh-193/personalized-news-paper-and-research-digestion/blob/main/scripts/ingest/groq.ts"
click node_embeddings "https://github.com/rishikesh-193/personalized-news-paper-and-research-digestion/blob/main/src/lib/embeddings.ts"
click node_supabase "https://github.com/rishikesh-193/personalized-news-paper-and-research-digestion/blob/main/src/lib/supabase/server.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_today,node_library,node_articleactions toneBlue
class node_ask,node_askcore,node_researchui,node_digest,node_compare,node_discoverui,node_search,node_brief toneAmber
class node_ingest,node_feeds,node_allocation,node_classification,node_summaries,node_groq,node_arxiv toneMint
class node_embeddings,node_supabase toneRose
class node_auth,node_interests,node_reader,node_tavily toneIndigo
```

## Components

### Reader experience

- [Today briefing](https://github.com/rishikesh-193/personalized-news-paper-and-research-digestion/blob/main/src/app/(app)/today/page.tsx): `src/app/(app)/today/page.tsx`
- [Saved Library](https://github.com/rishikesh-193/personalized-news-paper-and-research-digestion/blob/main/src/app/(app)/library/page.tsx): `src/app/(app)/library/page.tsx`
- [Article actions](https://github.com/rishikesh-193/personalized-news-paper-and-research-digestion/blob/main/src/lib/article-actions.ts): `src/lib/article-actions.ts`

### Research workflows

- [Ask answers](https://github.com/rishikesh-193/personalized-news-paper-and-research-digestion/blob/main/src/app/api/ask/route.ts): `src/app/api/ask/route.ts`
- [Retrieval and citations](https://github.com/rishikesh-193/personalized-news-paper-and-research-digestion/blob/main/src/lib/ask-core.ts): `src/lib/ask-core.ts`
- [Research Lab](https://github.com/rishikesh-193/personalized-news-paper-and-research-digestion/blob/main/src/components/views/research-view.tsx): `src/components/views/research-view.tsx`
- [PDF digest and indexing](https://github.com/rishikesh-193/personalized-news-paper-and-research-digestion/blob/main/src/app/api/research/digest/route.ts): `src/app/api/research/digest/route.ts`
- [Document comparison](https://github.com/rishikesh-193/personalized-news-paper-and-research-digestion/blob/main/src/app/api/research/compare/route.ts): `src/app/api/research/compare/route.ts`
- [Discovery interface](https://github.com/rishikesh-193/personalized-news-paper-and-research-digestion/blob/main/src/components/views/discover-view.tsx): `src/components/views/discover-view.tsx`
- [Paper and web search](https://github.com/rishikesh-193/personalized-news-paper-and-research-digestion/blob/main/src/app/api/research/discover/search/route.ts): `src/app/api/research/discover/search/route.ts`
- [Research brief](https://github.com/rishikesh-193/personalized-news-paper-and-research-digestion/blob/main/src/app/api/research/discover/brief/route.ts): `src/app/api/research/discover/brief/route.ts`

### News ingestion

- [Ingestion coordinator](https://github.com/rishikesh-193/personalized-news-paper-and-research-digestion/blob/main/scripts/ingest/index.ts): `scripts/ingest/index.ts`
- [Feed registry and fetch](https://github.com/rishikesh-193/personalized-news-paper-and-research-digestion/blob/main/scripts/ingest/feeds.ts): `scripts/ingest/feeds.ts`
- [Fair allocation](https://github.com/rishikesh-193/personalized-news-paper-and-research-digestion/blob/main/scripts/ingest/allocate.ts): `scripts/ingest/allocate.ts`
- [Topic classification](https://github.com/rishikesh-193/personalized-news-paper-and-research-digestion/blob/main/scripts/ingest/classify.ts): `scripts/ingest/classify.ts`
- [Validated summaries](https://github.com/rishikesh-193/personalized-news-paper-and-research-digestion/blob/main/scripts/ingest/groq.ts): `scripts/ingest/groq.ts`

### Shared services

- [Local embeddings](https://github.com/rishikesh-193/personalized-news-paper-and-research-digestion/blob/main/src/lib/embeddings.ts): `src/lib/embeddings.ts`
- [Supabase data and auth](https://github.com/rishikesh-193/personalized-news-paper-and-research-digestion/blob/main/src/lib/supabase/server.ts): `src/lib/supabase/server.ts`

### Identity and access

- [Sign-in and onboarding](https://github.com/rishikesh-193/personalized-news-paper-and-research-digestion/blob/main/src/app/auth/callback/route.ts): `src/app/auth/callback/route.ts`
- [Interest preferences](https://github.com/rishikesh-193/personalized-news-paper-and-research-digestion/blob/main/src/lib/interests-actions.ts): `src/lib/interests-actions.ts`

### Other components

- **Reader**
- **Groq model API**
- **arXiv API**
- **Tavily search**

## Connections

- Reader → Sign-in and onboarding: signs in (evidence: `README.md`)
- Sign-in and onboarding → Supabase data and auth: verifies identity (evidence: `src/app/auth/callback/route.ts`)
- Reader → Interest preferences: sets interests (evidence: `README.md`)
- Reader → Today briefing: reads briefing (evidence: `README.md`)
- Today briefing → Supabase data and auth: loads feed (evidence: `src/app/(app)/today/page.tsx`)
- Reader → Saved Library: saves reading (evidence: `README.md`)
- Saved Library → Article actions: manages articles
- Reader → Ask answers: asks question (evidence: `README.md`)
- Ask answers → Supabase data and auth: retrieves chunks (evidence: `src/app/api/ask/route.ts`)
- Ask answers → Local embeddings: embeds query (evidence: `src/app/api/ask/route.ts`)
- Ask answers → Retrieval and citations: ranks and audits (evidence: `src/app/api/ask/route.ts`)
- Ask answers → Groq model API: generates answer (evidence: `README.md`)
- Reader → Research Lab: opens Research Lab (evidence: `README.md`)
- Research Lab → PDF digest and indexing: uploads PDF (evidence: `README.md`)
- PDF digest and indexing → Supabase data and auth: stores document (evidence: `src/app/api/research/digest/route.ts`)
- PDF digest and indexing → Local embeddings: embeds chunks (evidence: `src/app/api/research/digest/route.ts`)
- PDF digest and indexing → Groq model API: creates digest (evidence: `src/app/api/research/digest/route.ts`)
- Research Lab → Document comparison: requests comparison (evidence: `README.md`)
- Document comparison → Groq model API: compares documents (evidence: `src/app/api/research/compare/route.ts`)
- Reader → Discovery interface: discovers sources (evidence: `README.md`)
- Discovery interface → Paper and web search: submits search (evidence: `README.md`)
- Paper and web search → arXiv API: searches papers (evidence: `src/app/api/research/discover/search/route.ts`)
- Paper and web search → Tavily search: searches web (evidence: `README.md`)
- Paper and web search → Supabase data and auth: caches results (evidence: `src/app/api/research/discover/search/route.ts`)
- Discovery interface → Research brief: requests brief (evidence: `README.md`)
- Research brief → Groq model API: writes brief (evidence: `README.md`)
- Research brief → Supabase data and auth: loads and caches (evidence: `src/app/api/research/discover/brief/route.ts`)
- Ingestion coordinator → Feed registry and fetch: fetches sources (evidence: `scripts/ingest/index.ts`)
- Ingestion coordinator → Fair allocation: allocates candidates (evidence: `scripts/ingest/index.ts`)
- Ingestion coordinator → Topic classification: assigns topics (evidence: `scripts/ingest/index.ts`)
- Ingestion coordinator → Validated summaries: generates summaries (evidence: `scripts/ingest/index.ts`)
- Validated summaries → Groq model API: calls model (evidence: `README.md`)
- Ingestion coordinator → Supabase data and auth: stores articles (evidence: `README.md`)
