# cfpisaca/ancestryatlas architecture

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

- Interactive diagram: https://gitdiagram.com/cfpisaca/ancestryatlas
- Repository: https://github.com/cfpisaca/ancestryatlas

## Overview

Ancestral Atlas is presented as a genealogy globe, but the sampled runtime shows a menu with a world-country quiz, a capitals quiz, and an interactive country explorer; it does not show family-event or migration data. The main workflow is choosing a mode, interacting with the globe and its controls, and seeing country selections or quiz progress. Country borders come from the committed country dataset. The source excerpts support the UI and globe relationships; the country-data fetch details and capitals-data use are not fully shown.

Main entry points: [`src/CapitalsQuiz.tsx`](https://github.com/cfpisaca/ancestryatlas/blob/main/src/CapitalsQuiz.tsx) (Capitals quiz), [`src/GlobeExplorer.tsx`](https://github.com/cfpisaca/ancestryatlas/blob/main/src/GlobeExplorer.tsx) (Globe explorer), [`src/WorldQuiz.tsx`](https://github.com/cfpisaca/ancestryatlas/blob/main/src/WorldQuiz.tsx) (World quiz), [`src/App.tsx`](https://github.com/cfpisaca/ancestryatlas/blob/main/src/App.tsx) (App routes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_navigation["Navigation"]
  node_entry["React entry<br/>[main.tsx]"]
  node_routes["App routes<br/>[App.tsx]"]
  node_menu["Mode menu<br/>[Menu.tsx]"]
end

subgraph group_globe["Globe and data"]
  node_explorer["Globe explorer<br/>[GlobeExplorer.tsx]"]
  node_globehook["Globe runtime<br/>[useWorldGlobe.ts]"]
  node_countrydata["Country borders<br/>[countries.json]"]
  node_globeengine["3D globe engine"]
end

subgraph group_games["Quiz modes"]
  node_worldquiz["World quiz<br/>[WorldQuiz.tsx]"]
  node_capitalsquiz["Capitals quiz<br/>[CapitalsQuiz.tsx]"]
  node_capitaldata["Capital data<br/>[capitals.ts]"]
end

subgraph group_shared["Shared controls and geography"]
  node_picker["Country picker<br/>[CountryPicker.tsx]"]
  node_sidebar["Sidebar layout<br/>[Sidebar.tsx]"]
  node_status["Globe status<br/>[GlobeStatus.tsx]"]
  node_viewport["Viewport sizing"]
  node_aliases["Guess aliases<br/>[countryAliases.ts]"]
  node_continents["Continent mapping<br/>[continents.ts]"]
end

node_visitor(("Visitor"))

node_visitor -->|"opens app"| node_entry
node_entry -->|"renders"| node_routes
node_routes -->|"routes to"| node_menu
node_routes -->|"routes to"| node_worldquiz
node_routes -->|"routes to"| node_capitalsquiz
node_routes -->|"routes to"| node_explorer
node_menu -.->|"offers modes"| node_visitor
node_worldquiz -->|"uses globe"| node_globehook
node_capitalsquiz -->|"uses globe"| node_globehook
node_explorer -->|"uses globe"| node_globehook
node_globehook -.->|"loads borders"| node_countrydata
node_globehook -->|"configures rendering"| node_globeengine
node_explorer -->|"renders"| node_picker
node_explorer -->|"groups countries"| node_continents
node_explorer -->|"renders"| node_sidebar
node_explorer -->|"renders"| node_status
node_explorer -->|"sizes layout"| node_viewport
node_worldquiz -->|"matches guesses"| node_aliases
node_worldquiz -->|"groups progress"| node_continents
node_worldquiz -->|"renders"| node_sidebar
node_worldquiz -->|"renders"| node_status
node_capitalsquiz -->|"matches guesses"| node_aliases
node_capitalsquiz -->|"groups progress"| node_continents
node_capitalsquiz -->|"uses capital list"| node_capitaldata
node_capitalsquiz -->|"renders"| node_sidebar
node_capitalsquiz -->|"renders"| node_status
node_worldquiz -->|"sizes layout"| node_viewport
node_capitalsquiz -->|"sizes layout"| node_viewport

click node_entry "https://github.com/cfpisaca/ancestryatlas/blob/main/src/main.tsx"
click node_routes "https://github.com/cfpisaca/ancestryatlas/blob/main/src/App.tsx"
click node_menu "https://github.com/cfpisaca/ancestryatlas/blob/main/src/Menu.tsx"
click node_worldquiz "https://github.com/cfpisaca/ancestryatlas/blob/main/src/WorldQuiz.tsx"
click node_capitalsquiz "https://github.com/cfpisaca/ancestryatlas/blob/main/src/CapitalsQuiz.tsx"
click node_explorer "https://github.com/cfpisaca/ancestryatlas/blob/main/src/GlobeExplorer.tsx"
click node_globehook "https://github.com/cfpisaca/ancestryatlas/blob/main/src/useWorldGlobe.ts"
click node_countrydata "https://github.com/cfpisaca/ancestryatlas/blob/main/public/data/countries.json"
click node_picker "https://github.com/cfpisaca/ancestryatlas/blob/main/src/CountryPicker.tsx"
click node_sidebar "https://github.com/cfpisaca/ancestryatlas/blob/main/src/Sidebar.tsx"
click node_status "https://github.com/cfpisaca/ancestryatlas/blob/main/src/GlobeStatus.tsx"
click node_viewport "https://github.com/cfpisaca/ancestryatlas/blob/main/src/useVisibleViewportHeight.ts"
click node_aliases "https://github.com/cfpisaca/ancestryatlas/blob/main/src/countryAliases.ts"
click node_continents "https://github.com/cfpisaca/ancestryatlas/blob/main/src/continents.ts"
click node_capitaldata "https://github.com/cfpisaca/ancestryatlas/blob/main/src/capitals.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_entry,node_routes,node_menu toneBlue
class node_explorer,node_globehook,node_countrydata,node_globeengine toneAmber
class node_worldquiz,node_capitalsquiz,node_capitaldata toneMint
class node_picker,node_sidebar,node_status,node_viewport,node_aliases,node_continents toneRose
class node_visitor toneIndigo
```

## Components

### Navigation

- [React entry](https://github.com/cfpisaca/ancestryatlas/blob/main/src/main.tsx): `src/main.tsx`
- [App routes](https://github.com/cfpisaca/ancestryatlas/blob/main/src/App.tsx): `src/App.tsx`
- [Mode menu](https://github.com/cfpisaca/ancestryatlas/blob/main/src/Menu.tsx): `src/Menu.tsx`

### Globe and data

- [Globe explorer](https://github.com/cfpisaca/ancestryatlas/blob/main/src/GlobeExplorer.tsx): `src/GlobeExplorer.tsx`
- [Globe runtime](https://github.com/cfpisaca/ancestryatlas/blob/main/src/useWorldGlobe.ts): `src/useWorldGlobe.ts`
- [Country borders](https://github.com/cfpisaca/ancestryatlas/blob/main/public/data/countries.json): `public/data/countries.json`
- **3D globe engine**

### Quiz modes

- [World quiz](https://github.com/cfpisaca/ancestryatlas/blob/main/src/WorldQuiz.tsx): `src/WorldQuiz.tsx`
- [Capitals quiz](https://github.com/cfpisaca/ancestryatlas/blob/main/src/CapitalsQuiz.tsx): `src/CapitalsQuiz.tsx`
- [Capital data](https://github.com/cfpisaca/ancestryatlas/blob/main/src/capitals.ts): `src/capitals.ts`

### Shared controls and geography

- [Country picker](https://github.com/cfpisaca/ancestryatlas/blob/main/src/CountryPicker.tsx): `src/CountryPicker.tsx`
- [Sidebar layout](https://github.com/cfpisaca/ancestryatlas/blob/main/src/Sidebar.tsx): `src/Sidebar.tsx`
- [Globe status](https://github.com/cfpisaca/ancestryatlas/blob/main/src/GlobeStatus.tsx): `src/GlobeStatus.tsx`
- [Viewport sizing](https://github.com/cfpisaca/ancestryatlas/blob/main/src/useVisibleViewportHeight.ts): `src/useVisibleViewportHeight.ts`
- [Guess aliases](https://github.com/cfpisaca/ancestryatlas/blob/main/src/countryAliases.ts): `src/countryAliases.ts`
- [Continent mapping](https://github.com/cfpisaca/ancestryatlas/blob/main/src/continents.ts): `src/continents.ts`

### Other components

- **Visitor**

## Connections

- Visitor → React entry: opens app (evidence: `src/main.tsx`)
- React entry → App routes: renders (evidence: `src/main.tsx`)
- App routes → Mode menu: routes to (evidence: `src/App.tsx`)
- App routes → World quiz: routes to (evidence: `src/App.tsx`)
- App routes → Capitals quiz: routes to (evidence: `src/App.tsx`)
- App routes → Globe explorer: routes to (evidence: `src/App.tsx`)
- Mode menu → Visitor: offers modes
- World quiz → Globe runtime: uses globe (evidence: `src/WorldQuiz.tsx`)
- Capitals quiz → Globe runtime: uses globe (evidence: `src/CapitalsQuiz.tsx`)
- Globe explorer → Globe runtime: uses globe (evidence: `src/GlobeExplorer.tsx`)
- Globe runtime → Country borders: loads borders
- Globe runtime → 3D globe engine: configures rendering (evidence: `src/useWorldGlobe.ts`)
- Globe explorer → Country picker: renders (evidence: `src/GlobeExplorer.tsx`)
- Globe explorer → Continent mapping: groups countries (evidence: `src/GlobeExplorer.tsx`)
- Globe explorer → Sidebar layout: renders (evidence: `src/GlobeExplorer.tsx`)
- Globe explorer → Globe status: renders (evidence: `src/GlobeExplorer.tsx`)
- Globe explorer → Viewport sizing: sizes layout (evidence: `src/GlobeExplorer.tsx`)
- World quiz → Guess aliases: matches guesses (evidence: `src/WorldQuiz.tsx`)
- World quiz → Continent mapping: groups progress (evidence: `src/WorldQuiz.tsx`)
- World quiz → Sidebar layout: renders (evidence: `src/WorldQuiz.tsx`)
- World quiz → Globe status: renders (evidence: `src/WorldQuiz.tsx`)
- Capitals quiz → Guess aliases: matches guesses (evidence: `src/CapitalsQuiz.tsx`)
- Capitals quiz → Continent mapping: groups progress (evidence: `src/CapitalsQuiz.tsx`)
- Capitals quiz → Capital data: uses capital list (evidence: `src/CapitalsQuiz.tsx`)
- Capitals quiz → Sidebar layout: renders (evidence: `src/CapitalsQuiz.tsx`)
- Capitals quiz → Globe status: renders (evidence: `src/CapitalsQuiz.tsx`)
- World quiz → Viewport sizing: sizes layout (evidence: `src/WorldQuiz.tsx`)
- Capitals quiz → Viewport sizing: sizes layout (evidence: `src/CapitalsQuiz.tsx`)
