# hossainkhan-dot/our-family-tree architecture

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

- Interactive diagram: https://gitdiagram.com/hossainkhan-dot/our-family-tree
- Repository: https://github.com/hossainkhan-dot/our-family-tree

## Overview

Family Legacy Archive is a local-first family-history app: users build and explore a family tree, then preserve or share it through portable exports and optional Google Drive features. The graph follows app navigation into genealogy views and data access, then shows the local archive and backup/cloud capabilities. Some cloud orchestration and database internals were not excerpted; uncertain internal links are omitted rather than inferred.

Main entry points: [`src/App.tsx`](https://github.com/hossainkhan-dot/our-family-tree/blob/main/src/App.tsx) (App navigation), [`src/cloud/driveBackup.ts`](https://github.com/hossainkhan-dot/our-family-tree/blob/main/src/cloud/driveBackup.ts) (Drive backup), [`src/db/package.ts`](https://github.com/hossainkhan-dot/our-family-tree/blob/main/src/db/package.ts) (Portable data package), [`src/db/repo.ts`](https://github.com/hossainkhan-dot/our-family-tree/blob/main/src/db/repo.ts) (Family data operations)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Application"]
  node_app["App navigation<br/>[App.tsx]"]
  node_funnel["Generation overview<br/>[Funnel.tsx]"]
  node_tree["Family tree<br/>[TreeView.tsx]"]
  node_people["People and profiles<br/>[People.tsx]"]
  node_personform["Person editor<br/>[PersonForm.tsx]"]
  node_explore["Relationship explorer<br/>[Explore.tsx]"]
  node_manage["Family management<br/>[Manage.tsx]"]
  node_backupui["Backup interface<br/>[Backup.tsx]"]
  node_cloudpanel["Cloud controls<br/>[CloudPanel.tsx]"]
  node_gate["Account access screen<br/>[Gate.tsx]"]
end

subgraph group_genealogy["Family history"]
  node_relations["Relationship engine<br/>[relations.ts]"]
end

subgraph group_archive["Local archive"]
  node_repo["Family data operations<br/>[repo.ts]"]
  node_access["Roles and approvals<br/>[access.ts]"]
  node_dbcontext["Database context<br/>[DbContext.tsx]"]
  node_localdb[("Local SQL database<br/>[open.ts]")]
  node_snapshots["Local snapshots<br/>[snapshots.ts]"]
  node_backup["Portable data package<br/>[package.ts]"]
  node_gedcom["GEDCOM exchange<br/>[gedcom.ts]"]
  node_media["Media records<br/>[media.ts]"]
  node_mediafiles[("Local media storage<br/>[mediaStore.ts]")]
  node_zip["ZIP and hashing<br/>[zip.ts]"]
end

subgraph group_cloud["Cloud and sharing"]
  node_runtime["Cloud runtime<br/>[runtime.ts]"]
  node_sync["Family synchronization<br/>[sync.ts]"]
  node_drivebackup["Drive backup<br/>[driveBackup.ts]"]
  node_drive["Google Drive client<br/>[drive.ts]"]
  node_googleauth["Google OAuth<br/>[google.ts]"]
  node_session["Token session<br/>[session.ts]"]
end

node_user(("Family historian"))
node_googleservices{{"Google services"}}

node_user -->|"uses"| node_app
node_app -->|"shows"| node_funnel
node_app -->|"opens"| node_tree
node_app -->|"opens"| node_people
node_app -->|"opens"| node_backupui
node_app -->|"opens"| node_manage
node_tree -->|"uses"| node_relations
node_people -->|"opens"| node_personform
node_people -->|"uses"| node_relations
node_personform -->|"saves through"| node_repo
node_explore -->|"uses"| node_relations
node_manage -->|"opens"| node_explore
node_repo -->|"checks cycles"| node_relations
node_dbcontext -->|"opens"| node_localdb
node_dbcontext -->|"loads data"| node_repo
node_dbcontext -->|"creates snapshot"| node_snapshots
node_repo -->|"reads and writes"| node_localdb
node_access -->|"applies changes"| node_repo
node_backupui -->|"exports and imports"| node_backup
node_backupui -->|"exchanges GEDCOM"| node_gedcom
node_backup -->|"includes exchange data"| node_gedcom
node_backup -->|"packages media"| node_media
node_backup -->|"uses archive format"| node_zip
node_media -->|"stores media"| node_mediafiles
node_cloudpanel -->|"opens account flow"| node_gate
node_cloudpanel -.->|"configures cloud"| node_runtime
node_cloudpanel -.->|"starts synchronization"| node_sync
node_runtime -.->|"coordinates"| node_sync
node_runtime -.->|"coordinates"| node_drivebackup
node_sync -->|"transfers family data"| node_drive
node_drivebackup -->|"uses"| node_drive
node_drivebackup -->|"packages data"| node_backup
node_drivebackup -->|"uses media"| node_media
node_drivebackup -->|"uses archive tools"| node_zip
node_session -->|"refreshes tokens"| node_googleauth
node_googleauth -->|"authenticates with"| node_googleservices
node_drive -.->|"accesses Drive"| node_googleservices

click node_app "https://github.com/hossainkhan-dot/our-family-tree/blob/main/src/App.tsx"
click node_funnel "https://github.com/hossainkhan-dot/our-family-tree/blob/main/src/components/Funnel.tsx"
click node_tree "https://github.com/hossainkhan-dot/our-family-tree/blob/main/src/components/TreeView.tsx"
click node_people "https://github.com/hossainkhan-dot/our-family-tree/blob/main/src/components/People.tsx"
click node_personform "https://github.com/hossainkhan-dot/our-family-tree/blob/main/src/components/PersonForm.tsx"
click node_explore "https://github.com/hossainkhan-dot/our-family-tree/blob/main/src/components/Explore.tsx"
click node_manage "https://github.com/hossainkhan-dot/our-family-tree/blob/main/src/components/Manage.tsx"
click node_relations "https://github.com/hossainkhan-dot/our-family-tree/blob/main/src/core/relations.ts"
click node_repo "https://github.com/hossainkhan-dot/our-family-tree/blob/main/src/db/repo.ts"
click node_access "https://github.com/hossainkhan-dot/our-family-tree/blob/main/src/db/access.ts"
click node_dbcontext "https://github.com/hossainkhan-dot/our-family-tree/blob/main/src/db/DbContext.tsx"
click node_localdb "https://github.com/hossainkhan-dot/our-family-tree/blob/main/src/db/open.ts"
click node_snapshots "https://github.com/hossainkhan-dot/our-family-tree/blob/main/src/db/snapshots.ts"
click node_backupui "https://github.com/hossainkhan-dot/our-family-tree/blob/main/src/components/Backup.tsx"
click node_backup "https://github.com/hossainkhan-dot/our-family-tree/blob/main/src/db/package.ts"
click node_gedcom "https://github.com/hossainkhan-dot/our-family-tree/blob/main/src/db/gedcom.ts"
click node_media "https://github.com/hossainkhan-dot/our-family-tree/blob/main/src/db/media.ts"
click node_mediafiles "https://github.com/hossainkhan-dot/our-family-tree/blob/main/src/db/mediaStore.ts"
click node_zip "https://github.com/hossainkhan-dot/our-family-tree/blob/main/src/db/zip.ts"
click node_cloudpanel "https://github.com/hossainkhan-dot/our-family-tree/blob/main/src/components/CloudPanel.tsx"
click node_gate "https://github.com/hossainkhan-dot/our-family-tree/blob/main/src/components/Gate.tsx"
click node_runtime "https://github.com/hossainkhan-dot/our-family-tree/blob/main/src/cloud/runtime.ts"
click node_sync "https://github.com/hossainkhan-dot/our-family-tree/blob/main/src/cloud/sync.ts"
click node_drivebackup "https://github.com/hossainkhan-dot/our-family-tree/blob/main/src/cloud/driveBackup.ts"
click node_drive "https://github.com/hossainkhan-dot/our-family-tree/blob/main/src/cloud/drive.ts"
click node_googleauth "https://github.com/hossainkhan-dot/our-family-tree/blob/main/src/cloud/google.ts"
click node_session "https://github.com/hossainkhan-dot/our-family-tree/blob/main/src/cloud/session.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_funnel,node_tree,node_people,node_personform,node_explore,node_manage,node_backupui,node_cloudpanel,node_gate toneBlue
class node_relations toneAmber
class node_repo,node_access,node_dbcontext,node_localdb,node_snapshots,node_backup,node_gedcom,node_media,node_mediafiles,node_zip toneMint
class node_runtime,node_sync,node_drivebackup,node_drive,node_googleauth,node_session toneRose
class node_user,node_googleservices toneIndigo
```

## Components

### Application

- [App navigation](https://github.com/hossainkhan-dot/our-family-tree/blob/main/src/App.tsx): `src/App.tsx`
- [Generation overview](https://github.com/hossainkhan-dot/our-family-tree/blob/main/src/components/Funnel.tsx): `src/components/Funnel.tsx`
- [Family tree](https://github.com/hossainkhan-dot/our-family-tree/blob/main/src/components/TreeView.tsx): `src/components/TreeView.tsx`
- [People and profiles](https://github.com/hossainkhan-dot/our-family-tree/blob/main/src/components/People.tsx): `src/components/People.tsx`
- [Person editor](https://github.com/hossainkhan-dot/our-family-tree/blob/main/src/components/PersonForm.tsx): `src/components/PersonForm.tsx`
- [Relationship explorer](https://github.com/hossainkhan-dot/our-family-tree/blob/main/src/components/Explore.tsx): `src/components/Explore.tsx`
- [Family management](https://github.com/hossainkhan-dot/our-family-tree/blob/main/src/components/Manage.tsx): `src/components/Manage.tsx`
- [Backup interface](https://github.com/hossainkhan-dot/our-family-tree/blob/main/src/components/Backup.tsx): `src/components/Backup.tsx`
- [Cloud controls](https://github.com/hossainkhan-dot/our-family-tree/blob/main/src/components/CloudPanel.tsx): `src/components/CloudPanel.tsx`
- [Account access screen](https://github.com/hossainkhan-dot/our-family-tree/blob/main/src/components/Gate.tsx): `src/components/Gate.tsx`

### Family history

- [Relationship engine](https://github.com/hossainkhan-dot/our-family-tree/blob/main/src/core/relations.ts): `src/core/relations.ts`

### Local archive

- [Family data operations](https://github.com/hossainkhan-dot/our-family-tree/blob/main/src/db/repo.ts): `src/db/repo.ts`
- [Roles and approvals](https://github.com/hossainkhan-dot/our-family-tree/blob/main/src/db/access.ts): `src/db/access.ts`
- [Database context](https://github.com/hossainkhan-dot/our-family-tree/blob/main/src/db/DbContext.tsx): `src/db/DbContext.tsx`
- [Local SQL database](https://github.com/hossainkhan-dot/our-family-tree/blob/main/src/db/open.ts): `src/db/open.ts`
- [Local snapshots](https://github.com/hossainkhan-dot/our-family-tree/blob/main/src/db/snapshots.ts): `src/db/snapshots.ts`
- [Portable data package](https://github.com/hossainkhan-dot/our-family-tree/blob/main/src/db/package.ts): `src/db/package.ts`
- [GEDCOM exchange](https://github.com/hossainkhan-dot/our-family-tree/blob/main/src/db/gedcom.ts): `src/db/gedcom.ts`
- [Media records](https://github.com/hossainkhan-dot/our-family-tree/blob/main/src/db/media.ts): `src/db/media.ts`
- [Local media storage](https://github.com/hossainkhan-dot/our-family-tree/blob/main/src/db/mediaStore.ts): `src/db/mediaStore.ts`
- [ZIP and hashing](https://github.com/hossainkhan-dot/our-family-tree/blob/main/src/db/zip.ts): `src/db/zip.ts`

### Cloud and sharing

- [Cloud runtime](https://github.com/hossainkhan-dot/our-family-tree/blob/main/src/cloud/runtime.ts): `src/cloud/runtime.ts`
- [Family synchronization](https://github.com/hossainkhan-dot/our-family-tree/blob/main/src/cloud/sync.ts): `src/cloud/sync.ts`
- [Drive backup](https://github.com/hossainkhan-dot/our-family-tree/blob/main/src/cloud/driveBackup.ts): `src/cloud/driveBackup.ts`
- [Google Drive client](https://github.com/hossainkhan-dot/our-family-tree/blob/main/src/cloud/drive.ts): `src/cloud/drive.ts`
- [Google OAuth](https://github.com/hossainkhan-dot/our-family-tree/blob/main/src/cloud/google.ts): `src/cloud/google.ts`
- [Token session](https://github.com/hossainkhan-dot/our-family-tree/blob/main/src/cloud/session.ts): `src/cloud/session.ts`

### Other components

- **Family historian**
- **Google services**

## Connections

- Family historian → App navigation: uses (evidence: `src/App.tsx`)
- App navigation → Generation overview: shows (evidence: `src/App.tsx`)
- App navigation → Family tree: opens (evidence: `src/App.tsx`)
- App navigation → People and profiles: opens (evidence: `src/App.tsx`)
- App navigation → Backup interface: opens (evidence: `src/App.tsx`)
- App navigation → Family management: opens (evidence: `src/App.tsx`)
- Family tree → Relationship engine: uses (evidence: `src/core/relations.ts`)
- People and profiles → Person editor: opens (evidence: `src/components/People.tsx`)
- People and profiles → Relationship engine: uses (evidence: `src/components/People.tsx`)
- Person editor → Family data operations: saves through (evidence: `src/db/repo.ts`)
- Relationship explorer → Relationship engine: uses (evidence: `src/components/Explore.tsx`)
- Family management → Relationship explorer: opens (evidence: `src/components/Manage.tsx`)
- Family data operations → Relationship engine: checks cycles (evidence: `src/db/repo.ts`)
- Database context → Local SQL database: opens (evidence: `src/db/DbContext.tsx`)
- Database context → Family data operations: loads data (evidence: `src/db/DbContext.tsx`)
- Database context → Local snapshots: creates snapshot (evidence: `src/db/DbContext.tsx`)
- Family data operations → Local SQL database: reads and writes (evidence: `src/db/repo.ts`)
- Roles and approvals → Family data operations: applies changes (evidence: `src/db/access.ts`)
- Backup interface → Portable data package: exports and imports (evidence: `src/components/Backup.tsx`)
- Backup interface → GEDCOM exchange: exchanges GEDCOM (evidence: `src/components/Backup.tsx`)
- Portable data package → GEDCOM exchange: includes exchange data (evidence: `src/db/package.ts`)
- Portable data package → Media records: packages media (evidence: `src/db/package.ts`)
- Portable data package → ZIP and hashing: uses archive format (evidence: `src/db/package.ts`)
- Media records → Local media storage: stores media (evidence: `src/db/mediaStore.ts`)
- Cloud controls → Account access screen: opens account flow (evidence: `src/components/CloudPanel.tsx`)
- Cloud controls → Cloud runtime: configures cloud (evidence: `src/components/CloudPanel.tsx`)
- Cloud controls → Family synchronization: starts synchronization (evidence: `src/components/CloudPanel.tsx`)
- Cloud runtime → Family synchronization: coordinates (evidence: `src/cloud/runtime.ts`)
- Cloud runtime → Drive backup: coordinates (evidence: `src/cloud/runtime.ts`)
- Family synchronization → Google Drive client: transfers family data (evidence: `src/cloud/sync.ts`)
- Drive backup → Google Drive client: uses (evidence: `src/cloud/driveBackup.ts`)
- Drive backup → Portable data package: packages data (evidence: `src/cloud/driveBackup.ts`)
- Drive backup → Media records: uses media (evidence: `src/cloud/driveBackup.ts`)
- Drive backup → ZIP and hashing: uses archive tools (evidence: `src/cloud/driveBackup.ts`)
- Token session → Google OAuth: refreshes tokens (evidence: `src/cloud/session.ts`)
- Google OAuth → Google services: authenticates with (evidence: `src/cloud/google.ts`)
- Google Drive client → Google services: accesses Drive
