# fandeyibiao07/research-tree architecture

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

- Interactive diagram: https://gitdiagram.com/fandeyibiao07/research-tree
- Repository: https://github.com/fandeyibiao07/research-tree

## Overview

Research Tree is a bilingual workspace for preserving evolving research reasoning as a typed, traceable graph. The primary workflow is to open or create a tree, edit claims and semantic links on the canvas, retain decision history, and save or reopen the portable document. The README documents logic spots, filtering, tracing, tree tabs, background layers, migration, and bilingual display. Source excerpts are partial, so links for those documented capabilities are limited to the app and relevant enclosing modules; no unsampled call chain is assumed.

Main entry points: [`components/research-tree-app.tsx`](https://github.com/fandeyibiao07/research-tree/blob/main/components/research-tree-app.tsx) (Research workspace), [`lib/research-tree/repository.ts`](https://github.com/fandeyibiao07/research-tree/blob/main/lib/research-tree/repository.ts) (Document repository), [`components/research-tree-canvas.tsx`](https://github.com/fandeyibiao07/research-tree/blob/main/components/research-tree-canvas.tsx) (Graph canvas), [`app/page.tsx`](https://github.com/fandeyibiao07/research-tree/blob/main/app/page.tsx) (Workspace page)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_presentation["Workspace interface"]
  node_page["Workspace page<br/>[page.tsx]"]
  node_app["Research workspace"]
  node_canvas["Graph canvas"]
  node_backgrounds["Background layers"]
  node_tabs["Open tree workspace"]
end

subgraph group_reasoning["Reasoning model"]
  node_graphview["Expandable reasoning graph"]
  node_semantic["Typed reasoning links"]
  node_logic["Logic spots"]
  node_trace["Search and evidence trace"]
  node_decisionlog["Decision history"]
  node_model["Tree data types<br/>[types.ts]"]
end

subgraph group_documents["Documents and persistence"]
  node_repository["Document repository<br/>[repository.ts]"]
  node_validation["Migration and validation<br/>[validation.ts]"]
  node_storage[("Browser workspace storage")]
  node_workspace["Workspace operations<br/>[workspace.ts]"]
  node_portable["Portable tree file"]
end

subgraph group_support["Shared presentation"]
  node_localization["Bilingual labels<br/>[i18n.ts]"]
end

node_researcher(("Researcher"))
node_fileuser(("File chooser / download"))

node_researcher -->|"opens"| node_page
node_page -->|"renders"| node_app
node_app -->|"loads and saves"| node_repository
node_repository -->|"reads and writes"| node_storage
node_repository -->|"migrates and validates"| node_validation
node_app -->|"presents canvas"| node_canvas
node_app -->|"displays graph"| node_graphview
node_app -->|"edits relationships"| node_semantic
node_app -->|"edits logic spots"| node_logic
node_app -->|"searches and traces"| node_trace
node_app -->|"shows history"| node_decisionlog
node_app -->|"switches trees"| node_tabs
node_app -->|"selects language"| node_localization
node_canvas -->|"manages layers"| node_backgrounds
node_canvas -->|"moves layers"| node_workspace
node_app -->|"exports and imports"| node_portable
node_app -->|"downloads or selects"| node_fileuser
node_portable -->|"provides document"| node_app
node_model -.->|"defines data shape"| node_repository

click node_page "https://github.com/fandeyibiao07/research-tree/blob/main/app/page.tsx"
click node_app "https://github.com/fandeyibiao07/research-tree/blob/main/components/research-tree-app.tsx"
click node_canvas "https://github.com/fandeyibiao07/research-tree/blob/main/components/research-tree-canvas.tsx"
click node_graphview "https://github.com/fandeyibiao07/research-tree/blob/main/components/research-tree-app.tsx"
click node_semantic "https://github.com/fandeyibiao07/research-tree/blob/main/components/research-tree-app.tsx"
click node_logic "https://github.com/fandeyibiao07/research-tree/blob/main/components/research-tree-app.tsx"
click node_trace "https://github.com/fandeyibiao07/research-tree/blob/main/components/research-tree-app.tsx"
click node_decisionlog "https://github.com/fandeyibiao07/research-tree/blob/main/components/research-tree-app.tsx"
click node_model "https://github.com/fandeyibiao07/research-tree/blob/main/lib/research-tree/types.ts"
click node_localization "https://github.com/fandeyibiao07/research-tree/blob/main/lib/research-tree/i18n.ts"
click node_backgrounds "https://github.com/fandeyibiao07/research-tree/blob/main/components/research-tree-canvas.tsx"
click node_tabs "https://github.com/fandeyibiao07/research-tree/blob/main/components/research-tree-app.tsx"
click node_repository "https://github.com/fandeyibiao07/research-tree/blob/main/lib/research-tree/repository.ts"
click node_validation "https://github.com/fandeyibiao07/research-tree/blob/main/lib/research-tree/validation.ts"
click node_workspace "https://github.com/fandeyibiao07/research-tree/blob/main/lib/research-tree/workspace.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_page,node_app,node_canvas,node_backgrounds,node_tabs toneBlue
class node_graphview,node_semantic,node_logic,node_trace,node_decisionlog,node_model toneAmber
class node_repository,node_validation,node_storage,node_workspace,node_portable toneMint
class node_localization toneRose
class node_researcher,node_fileuser toneIndigo
```

## Components

### Workspace interface

- [Workspace page](https://github.com/fandeyibiao07/research-tree/blob/main/app/page.tsx): `app/page.tsx`
- [Research workspace](https://github.com/fandeyibiao07/research-tree/blob/main/components/research-tree-app.tsx): `components/research-tree-app.tsx`
- [Graph canvas](https://github.com/fandeyibiao07/research-tree/blob/main/components/research-tree-canvas.tsx): `components/research-tree-canvas.tsx`
- [Background layers](https://github.com/fandeyibiao07/research-tree/blob/main/components/research-tree-canvas.tsx): `components/research-tree-canvas.tsx`
- [Open tree workspace](https://github.com/fandeyibiao07/research-tree/blob/main/components/research-tree-app.tsx): `components/research-tree-app.tsx`

### Reasoning model

- [Expandable reasoning graph](https://github.com/fandeyibiao07/research-tree/blob/main/components/research-tree-app.tsx): `components/research-tree-app.tsx`
- [Typed reasoning links](https://github.com/fandeyibiao07/research-tree/blob/main/components/research-tree-app.tsx): `components/research-tree-app.tsx`
- [Logic spots](https://github.com/fandeyibiao07/research-tree/blob/main/components/research-tree-app.tsx): `components/research-tree-app.tsx`
- [Search and evidence trace](https://github.com/fandeyibiao07/research-tree/blob/main/components/research-tree-app.tsx): `components/research-tree-app.tsx`
- [Decision history](https://github.com/fandeyibiao07/research-tree/blob/main/components/research-tree-app.tsx): `components/research-tree-app.tsx`
- [Tree data types](https://github.com/fandeyibiao07/research-tree/blob/main/lib/research-tree/types.ts): `lib/research-tree/types.ts`

### Documents and persistence

- [Document repository](https://github.com/fandeyibiao07/research-tree/blob/main/lib/research-tree/repository.ts): `lib/research-tree/repository.ts`
- [Migration and validation](https://github.com/fandeyibiao07/research-tree/blob/main/lib/research-tree/validation.ts): `lib/research-tree/validation.ts`
- **Browser workspace storage**
- [Workspace operations](https://github.com/fandeyibiao07/research-tree/blob/main/lib/research-tree/workspace.ts): `lib/research-tree/workspace.ts`
- **Portable tree file**

### Shared presentation

- [Bilingual labels](https://github.com/fandeyibiao07/research-tree/blob/main/lib/research-tree/i18n.ts): `lib/research-tree/i18n.ts`

### Other components

- **Researcher**
- **File chooser / download**

## Connections

- Researcher → Workspace page: opens
- Workspace page → Research workspace: renders
- Research workspace → Document repository: loads and saves
- Document repository → Browser workspace storage: reads and writes
- Document repository → Migration and validation: migrates and validates
- Research workspace → Graph canvas: presents canvas
- Research workspace → Expandable reasoning graph: displays graph
- Research workspace → Typed reasoning links: edits relationships
- Research workspace → Logic spots: edits logic spots
- Research workspace → Search and evidence trace: searches and traces
- Research workspace → Decision history: shows history
- Research workspace → Open tree workspace: switches trees
- Research workspace → Bilingual labels: selects language
- Graph canvas → Background layers: manages layers
- Graph canvas → Workspace operations: moves layers
- Research workspace → Portable tree file: exports and imports
- Research workspace → File chooser / download: downloads or selects
- Portable tree file → Research workspace: provides document
- Tree data types → Document repository: defines data shape
