# demosamples/family-tree architecture

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

- Interactive diagram: https://gitdiagram.com/demosamples/family-tree
- Repository: https://github.com/demosamples/family-tree

## Overview

Kinship Archive is a bilingual genealogy application for recording family relationships, researching individual lives, and exploring lineage over time. A researcher works in the main workspace to view the family graph, timeline, or directory; they can inspect and edit dossiers, manage collaboration and history, use the AI assistant, and import or export records. Family records and UI state are coordinated in App, with genealogy calculations and knowledge-graph construction supporting exploration. The README is empty, so capability and relationship details are limited to the supplied source index and excerpts; unsampled integrations are not inferred.

Main entry points: [`src/App.tsx`](https://github.com/demosamples/family-tree/blob/main/src/App.tsx) (Application Workspace), [`src/utils/genealogy.ts`](https://github.com/demosamples/family-tree/blob/main/src/utils/genealogy.ts) (Genealogy Calculations), [`src/types/family.ts`](https://github.com/demosamples/family-tree/blob/main/src/types/family.ts) (Family Record Types), [`src/components/PersonFormModal.tsx`](https://github.com/demosamples/family-tree/blob/main/src/components/PersonFormModal.tsx) (Person Editor)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workspace["Research Workspace"]
  node_app["Application Workspace<br/>[App.tsx]"]
  node_topbar["Workspace Navigation<br/>[TopBar.tsx]"]
end

subgraph group_records["Family Records"]
  node_familydata["Family Record Types<br/>[family.ts]"]
  node_seeddata["Sample Family Data"]
  node_personform["Person Editor"]
  node_persondetail["Person Dossier"]
  node_deleteconfirm["Delete Confirmation"]
  node_exportimport["Data Portability"]
end

subgraph group_exploration["Lineage Exploration"]
  node_genealogy["Genealogy Calculations<br/>[genealogy.ts]"]
  node_treecanvas["Interactive Family Graph<br/>[TreeCanvas.tsx]"]
  node_kgstore["Knowledge Graph Builder"]
  node_timeline["Timeline View<br/>[TimelineView.tsx]"]
  node_eraslider["Era Navigator"]
  node_listview["Family Directory<br/>[ListView.tsx]"]
end

subgraph group_services["Research Services"]
  node_collaboration["Collaboration and Roles"]
  node_aiassistant["AI Genealogist"]
  node_localstorage[("Browser Local Storage")]
  node_transliteration["Nepali Transliteration"]
  node_i18n["English and Nepali Text<br/>[i18n.ts]"]
end

node_researcher(("Researcher"))

node_researcher -->|"uses"| node_app
node_app -->|"renders"| node_topbar
node_app -->|"renders"| node_treecanvas
node_app -->|"renders"| node_timeline
node_app -->|"renders"| node_eraslider
node_app -->|"renders"| node_listview
node_app -->|"renders"| node_persondetail
node_app -->|"renders"| node_personform
node_app -->|"renders"| node_deleteconfirm
node_app -->|"renders"| node_exportimport
node_app -->|"renders"| node_collaboration
node_app -->|"renders"| node_aiassistant
node_app -->|"uses records"| node_familydata
node_app -->|"loads sample"| node_seeddata
node_app -->|"recalculates generations"| node_genealogy
node_app -->|"reads and writes"| node_localstorage
node_treecanvas -->|"builds graph data"| node_kgstore
node_treecanvas -->|"uses lineage helpers"| node_genealogy
node_personform -->|"transliterates names"| node_transliteration
node_exportimport -->|"exports GEDCOM"| node_genealogy
node_aiassistant -->|"uses graph data"| node_kgstore
node_app -->|"uses translations"| node_i18n
node_topbar -->|"uses translations"| node_i18n
node_personform -->|"uses translations"| node_i18n
node_persondetail -->|"displays records"| node_familydata
node_collaboration -->|"uses researcher roles"| node_familydata
node_timeline -->|"uses lineage helpers"| node_genealogy
node_listview -->|"uses lineage helpers"| node_genealogy
node_seeddata -->|"defines records"| node_familydata

click node_app "https://github.com/demosamples/family-tree/blob/main/src/App.tsx"
click node_topbar "https://github.com/demosamples/family-tree/blob/main/src/components/TopBar.tsx"
click node_familydata "https://github.com/demosamples/family-tree/blob/main/src/types/family.ts"
click node_seeddata "https://github.com/demosamples/family-tree/blob/main/src/data/initialFamilyData.ts"
click node_personform "https://github.com/demosamples/family-tree/blob/main/src/components/PersonFormModal.tsx"
click node_persondetail "https://github.com/demosamples/family-tree/blob/main/src/components/PersonDetailModal.tsx"
click node_deleteconfirm "https://github.com/demosamples/family-tree/blob/main/src/components/ConfirmDeleteModal.tsx"
click node_exportimport "https://github.com/demosamples/family-tree/blob/main/src/components/ExportImportModal.tsx"
click node_genealogy "https://github.com/demosamples/family-tree/blob/main/src/utils/genealogy.ts"
click node_treecanvas "https://github.com/demosamples/family-tree/blob/main/src/components/TreeCanvas.tsx"
click node_kgstore "https://github.com/demosamples/family-tree/blob/main/src/db/knowledgeGraphStore.ts"
click node_timeline "https://github.com/demosamples/family-tree/blob/main/src/components/TimelineView.tsx"
click node_eraslider "https://github.com/demosamples/family-tree/blob/main/src/components/TimelineEraSlider.tsx"
click node_listview "https://github.com/demosamples/family-tree/blob/main/src/components/ListView.tsx"
click node_collaboration "https://github.com/demosamples/family-tree/blob/main/src/components/CollaborationModal.tsx"
click node_aiassistant "https://github.com/demosamples/family-tree/blob/main/src/components/AIAssistantDrawer.tsx"
click node_transliteration "https://github.com/demosamples/family-tree/blob/main/src/utils/nepaliTransliteration.ts"
click node_i18n "https://github.com/demosamples/family-tree/blob/main/src/utils/i18n.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,node_topbar toneBlue
class node_familydata,node_seeddata,node_personform,node_persondetail,node_deleteconfirm,node_exportimport toneAmber
class node_genealogy,node_treecanvas,node_kgstore,node_timeline,node_eraslider,node_listview toneMint
class node_collaboration,node_aiassistant,node_localstorage,node_transliteration,node_i18n toneRose
class node_researcher toneIndigo
```

## Components

### Research Workspace

- [Application Workspace](https://github.com/demosamples/family-tree/blob/main/src/App.tsx): `src/App.tsx`
- [Workspace Navigation](https://github.com/demosamples/family-tree/blob/main/src/components/TopBar.tsx): `src/components/TopBar.tsx`

### Family Records

- [Family Record Types](https://github.com/demosamples/family-tree/blob/main/src/types/family.ts): `src/types/family.ts`
- [Sample Family Data](https://github.com/demosamples/family-tree/blob/main/src/data/initialFamilyData.ts): `src/data/initialFamilyData.ts`
- [Person Editor](https://github.com/demosamples/family-tree/blob/main/src/components/PersonFormModal.tsx): `src/components/PersonFormModal.tsx`
- [Person Dossier](https://github.com/demosamples/family-tree/blob/main/src/components/PersonDetailModal.tsx): `src/components/PersonDetailModal.tsx`
- [Delete Confirmation](https://github.com/demosamples/family-tree/blob/main/src/components/ConfirmDeleteModal.tsx): `src/components/ConfirmDeleteModal.tsx`
- [Data Portability](https://github.com/demosamples/family-tree/blob/main/src/components/ExportImportModal.tsx): `src/components/ExportImportModal.tsx`

### Lineage Exploration

- [Genealogy Calculations](https://github.com/demosamples/family-tree/blob/main/src/utils/genealogy.ts): `src/utils/genealogy.ts`
- [Interactive Family Graph](https://github.com/demosamples/family-tree/blob/main/src/components/TreeCanvas.tsx): `src/components/TreeCanvas.tsx`
- [Knowledge Graph Builder](https://github.com/demosamples/family-tree/blob/main/src/db/knowledgeGraphStore.ts): `src/db/knowledgeGraphStore.ts`
- [Timeline View](https://github.com/demosamples/family-tree/blob/main/src/components/TimelineView.tsx): `src/components/TimelineView.tsx`
- [Era Navigator](https://github.com/demosamples/family-tree/blob/main/src/components/TimelineEraSlider.tsx): `src/components/TimelineEraSlider.tsx`
- [Family Directory](https://github.com/demosamples/family-tree/blob/main/src/components/ListView.tsx): `src/components/ListView.tsx`

### Research Services

- [Collaboration and Roles](https://github.com/demosamples/family-tree/blob/main/src/components/CollaborationModal.tsx): `src/components/CollaborationModal.tsx`
- [AI Genealogist](https://github.com/demosamples/family-tree/blob/main/src/components/AIAssistantDrawer.tsx): `src/components/AIAssistantDrawer.tsx`
- **Browser Local Storage**
- [Nepali Transliteration](https://github.com/demosamples/family-tree/blob/main/src/utils/nepaliTransliteration.ts): `src/utils/nepaliTransliteration.ts`
- [English and Nepali Text](https://github.com/demosamples/family-tree/blob/main/src/utils/i18n.ts): `src/utils/i18n.ts`

### Other components

- **Researcher**

## Connections

- Researcher → Application Workspace: uses
- Application Workspace → Workspace Navigation: renders (evidence: `src/App.tsx`)
- Application Workspace → Interactive Family Graph: renders (evidence: `src/App.tsx`)
- Application Workspace → Timeline View: renders (evidence: `src/App.tsx`)
- Application Workspace → Era Navigator: renders (evidence: `src/App.tsx`)
- Application Workspace → Family Directory: renders (evidence: `src/App.tsx`)
- Application Workspace → Person Dossier: renders (evidence: `src/App.tsx`)
- Application Workspace → Person Editor: renders (evidence: `src/App.tsx`)
- Application Workspace → Delete Confirmation: renders (evidence: `src/App.tsx`)
- Application Workspace → Data Portability: renders (evidence: `src/App.tsx`)
- Application Workspace → Collaboration and Roles: renders (evidence: `src/App.tsx`)
- Application Workspace → AI Genealogist: renders (evidence: `src/App.tsx`)
- Application Workspace → Family Record Types: uses records (evidence: `src/App.tsx`)
- Application Workspace → Sample Family Data: loads sample (evidence: `src/App.tsx`)
- Application Workspace → Genealogy Calculations: recalculates generations (evidence: `src/App.tsx`)
- Application Workspace → Browser Local Storage: reads and writes (evidence: `src/App.tsx`)
- Interactive Family Graph → Knowledge Graph Builder: builds graph data (evidence: `src/components/TreeCanvas.tsx`)
- Interactive Family Graph → Genealogy Calculations: uses lineage helpers (evidence: `src/components/TreeCanvas.tsx`)
- Person Editor → Nepali Transliteration: transliterates names (evidence: `src/components/PersonFormModal.tsx`)
- Data Portability → Genealogy Calculations: exports GEDCOM (evidence: `src/components/ExportImportModal.tsx`)
- AI Genealogist → Knowledge Graph Builder: uses graph data (evidence: `src/components/AIAssistantDrawer.tsx`)
- Application Workspace → English and Nepali Text: uses translations (evidence: `src/App.tsx`)
- Workspace Navigation → English and Nepali Text: uses translations (evidence: `src/components/TopBar.tsx`)
- Person Editor → English and Nepali Text: uses translations (evidence: `src/components/PersonFormModal.tsx`)
- Person Dossier → Family Record Types: displays records (evidence: `src/components/PersonDetailModal.tsx`)
- Collaboration and Roles → Family Record Types: uses researcher roles (evidence: `src/components/CollaborationModal.tsx`)
- Timeline View → Genealogy Calculations: uses lineage helpers (evidence: `src/components/TimelineView.tsx`)
- Family Directory → Genealogy Calculations: uses lineage helpers (evidence: `src/components/ListView.tsx`)
- Sample Family Data → Family Record Types: defines records (evidence: `src/data/initialFamilyData.ts`)
