# amirzenoozi/citation-graph architecture

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

- Interactive diagram: https://gitdiagram.com/amirzenoozi/citation-graph
- Repository: https://github.com/amirzenoozi/citation-graph

## Overview

CiteWeb is a browser-based citation-graph explorer. Users enter a paper DOI or author identifier, fetch and merge scholarly records into a graph, then expand papers, authors, or topics and inspect details. The graph view also supports recommendations, analysis, connection tracing, bibliography import, sharing, and export. The graph store coordinates data retrieval and graph updates; persistence is local to the browser. Edges are based on shown imports/calls or README statements; several feature implementations are unsampled, so their internal links are not expanded.

Main entry points: [`src/pages/GraphView.jsx`](https://github.com/amirzenoozi/citation-graph/blob/main/src/pages/GraphView.jsx) (Graph workspace), [`src/store.js`](https://github.com/amirzenoozi/citation-graph/blob/main/src/store.js) (Graph state and actions), [`src/api.js`](https://github.com/amirzenoozi/citation-graph/blob/main/src/api.js) (Scholarly data access), [`src/pages/Home.jsx`](https://github.com/amirzenoozi/citation-graph/blob/main/src/pages/Home.jsx) (DOI / author entry)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["User experience"]
  node_home["DOI / author entry<br/>[Home.jsx]"]
  node_router["App routing<br/>[App.jsx]"]
  node_graphview["Graph workspace<br/>[GraphView.jsx]"]
  node_canvas["Interactive graph canvas<br/>[Graph.jsx]"]
  node_theme["Theme controls<br/>[useTheme.js]"]
end

subgraph group_data["Graph and scholarly data"]
  node_store["Graph state and actions<br/>[store.js]"]
  node_inputs["Input classification<br/>[inputs.js]"]
  node_api["Scholarly data access<br/>[api.js]"]
end

subgraph group_explore["Analysis and discovery"]
  node_metrics["Graph metrics and paths<br/>[graphMetrics.js]"]
  node_import["Bibliography import<br/>[importRefs.js]"]
  node_analytics["Feature event tracking<br/>[analytics.js]"]
end

subgraph group_save["Persistence and export"]
  node_persist["Local and URL persistence<br/>[persist.js]"]
  node_citationexport["Citation-list export<br/>[exportCitations.js]"]
end

subgraph group_external["External services"]
  node_crossref["Crossref"]
  node_openalex["OpenAlex"]
  node_s2["Semantic Scholar"]
end

node_user(("Researcher"))

node_user -->|"enters identifier"| node_home
node_router -->|"routes to"| node_home
node_router -->|"routes to"| node_graphview
node_home -->|"starts graph"| node_store
node_graphview -->|"reads and updates"| node_store
node_graphview -->|"renders"| node_canvas
node_graphview -->|"uses theme"| node_theme
node_store -->|"classifies input"| node_inputs
node_store -->|"fetches graph data"| node_api
node_store -->|"loads and saves"| node_persist
node_store -->|"tracks events"| node_analytics
node_api -->|"fetches references"| node_crossref
node_api -->|"fetches records"| node_openalex
node_api -->|"fetches recommendations"| node_s2
node_graphview -->|"computes paths and insights"| node_metrics
node_graphview -->|"imports bibliography"| node_import
node_graphview -->|"exports shortlist"| node_citationexport
node_graphview -->|"encodes share recipe"| node_persist
node_canvas -->|"renders influence"| node_metrics
node_graphview -->|"tracks feature use"| node_analytics

click node_home "https://github.com/amirzenoozi/citation-graph/blob/main/src/pages/Home.jsx"
click node_router "https://github.com/amirzenoozi/citation-graph/blob/main/src/App.jsx"
click node_graphview "https://github.com/amirzenoozi/citation-graph/blob/main/src/pages/GraphView.jsx"
click node_canvas "https://github.com/amirzenoozi/citation-graph/blob/main/src/components/Graph.jsx"
click node_theme "https://github.com/amirzenoozi/citation-graph/blob/main/src/useTheme.js"
click node_store "https://github.com/amirzenoozi/citation-graph/blob/main/src/store.js"
click node_inputs "https://github.com/amirzenoozi/citation-graph/blob/main/src/inputs.js"
click node_api "https://github.com/amirzenoozi/citation-graph/blob/main/src/api.js"
click node_metrics "https://github.com/amirzenoozi/citation-graph/blob/main/src/graphMetrics.js"
click node_import "https://github.com/amirzenoozi/citation-graph/blob/main/src/importRefs.js"
click node_analytics "https://github.com/amirzenoozi/citation-graph/blob/main/src/analytics.js"
click node_persist "https://github.com/amirzenoozi/citation-graph/blob/main/src/persist.js"
click node_citationexport "https://github.com/amirzenoozi/citation-graph/blob/main/src/exportCitations.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_home,node_router,node_graphview,node_canvas,node_theme toneBlue
class node_store,node_inputs,node_api toneAmber
class node_metrics,node_import,node_analytics toneMint
class node_persist,node_citationexport toneRose
class node_crossref,node_openalex,node_s2,node_user toneIndigo
```

## Components

### User experience

- [DOI / author entry](https://github.com/amirzenoozi/citation-graph/blob/main/src/pages/Home.jsx): `src/pages/Home.jsx`
- [App routing](https://github.com/amirzenoozi/citation-graph/blob/main/src/App.jsx): `src/App.jsx`
- [Graph workspace](https://github.com/amirzenoozi/citation-graph/blob/main/src/pages/GraphView.jsx): `src/pages/GraphView.jsx`
- [Interactive graph canvas](https://github.com/amirzenoozi/citation-graph/blob/main/src/components/Graph.jsx): `src/components/Graph.jsx`
- [Theme controls](https://github.com/amirzenoozi/citation-graph/blob/main/src/useTheme.js): `src/useTheme.js`

### Graph and scholarly data

- [Graph state and actions](https://github.com/amirzenoozi/citation-graph/blob/main/src/store.js): `src/store.js`
- [Input classification](https://github.com/amirzenoozi/citation-graph/blob/main/src/inputs.js): `src/inputs.js`
- [Scholarly data access](https://github.com/amirzenoozi/citation-graph/blob/main/src/api.js): `src/api.js`

### Analysis and discovery

- [Graph metrics and paths](https://github.com/amirzenoozi/citation-graph/blob/main/src/graphMetrics.js): `src/graphMetrics.js`
- [Bibliography import](https://github.com/amirzenoozi/citation-graph/blob/main/src/importRefs.js): `src/importRefs.js`
- [Feature event tracking](https://github.com/amirzenoozi/citation-graph/blob/main/src/analytics.js): `src/analytics.js`

### Persistence and export

- [Local and URL persistence](https://github.com/amirzenoozi/citation-graph/blob/main/src/persist.js): `src/persist.js`
- [Citation-list export](https://github.com/amirzenoozi/citation-graph/blob/main/src/exportCitations.js): `src/exportCitations.js`

### External services

- **Crossref**
- **OpenAlex**
- **Semantic Scholar**

### Other components

- **Researcher**

## Connections

- Researcher → DOI / author entry: enters identifier (evidence: `src/pages/Home.jsx`)
- App routing → DOI / author entry: routes to (evidence: `src/App.jsx`)
- App routing → Graph workspace: routes to (evidence: `src/App.jsx`)
- DOI / author entry → Graph state and actions: starts graph (evidence: `src/pages/Home.jsx`)
- Graph workspace → Graph state and actions: reads and updates (evidence: `src/pages/GraphView.jsx`)
- Graph workspace → Interactive graph canvas: renders (evidence: `src/pages/GraphView.jsx`)
- Graph workspace → Theme controls: uses theme (evidence: `src/pages/GraphView.jsx`)
- Graph state and actions → Input classification: classifies input (evidence: `src/store.js`)
- Graph state and actions → Scholarly data access: fetches graph data (evidence: `src/store.js`)
- Graph state and actions → Local and URL persistence: loads and saves (evidence: `src/store.js`)
- Graph state and actions → Feature event tracking: tracks events (evidence: `src/store.js`)
- Scholarly data access → Crossref: fetches references (evidence: `README.md`)
- Scholarly data access → OpenAlex: fetches records (evidence: `README.md`)
- Scholarly data access → Semantic Scholar: fetches recommendations (evidence: `README.md`)
- Graph workspace → Graph metrics and paths: computes paths and insights (evidence: `src/pages/GraphView.jsx`)
- Graph workspace → Bibliography import: imports bibliography (evidence: `README.md`)
- Graph workspace → Citation-list export: exports shortlist (evidence: `src/pages/GraphView.jsx`)
- Graph workspace → Local and URL persistence: encodes share recipe (evidence: `src/pages/GraphView.jsx`)
- Interactive graph canvas → Graph metrics and paths: renders influence (evidence: `src/components/Graph.jsx`)
- Graph workspace → Feature event tracking: tracks feature use (evidence: `src/pages/GraphView.jsx`)
