# arpitbbhayani/the-daily-diff architecture

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

- Interactive diagram: https://gitdiagram.com/arpitbbhayani/the-daily-diff
- Repository: https://github.com/arpitbbhayani/the-daily-diff

## Overview

The Daily Diff is a static engineering-news newspaper. Readers browse curated daily editions and story metadata, then consume the same publication through the site or RSS/Markdown/JSON feeds. Edition data is defined and validated as an Astro content collection. The README documents themes and interest-score ranking; their exact rendering paths are present in the tree but were not sampled, so those links are documented at capability level. Several page implementations were not excerpted, so their internal calls are not inferred.

Main entry points: [`src/content/editions`](https://github.com/arpitbbhayani/the-daily-diff/tree/master/src/content/editions) (Daily editions), [`src/pages/[day].md.ts`](https://github.com/arpitbbhayani/the-daily-diff/blob/master/src/pages/%5Bday%5D.md.ts) (Markdown editions), [`src/pages/rss.xml.ts`](https://github.com/arpitbbhayani/the-daily-diff/blob/master/src/pages/rss.xml.ts) (RSS feed), [`src/pages/[day]/index.astro`](https://github.com/arpitbbhayani/the-daily-diff/blob/master/src/pages/%5Bday%5D/index.astro) (Daily edition)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_publication["Edition publication"]
  node_editions["Daily editions"]
  node_content_schema["Edition schema<br/>[content.config.ts]"]
  node_classification["Story classification"]
  node_site_metadata["Site metadata<br/>[config.ts]"]
end

subgraph group_reader["Reader experience"]
  node_homepage["Edition home<br/>[index.astro]"]
  node_edition_page["Daily edition<br/>[index.astro]"]
  node_edition_render["Edition renderer<br/>[EditionPage.astro]"]
  node_archive["Chronological archive<br/>[index.astro]"]
  node_theme["Theme controls"]
  node_layout["Page layout<br/>[Layout.astro]"]
  node_pwa_banner["Install banner"]
  node_service_worker["Network-only worker<br/>[sw.js]"]
end

subgraph group_distribution["Feeds and access"]
  node_markdown_feed["Markdown editions<br/>[&#91;day&#93;.md.ts]"]
  node_rss_feed["RSS feed<br/>[rss.xml.ts]"]
  node_json_feed["Latest JSON feed"]
  node_markdown_output["Latest Markdown feed"]
end

subgraph group_insights["Publication insights"]
  node_stats_page["Statistics dashboard<br/>[index.astro]"]
  node_stats_data["Statistics records<br/>[stats.jsonl]"]
  node_stats_aggregate["Stats aggregation<br/>[statsAggregate.ts]"]
end

node_visitor(("Reader"))

node_visitor -->|"browses"| node_homepage
node_visitor -->|"opens edition"| node_edition_page
node_visitor -->|"browses chronologically"| node_archive
node_editions -->|"validated as"| node_content_schema
node_edition_page -.->|"renders"| node_edition_render
node_visitor -->|"changes theme"| node_theme
node_visitor -->|"subscribes"| node_rss_feed
node_visitor -->|"reads Markdown"| node_markdown_feed
node_visitor -->|"reads JSON"| node_json_feed
node_editions -->|"provides edition data"| node_markdown_feed
node_markdown_feed -->|"uses metadata"| node_site_metadata
node_editions -->|"provides edition data"| node_rss_feed
node_rss_feed -->|"uses metadata"| node_site_metadata
node_stats_data -.->|"informs dashboard"| node_stats_page
node_stats_page -.->|"aggregates"| node_stats_aggregate
node_visitor -.->|"may install"| node_pwa_banner
node_pwa_banner -.->|"registers"| node_service_worker

click node_editions "https://github.com/arpitbbhayani/the-daily-diff/tree/master/src/content/editions"
click node_content_schema "https://github.com/arpitbbhayani/the-daily-diff/blob/master/src/content.config.ts"
click node_classification "https://github.com/arpitbbhayani/the-daily-diff/blob/master/src/lib/storyClassification.ts"
click node_site_metadata "https://github.com/arpitbbhayani/the-daily-diff/blob/master/src/config.ts"
click node_homepage "https://github.com/arpitbbhayani/the-daily-diff/blob/master/src/pages/index.astro"
click node_edition_page "https://github.com/arpitbbhayani/the-daily-diff/blob/master/src/pages/%5Bday%5D/index.astro"
click node_edition_render "https://github.com/arpitbbhayani/the-daily-diff/blob/master/src/components/EditionPage.astro"
click node_archive "https://github.com/arpitbbhayani/the-daily-diff/blob/master/src/pages/archive/index.astro"
click node_theme "https://github.com/arpitbbhayani/the-daily-diff/blob/master/src/components/ThemeToggleButton.astro"
click node_layout "https://github.com/arpitbbhayani/the-daily-diff/blob/master/src/layouts/Layout.astro"
click node_pwa_banner "https://github.com/arpitbbhayani/the-daily-diff/blob/master/src/components/PWAInstallBanner.astro"
click node_service_worker "https://github.com/arpitbbhayani/the-daily-diff/blob/master/public/sw.js"
click node_markdown_feed "https://github.com/arpitbbhayani/the-daily-diff/blob/master/src/pages/%5Bday%5D.md.ts"
click node_rss_feed "https://github.com/arpitbbhayani/the-daily-diff/blob/master/src/pages/rss.xml.ts"
click node_json_feed "https://github.com/arpitbbhayani/the-daily-diff/blob/master/public/json"
click node_markdown_output "https://github.com/arpitbbhayani/the-daily-diff/blob/master/public/md"
click node_stats_page "https://github.com/arpitbbhayani/the-daily-diff/blob/master/src/pages/stats/index.astro"
click node_stats_data "https://github.com/arpitbbhayani/the-daily-diff/blob/master/src/data/stats.jsonl"
click node_stats_aggregate "https://github.com/arpitbbhayani/the-daily-diff/blob/master/src/lib/statsAggregate.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_editions,node_content_schema,node_classification,node_site_metadata toneBlue
class node_homepage,node_edition_page,node_edition_render,node_archive,node_theme,node_layout,node_pwa_banner,node_service_worker toneAmber
class node_markdown_feed,node_rss_feed,node_json_feed,node_markdown_output toneMint
class node_stats_page,node_stats_data,node_stats_aggregate toneRose
class node_visitor toneIndigo
```

## Components

### Edition publication

- [Daily editions](https://github.com/arpitbbhayani/the-daily-diff/tree/master/src/content/editions): `src/content/editions`
- [Edition schema](https://github.com/arpitbbhayani/the-daily-diff/blob/master/src/content.config.ts): `src/content.config.ts`
- [Story classification](https://github.com/arpitbbhayani/the-daily-diff/blob/master/src/lib/storyClassification.ts): `src/lib/storyClassification.ts`
- [Site metadata](https://github.com/arpitbbhayani/the-daily-diff/blob/master/src/config.ts): `src/config.ts`

### Reader experience

- [Edition home](https://github.com/arpitbbhayani/the-daily-diff/blob/master/src/pages/index.astro): `src/pages/index.astro`
- [Daily edition](https://github.com/arpitbbhayani/the-daily-diff/blob/master/src/pages/%5Bday%5D/index.astro): `src/pages/[day]/index.astro`
- [Edition renderer](https://github.com/arpitbbhayani/the-daily-diff/blob/master/src/components/EditionPage.astro): `src/components/EditionPage.astro`
- [Chronological archive](https://github.com/arpitbbhayani/the-daily-diff/blob/master/src/pages/archive/index.astro): `src/pages/archive/index.astro`
- [Theme controls](https://github.com/arpitbbhayani/the-daily-diff/blob/master/src/components/ThemeToggleButton.astro): `src/components/ThemeToggleButton.astro`
- [Page layout](https://github.com/arpitbbhayani/the-daily-diff/blob/master/src/layouts/Layout.astro): `src/layouts/Layout.astro`
- [Install banner](https://github.com/arpitbbhayani/the-daily-diff/blob/master/src/components/PWAInstallBanner.astro): `src/components/PWAInstallBanner.astro`
- [Network-only worker](https://github.com/arpitbbhayani/the-daily-diff/blob/master/public/sw.js): `public/sw.js`

### Feeds and access

- [Markdown editions](https://github.com/arpitbbhayani/the-daily-diff/blob/master/src/pages/%5Bday%5D.md.ts): `src/pages/[day].md.ts`
- [RSS feed](https://github.com/arpitbbhayani/the-daily-diff/blob/master/src/pages/rss.xml.ts): `src/pages/rss.xml.ts`
- [Latest JSON feed](https://github.com/arpitbbhayani/the-daily-diff/blob/master/public/json): `public/json`
- [Latest Markdown feed](https://github.com/arpitbbhayani/the-daily-diff/blob/master/public/md): `public/md`

### Publication insights

- [Statistics dashboard](https://github.com/arpitbbhayani/the-daily-diff/blob/master/src/pages/stats/index.astro): `src/pages/stats/index.astro`
- [Statistics records](https://github.com/arpitbbhayani/the-daily-diff/blob/master/src/data/stats.jsonl): `src/data/stats.jsonl`
- [Stats aggregation](https://github.com/arpitbbhayani/the-daily-diff/blob/master/src/lib/statsAggregate.ts): `src/lib/statsAggregate.ts`

### Other components

- **Reader**

## Connections

- Reader → Edition home: browses (evidence: `README.md`)
- Reader → Daily edition: opens edition (evidence: `README.md`)
- Reader → Chronological archive: browses chronologically (evidence: `README.md`)
- Daily editions → Edition schema: validated as (evidence: `src/content.config.ts`)
- Daily edition → Edition renderer: renders
- Reader → Theme controls: changes theme (evidence: `README.md`)
- Reader → RSS feed: subscribes (evidence: `README.md`)
- Reader → Markdown editions: reads Markdown (evidence: `README.md`)
- Reader → Latest JSON feed: reads JSON (evidence: `README.md`)
- Daily editions → Markdown editions: provides edition data (evidence: `src/pages/[day].md.ts`)
- Markdown editions → Site metadata: uses metadata (evidence: `src/pages/[day].md.ts`)
- Daily editions → RSS feed: provides edition data (evidence: `src/pages/rss.xml.ts`)
- RSS feed → Site metadata: uses metadata (evidence: `src/pages/rss.xml.ts`)
- Statistics records → Statistics dashboard: informs dashboard
- Statistics dashboard → Stats aggregation: aggregates
- Reader → Install banner: may install
- Install banner → Network-only worker: registers
