# bxshcn/analects-workbench architecture

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

- Interactive diagram: https://gitdiagram.com/bxshcn/analects-workbench
- Repository: https://github.com/bxshcn/analects-workbench

## Overview

This is an interactive Analects knowledge-graph workspace. Readers explore person relationships in a chord diagram, navigate concepts and relations through indexes, and inspect linked verses with glosses and commentary. The app coordinates graph, detail, co-occurrence, and verse data through a shared store; history and URL deep links preserve exploration state. The graph highlights documented component calls and data-loading relationships. Some capabilities are identified from the README and source index, while their detailed implementations were not sampled.

Main entry points: [`src/store/analectsStore.ts`](https://github.com/bxshcn/analects-workbench/blob/main/src/store/analectsStore.ts) (Analects Store), [`src/App.tsx`](https://github.com/bxshcn/analects-workbench/blob/main/src/App.tsx) (App Shell), [`src/components/BottomPanel.tsx`](https://github.com/bxshcn/analects-workbench/blob/main/src/components/BottomPanel.tsx) (Bottom Panel), [`src/components/RelationIndex.tsx`](https://github.com/bxshcn/analects-workbench/blob/main/src/components/RelationIndex.tsx) (Relation Index)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Workspace"]
  node_app_shell["App Shell<br/>[App.tsx]"]
  node_tabs["Top Tabs<br/>[TopTabs.tsx]"]
  node_bottom_panel["Bottom Panel<br/>[BottomPanel.tsx]"]
end

subgraph group_explore["Graph Exploration"]
  node_chord["Person Chord<br/>[PersonChordTab.tsx]"]
  node_chord_layout["Chord Layout<br/>[chord.ts]"]
  node_history["History Bar<br/>[HistoryBar.tsx]"]
end

subgraph group_research["Indexes and Reading"]
  node_relation_index["Relation Index<br/>[RelationIndex.tsx]"]
  node_index_groups["Index Groups<br/>[IndexGroups.tsx]"]
  node_fulltext["Full Text Index<br/>[FullTextIndex.tsx]"]
  node_profile["Node Profile<br/>[NodeProfile.tsx]"]
  node_verse_research["Verse Research<br/>[VerseResearch.tsx]"]
  node_verse_card["Verse Card<br/>[VerseCard.tsx]"]
end

subgraph group_core["State and Logic"]
  node_deep_links["Deep Links<br/>[useDeepLink.ts]"]
  node_store["Analects Store<br/>[analectsStore.ts]"]
  node_api["JSON Fetcher<br/>[api.ts]"]
  node_graph_logic["Graph Logic<br/>[graph.ts]"]
  node_data_model["Data Model<br/>[data.ts]"]
end

node_reader(("Reader"))
node_data_packages["JSON Data Packages"]

node_reader -->|"opens"| node_app_shell
node_app_shell -->|"renders"| node_tabs
node_app_shell -->|"renders"| node_chord
node_app_shell -->|"renders"| node_bottom_panel
node_app_shell -->|"reads state"| node_store
node_app_shell -->|"registers"| node_deep_links
node_tabs -->|"updates tabs"| node_store
node_bottom_panel -->|"renders"| node_history
node_bottom_panel -->|"renders"| node_profile
node_bottom_panel -->|"renders"| node_relation_index
node_bottom_panel -->|"renders"| node_verse_research
node_bottom_panel -->|"renders"| node_fulltext
node_chord -->|"computes layout"| node_chord_layout
node_chord -->|"reads state"| node_store
node_relation_index -->|"renders"| node_index_groups
node_relation_index -->|"reads state"| node_store
node_relation_index -->|"groups relations"| node_graph_logic
node_fulltext -->|"reads state"| node_store
node_profile -->|"reads state"| node_store
node_history -->|"updates history"| node_store
node_history -->|"uses graph logic"| node_graph_logic
node_verse_research -->|"renders"| node_verse_card
node_verse_research -->|"reads verses"| node_store
node_deep_links -->|"applies state"| node_store
node_deep_links -->|"resolves links"| node_graph_logic
node_store -->|"fetches data"| node_api
node_store -->|"loads JSON"| node_data_packages
node_store -->|"computes nodes"| node_graph_logic

click node_app_shell "https://github.com/bxshcn/analects-workbench/blob/main/src/App.tsx"
click node_tabs "https://github.com/bxshcn/analects-workbench/blob/main/src/components/TopTabs.tsx"
click node_bottom_panel "https://github.com/bxshcn/analects-workbench/blob/main/src/components/BottomPanel.tsx"
click node_chord "https://github.com/bxshcn/analects-workbench/blob/main/src/components/PersonChordTab.tsx"
click node_chord_layout "https://github.com/bxshcn/analects-workbench/blob/main/src/lib/chord.ts"
click node_relation_index "https://github.com/bxshcn/analects-workbench/blob/main/src/components/RelationIndex.tsx"
click node_index_groups "https://github.com/bxshcn/analects-workbench/blob/main/src/components/IndexGroups.tsx"
click node_fulltext "https://github.com/bxshcn/analects-workbench/blob/main/src/components/FullTextIndex.tsx"
click node_profile "https://github.com/bxshcn/analects-workbench/blob/main/src/components/NodeProfile.tsx"
click node_verse_research "https://github.com/bxshcn/analects-workbench/blob/main/src/components/VerseResearch.tsx"
click node_verse_card "https://github.com/bxshcn/analects-workbench/blob/main/src/components/VerseCard.tsx"
click node_history "https://github.com/bxshcn/analects-workbench/blob/main/src/components/HistoryBar.tsx"
click node_deep_links "https://github.com/bxshcn/analects-workbench/blob/main/src/hooks/useDeepLink.ts"
click node_store "https://github.com/bxshcn/analects-workbench/blob/main/src/store/analectsStore.ts"
click node_api "https://github.com/bxshcn/analects-workbench/blob/main/src/lib/api.ts"
click node_graph_logic "https://github.com/bxshcn/analects-workbench/blob/main/src/lib/graph.ts"
click node_data_model "https://github.com/bxshcn/analects-workbench/blob/main/src/types/data.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_app_shell,node_tabs,node_bottom_panel toneBlue
class node_chord,node_chord_layout,node_history toneAmber
class node_relation_index,node_index_groups,node_fulltext,node_profile,node_verse_research,node_verse_card toneMint
class node_deep_links,node_store,node_api,node_graph_logic,node_data_model toneRose
class node_reader,node_data_packages toneIndigo
```

## Components

### Workspace

- [App Shell](https://github.com/bxshcn/analects-workbench/blob/main/src/App.tsx): `src/App.tsx`
- [Top Tabs](https://github.com/bxshcn/analects-workbench/blob/main/src/components/TopTabs.tsx): `src/components/TopTabs.tsx`
- [Bottom Panel](https://github.com/bxshcn/analects-workbench/blob/main/src/components/BottomPanel.tsx): `src/components/BottomPanel.tsx`

### Graph Exploration

- [Person Chord](https://github.com/bxshcn/analects-workbench/blob/main/src/components/PersonChordTab.tsx): `src/components/PersonChordTab.tsx`
- [Chord Layout](https://github.com/bxshcn/analects-workbench/blob/main/src/lib/chord.ts): `src/lib/chord.ts`
- [History Bar](https://github.com/bxshcn/analects-workbench/blob/main/src/components/HistoryBar.tsx): `src/components/HistoryBar.tsx`

### Indexes and Reading

- [Relation Index](https://github.com/bxshcn/analects-workbench/blob/main/src/components/RelationIndex.tsx): `src/components/RelationIndex.tsx`
- [Index Groups](https://github.com/bxshcn/analects-workbench/blob/main/src/components/IndexGroups.tsx): `src/components/IndexGroups.tsx`
- [Full Text Index](https://github.com/bxshcn/analects-workbench/blob/main/src/components/FullTextIndex.tsx): `src/components/FullTextIndex.tsx`
- [Node Profile](https://github.com/bxshcn/analects-workbench/blob/main/src/components/NodeProfile.tsx): `src/components/NodeProfile.tsx`
- [Verse Research](https://github.com/bxshcn/analects-workbench/blob/main/src/components/VerseResearch.tsx): `src/components/VerseResearch.tsx`
- [Verse Card](https://github.com/bxshcn/analects-workbench/blob/main/src/components/VerseCard.tsx): `src/components/VerseCard.tsx`

### State and Logic

- [Deep Links](https://github.com/bxshcn/analects-workbench/blob/main/src/hooks/useDeepLink.ts): `src/hooks/useDeepLink.ts`
- [Analects Store](https://github.com/bxshcn/analects-workbench/blob/main/src/store/analectsStore.ts): `src/store/analectsStore.ts`
- [JSON Fetcher](https://github.com/bxshcn/analects-workbench/blob/main/src/lib/api.ts): `src/lib/api.ts`
- [Graph Logic](https://github.com/bxshcn/analects-workbench/blob/main/src/lib/graph.ts): `src/lib/graph.ts`
- [Data Model](https://github.com/bxshcn/analects-workbench/blob/main/src/types/data.ts): `src/types/data.ts`

### Other components

- **Reader**
- **JSON Data Packages**

## Connections

- Reader → App Shell: opens (evidence: `src/App.tsx`)
- App Shell → Top Tabs: renders (evidence: `src/App.tsx`)
- App Shell → Person Chord: renders (evidence: `src/App.tsx`)
- App Shell → Bottom Panel: renders (evidence: `src/App.tsx`)
- App Shell → Analects Store: reads state (evidence: `src/App.tsx`)
- App Shell → Deep Links: registers (evidence: `src/App.tsx`)
- Top Tabs → Analects Store: updates tabs (evidence: `src/components/TopTabs.tsx`)
- Bottom Panel → History Bar: renders (evidence: `src/components/BottomPanel.tsx`)
- Bottom Panel → Node Profile: renders (evidence: `src/components/BottomPanel.tsx`)
- Bottom Panel → Relation Index: renders (evidence: `src/components/BottomPanel.tsx`)
- Bottom Panel → Verse Research: renders (evidence: `src/components/BottomPanel.tsx`)
- Bottom Panel → Full Text Index: renders (evidence: `src/components/BottomPanel.tsx`)
- Person Chord → Chord Layout: computes layout (evidence: `src/components/PersonChordTab.tsx`)
- Person Chord → Analects Store: reads state (evidence: `src/components/PersonChordTab.tsx`)
- Relation Index → Index Groups: renders (evidence: `src/components/RelationIndex.tsx`)
- Relation Index → Analects Store: reads state (evidence: `src/components/RelationIndex.tsx`)
- Relation Index → Graph Logic: groups relations (evidence: `src/components/RelationIndex.tsx`)
- Full Text Index → Analects Store: reads state (evidence: `src/components/FullTextIndex.tsx`)
- Node Profile → Analects Store: reads state (evidence: `src/components/NodeProfile.tsx`)
- History Bar → Analects Store: updates history (evidence: `src/components/HistoryBar.tsx`)
- History Bar → Graph Logic: uses graph logic (evidence: `src/components/HistoryBar.tsx`)
- Verse Research → Verse Card: renders (evidence: `src/components/VerseResearch.tsx`)
- Verse Research → Analects Store: reads verses (evidence: `src/components/VerseResearch.tsx`)
- Deep Links → Analects Store: applies state (evidence: `src/hooks/useDeepLink.ts`)
- Deep Links → Graph Logic: resolves links (evidence: `src/hooks/useDeepLink.ts`)
- Analects Store → JSON Fetcher: fetches data (evidence: `src/store/analectsStore.ts`)
- Analects Store → JSON Data Packages: loads JSON (evidence: `src/store/analectsStore.ts`)
- Analects Store → Graph Logic: computes nodes (evidence: `src/store/analectsStore.ts`)
