# peaceful-world-x/arxivhub architecture

> Architecture diagram of the GitHub repository peaceful-world-x/arxivhub, 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/peaceful-world-x/arxivhub
- Repository: https://github.com/peaceful-world-x/arxivhub

## Overview

ArXivHub is a paper-discovery and navigation hub for the web and a browser userscript. The main web workflow accepts an arXiv identifier, normalizes it into a paper route, fetches paper metadata and TLDR content, and presents document links plus categorized external tools. The catalog, citation/metric integrations, personalization, and userscript are separate product capabilities. Source evidence is partial; unsampled implementation relationships are omitted rather than inferred.

Main entry points: [`web/src/routes/p.$id.tsx`](https://github.com/peaceful-world-x/arxivhub/blob/main/web/src/routes/p.%24id.tsx) (Paper view), [`web/src/router.tsx`](https://github.com/peaceful-world-x/arxivhub/blob/main/web/src/router.tsx) (Route dispatch), [`web/src/components/tool-card.tsx`](https://github.com/peaceful-world-x/arxivhub/blob/main/web/src/components/tool-card.tsx) (Tool cards), [`web/src/components/tool-grid.tsx`](https://github.com/peaceful-world-x/arxivhub/blob/main/web/src/components/tool-grid.tsx) (Tool grid)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web experience"]
  node_webapp["Web app entry<br/>[main.tsx]"]
  node_router["Route dispatch<br/>[router.tsx]"]
  node_home["Home search<br/>[index.tsx]"]
  node_search["ID search<br/>[search-bar.tsx]"]
  node_paperpage["Paper view<br/>[p.$id.tsx]"]
  node_catalogpage["Catalog view<br/>[catalog.tsx]"]
  node_about["About view<br/>[about.tsx]"]
  node_shell["Shared shell<br/>[shell.tsx]"]
end

subgraph group_paper["Paper services"]
  node_arxiv["arXiv metadata<br/>[arxiv.ts]"]
  node_tldr["TLDR retrieval<br/>[arxiv-tldr.ts]"]
  node_metrics[("Metric cache")]
  node_semantic["Semantic Scholar"]
  node_semanticpage["Citation detail"]
  node_alphaxiv["alphaXiv metrics<br/>[alphaxiv.ts]"]
  node_openalex["OpenAlex citations"]
end

subgraph group_catalog["Tool catalog"]
  node_toolgrid["Tool grid<br/>[tool-grid.tsx]"]
  node_toolcard["Tool cards<br/>[tool-card.tsx]"]
  node_sortable["Sortable card"]
  node_tooldata["Tool directory<br/>[tools.ts]"]
  node_navigation["Paper navigation"]
  node_preferences["User preferences<br/>[store.ts]"]
end

subgraph group_script["Browser script"]
  node_userscript["ArXiv browser script<br/>[ArXivHub.user.js]"]
end

node_reader(("Researcher"))
node_externaltools["External research tools"]

node_reader -->|"opens"| node_webapp
node_webapp -->|"starts"| node_router
node_router -->|"routes"| node_home
node_router -->|"routes"| node_paperpage
node_router -->|"routes"| node_catalogpage
node_router -->|"routes"| node_about
node_home -->|"renders"| node_search
node_search -->|"navigates"| node_paperpage
node_paperpage -->|"fetches paper"| node_arxiv
node_paperpage -->|"fetches summary"| node_tldr
node_paperpage -->|"builds links"| node_navigation
node_home -->|"renders"| node_toolgrid
node_paperpage -->|"renders"| node_toolgrid
node_toolgrid -->|"renders"| node_toolcard
node_toolgrid -->|"renders"| node_sortable
node_toolcard -->|"builds tool link"| node_tooldata
node_toolcard -->|"reads settings"| node_preferences
node_paperpage -->|"builds quick links"| node_tooldata
node_toolcard -->|"opens destination"| node_externaltools
node_paperpage -->|"renders"| node_shell
node_semanticpage -->|"uses service"| node_semantic
node_semantic -->|"caches metrics"| node_metrics
node_alphaxiv -->|"caches metrics"| node_metrics
node_openalex -->|"caches citations"| node_metrics
node_reader -->|"installs"| node_userscript
node_userscript -->|"adds paper links"| node_externaltools

click node_webapp "https://github.com/peaceful-world-x/arxivhub/blob/main/web/src/main.tsx"
click node_router "https://github.com/peaceful-world-x/arxivhub/blob/main/web/src/router.tsx"
click node_home "https://github.com/peaceful-world-x/arxivhub/blob/main/web/src/routes/index.tsx"
click node_search "https://github.com/peaceful-world-x/arxivhub/blob/main/web/src/components/search-bar.tsx"
click node_paperpage "https://github.com/peaceful-world-x/arxivhub/blob/main/web/src/routes/p.%24id.tsx"
click node_catalogpage "https://github.com/peaceful-world-x/arxivhub/blob/main/web/src/routes/catalog.tsx"
click node_about "https://github.com/peaceful-world-x/arxivhub/blob/main/web/src/routes/about.tsx"
click node_shell "https://github.com/peaceful-world-x/arxivhub/blob/main/web/src/components/shell.tsx"
click node_toolgrid "https://github.com/peaceful-world-x/arxivhub/blob/main/web/src/components/tool-grid.tsx"
click node_toolcard "https://github.com/peaceful-world-x/arxivhub/blob/main/web/src/components/tool-card.tsx"
click node_sortable "https://github.com/peaceful-world-x/arxivhub/blob/main/web/src/components/sortable-tool-card.tsx"
click node_tooldata "https://github.com/peaceful-world-x/arxivhub/blob/main/web/src/lib/tools.ts"
click node_navigation "https://github.com/peaceful-world-x/arxivhub/blob/main/web/src/lib/paper-navigation.ts"
click node_preferences "https://github.com/peaceful-world-x/arxivhub/blob/main/web/src/lib/store.ts"
click node_arxiv "https://github.com/peaceful-world-x/arxivhub/blob/main/web/src/lib/arxiv.ts"
click node_tldr "https://github.com/peaceful-world-x/arxivhub/blob/main/web/src/lib/arxiv-tldr.ts"
click node_metrics "https://github.com/peaceful-world-x/arxivhub/blob/main/web/src/lib/paper-metric-cache.ts"
click node_semantic "https://github.com/peaceful-world-x/arxivhub/blob/main/web/src/lib/semantic-scholar.ts"
click node_semanticpage "https://github.com/peaceful-world-x/arxivhub/blob/main/web/src/lib/semantic-scholar-page.ts"
click node_alphaxiv "https://github.com/peaceful-world-x/arxivhub/blob/main/web/src/lib/alphaxiv.ts"
click node_openalex "https://github.com/peaceful-world-x/arxivhub/blob/main/web/src/lib/openalex-citations.ts"
click node_userscript "https://github.com/peaceful-world-x/arxivhub/blob/main/ArXivHub.user.js"

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_webapp,node_router,node_home,node_search,node_paperpage,node_catalogpage,node_about,node_shell toneBlue
class node_arxiv,node_tldr,node_metrics,node_semantic,node_semanticpage,node_alphaxiv,node_openalex toneAmber
class node_toolgrid,node_toolcard,node_sortable,node_tooldata,node_navigation,node_preferences toneMint
class node_userscript toneRose
class node_reader,node_externaltools toneIndigo
```

## Components

### Web experience

- [Web app entry](https://github.com/peaceful-world-x/arxivhub/blob/main/web/src/main.tsx): `web/src/main.tsx`
- [Route dispatch](https://github.com/peaceful-world-x/arxivhub/blob/main/web/src/router.tsx): `web/src/router.tsx`
- [Home search](https://github.com/peaceful-world-x/arxivhub/blob/main/web/src/routes/index.tsx): `web/src/routes/index.tsx`
- [ID search](https://github.com/peaceful-world-x/arxivhub/blob/main/web/src/components/search-bar.tsx): `web/src/components/search-bar.tsx`
- [Paper view](https://github.com/peaceful-world-x/arxivhub/blob/main/web/src/routes/p.%24id.tsx): `web/src/routes/p.$id.tsx`
- [Catalog view](https://github.com/peaceful-world-x/arxivhub/blob/main/web/src/routes/catalog.tsx): `web/src/routes/catalog.tsx`
- [About view](https://github.com/peaceful-world-x/arxivhub/blob/main/web/src/routes/about.tsx): `web/src/routes/about.tsx`
- [Shared shell](https://github.com/peaceful-world-x/arxivhub/blob/main/web/src/components/shell.tsx): `web/src/components/shell.tsx`

### Paper services

- [arXiv metadata](https://github.com/peaceful-world-x/arxivhub/blob/main/web/src/lib/arxiv.ts): `web/src/lib/arxiv.ts`
- [TLDR retrieval](https://github.com/peaceful-world-x/arxivhub/blob/main/web/src/lib/arxiv-tldr.ts): `web/src/lib/arxiv-tldr.ts`
- [Metric cache](https://github.com/peaceful-world-x/arxivhub/blob/main/web/src/lib/paper-metric-cache.ts): `web/src/lib/paper-metric-cache.ts`
- [Semantic Scholar](https://github.com/peaceful-world-x/arxivhub/blob/main/web/src/lib/semantic-scholar.ts): `web/src/lib/semantic-scholar.ts`
- [Citation detail](https://github.com/peaceful-world-x/arxivhub/blob/main/web/src/lib/semantic-scholar-page.ts): `web/src/lib/semantic-scholar-page.ts`
- [alphaXiv metrics](https://github.com/peaceful-world-x/arxivhub/blob/main/web/src/lib/alphaxiv.ts): `web/src/lib/alphaxiv.ts`
- [OpenAlex citations](https://github.com/peaceful-world-x/arxivhub/blob/main/web/src/lib/openalex-citations.ts): `web/src/lib/openalex-citations.ts`

### Tool catalog

- [Tool grid](https://github.com/peaceful-world-x/arxivhub/blob/main/web/src/components/tool-grid.tsx): `web/src/components/tool-grid.tsx`
- [Tool cards](https://github.com/peaceful-world-x/arxivhub/blob/main/web/src/components/tool-card.tsx): `web/src/components/tool-card.tsx`
- [Sortable card](https://github.com/peaceful-world-x/arxivhub/blob/main/web/src/components/sortable-tool-card.tsx): `web/src/components/sortable-tool-card.tsx`
- [Tool directory](https://github.com/peaceful-world-x/arxivhub/blob/main/web/src/lib/tools.ts): `web/src/lib/tools.ts`
- [Paper navigation](https://github.com/peaceful-world-x/arxivhub/blob/main/web/src/lib/paper-navigation.ts): `web/src/lib/paper-navigation.ts`
- [User preferences](https://github.com/peaceful-world-x/arxivhub/blob/main/web/src/lib/store.ts): `web/src/lib/store.ts`

### Browser script

- [ArXiv browser script](https://github.com/peaceful-world-x/arxivhub/blob/main/ArXivHub.user.js): `ArXivHub.user.js`

### Other components

- **Researcher**
- **External research tools**

## Connections

- Researcher → Web app entry: opens
- Web app entry → Route dispatch: starts (evidence: `web/src/main.tsx`)
- Route dispatch → Home search: routes (evidence: `web/src/routeTree.gen.ts`)
- Route dispatch → Paper view: routes (evidence: `web/src/routeTree.gen.ts`)
- Route dispatch → Catalog view: routes (evidence: `web/src/routeTree.gen.ts`)
- Route dispatch → About view: routes (evidence: `web/src/routeTree.gen.ts`)
- Home search → ID search: renders (evidence: `web/src/routes/index.tsx`)
- ID search → Paper view: navigates (evidence: `web/src/components/search-bar.tsx`)
- Paper view → arXiv metadata: fetches paper (evidence: `web/src/routes/p.$id.tsx`)
- Paper view → TLDR retrieval: fetches summary (evidence: `web/src/routes/p.$id.tsx`)
- Paper view → Paper navigation: builds links (evidence: `web/src/routes/p.$id.tsx`)
- Home search → Tool grid: renders (evidence: `web/src/routes/index.tsx`)
- Paper view → Tool grid: renders (evidence: `web/src/routes/p.$id.tsx`)
- Tool grid → Tool cards: renders (evidence: `web/src/components/tool-grid.tsx`)
- Tool grid → Sortable card: renders (evidence: `web/src/components/tool-grid.tsx`)
- Tool cards → Tool directory: builds tool link (evidence: `web/src/components/tool-card.tsx`)
- Tool cards → User preferences: reads settings (evidence: `web/src/components/tool-card.tsx`)
- Paper view → Tool directory: builds quick links (evidence: `web/src/routes/p.$id.tsx`)
- Tool cards → External research tools: opens destination (evidence: `web/src/components/tool-card.tsx`)
- Paper view → Shared shell: renders (evidence: `web/src/routes/p.$id.tsx`)
- Citation detail → Semantic Scholar: uses service (evidence: `web/src/lib/semantic-scholar-page.ts`)
- Semantic Scholar → Metric cache: caches metrics (evidence: `web/src/lib/semantic-scholar.ts`)
- alphaXiv metrics → Metric cache: caches metrics (evidence: `web/src/lib/alphaxiv.ts`)
- OpenAlex citations → Metric cache: caches citations (evidence: `web/src/lib/openalex-citations.ts`)
- Researcher → ArXiv browser script: installs
- ArXiv browser script → External research tools: adds paper links
