# emdyeray/library-of-stars architecture

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

- Interactive diagram: https://gitdiagram.com/emdyeray/library-of-stars
- Repository: https://github.com/emdyeray/library-of-stars

## Overview

Starry Library is a native interactive 3D reading application. The principal workflow is to browse a room or catalog, select a book, approach and open it, then read and turn illustrated pages with animated pop-ups; a separate lectern provides mission references. The map preserves the documented bilingual catalogs and reading collections. Edges follow README statements or source-index references; desktop event-loop and several runtime links are only documented or implied, so uncertain links are omitted or dashed.

Main entry points: [`src/library.cpp`](https://github.com/emdyeray/library-of-stars/blob/main/src/library.cpp) (Book collections), [`src/locale.hpp`](https://github.com/emdyeray/library-of-stars/blob/main/src/locale.hpp) (Language selection), [`src/ui.cpp`](https://github.com/emdyeray/library-of-stars/blob/main/src/ui.cpp) (Interface interaction), [`src/render.cpp`](https://github.com/emdyeray/library-of-stars/blob/main/src/render.cpp) (3D renderer)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Desktop experience"]
  node_entry["Application entry<br/>[main.cpp]"]
  node_desktop["Desktop window<br/>[desktop.cpp]"]
  node_interaction["Interface interaction<br/>[ui.cpp]"]
end

subgraph group_reading["Reading and content"]
  node_library["Library state<br/>[library.cpp]"]
  node_catalog["Book collections<br/>[library.cpp]"]
  node_stories["Original stories<br/>[stories.cpp]"]
  node_childtext["Children's readings<br/>[child_text.cpp]"]
  node_adultbooks["Adult readings<br/>[adult_books.cpp]"]
  node_imported["Adapted readings<br/>[imported_books.cpp]"]
  node_technical["Technical notes"]
end

subgraph group_world["Rooms and rendering"]
  node_rooms["Room navigation<br/>[room.cpp]"]
  node_layout["Room layout<br/>[room_layout.cpp]"]
  node_renderer["3D renderer<br/>[render.cpp]"]
end

subgraph group_visuals["Pages and pop-ups"]
  node_printing["Book page artwork<br/>[printing.cpp]"]
  node_popup["Foldable pop-ups<br/>[popup.cpp]"]
end

subgraph group_language["Language and references"]
  node_locale["Language selection<br/>[locale.hpp]"]
  node_references["Mission references<br/>[references.hpp]"]
end

node_reader(("Library visitor"))

node_reader -->|"uses controls"| node_desktop
node_entry -->|"starts"| node_desktop
node_desktop -.->|"dispatches input"| node_interaction
node_interaction -->|"selects and reads"| node_library
node_library -->|"provides catalog"| node_catalog
node_library -.->|"navigates rooms"| node_rooms
node_library -->|"uses layout"| node_layout
node_library -->|"uses language"| node_locale
node_catalog -->|"uses stories"| node_stories
node_catalog -->|"uses readings"| node_childtext
node_catalog -->|"uses readings"| node_adultbooks
node_catalog -->|"uses readings"| node_imported
node_catalog -->|"uses notes"| node_technical
node_interaction -->|"opens links"| node_references
node_interaction -.->|"requests drawing"| node_renderer
node_renderer -->|"draws rooms"| node_rooms
node_renderer -->|"renders pages"| node_printing
node_renderer -->|"loads scenes"| node_popup
node_printing -->|"uses chapter art"| node_stories
node_popup -->|"maps figures"| node_stories
node_locale -->|"selects translation"| node_childtext
node_locale -->|"selects translation"| node_adultbooks
node_locale -->|"selects translation"| node_imported
node_locale -->|"selects translation"| node_technical

click node_entry "https://github.com/emdyeray/library-of-stars/blob/main/src/main.cpp"
click node_desktop "https://github.com/emdyeray/library-of-stars/blob/main/src/desktop.cpp"
click node_interaction "https://github.com/emdyeray/library-of-stars/blob/main/src/ui.cpp"
click node_library "https://github.com/emdyeray/library-of-stars/blob/main/src/library.cpp"
click node_catalog "https://github.com/emdyeray/library-of-stars/blob/main/src/library.cpp"
click node_stories "https://github.com/emdyeray/library-of-stars/blob/main/src/stories.cpp"
click node_childtext "https://github.com/emdyeray/library-of-stars/blob/main/src/child_text.cpp"
click node_adultbooks "https://github.com/emdyeray/library-of-stars/blob/main/src/adult_books.cpp"
click node_imported "https://github.com/emdyeray/library-of-stars/blob/main/src/imported_books.cpp"
click node_technical "https://github.com/emdyeray/library-of-stars/blob/main/src/technical_notes.cpp"
click node_rooms "https://github.com/emdyeray/library-of-stars/blob/main/src/room.cpp"
click node_layout "https://github.com/emdyeray/library-of-stars/blob/main/src/room_layout.cpp"
click node_renderer "https://github.com/emdyeray/library-of-stars/blob/main/src/render.cpp"
click node_printing "https://github.com/emdyeray/library-of-stars/blob/main/src/printing.cpp"
click node_popup "https://github.com/emdyeray/library-of-stars/blob/main/src/popup.cpp"
click node_locale "https://github.com/emdyeray/library-of-stars/blob/main/src/locale.hpp"
click node_references "https://github.com/emdyeray/library-of-stars/blob/main/src/references.hpp"

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_desktop,node_interaction toneBlue
class node_library,node_catalog,node_stories,node_childtext,node_adultbooks,node_imported,node_technical toneAmber
class node_rooms,node_layout,node_renderer toneMint
class node_printing,node_popup toneRose
class node_locale,node_references,node_reader toneIndigo
```

## Components

### Desktop experience

- [Application entry](https://github.com/emdyeray/library-of-stars/blob/main/src/main.cpp): `src/main.cpp`
- [Desktop window](https://github.com/emdyeray/library-of-stars/blob/main/src/desktop.cpp): `src/desktop.cpp`
- [Interface interaction](https://github.com/emdyeray/library-of-stars/blob/main/src/ui.cpp): `src/ui.cpp`

### Reading and content

- [Library state](https://github.com/emdyeray/library-of-stars/blob/main/src/library.cpp): `src/library.cpp`
- [Book collections](https://github.com/emdyeray/library-of-stars/blob/main/src/library.cpp): `src/library.cpp`
- [Original stories](https://github.com/emdyeray/library-of-stars/blob/main/src/stories.cpp): `src/stories.cpp`
- [Children's readings](https://github.com/emdyeray/library-of-stars/blob/main/src/child_text.cpp): `src/child_text.cpp`
- [Adult readings](https://github.com/emdyeray/library-of-stars/blob/main/src/adult_books.cpp): `src/adult_books.cpp`
- [Adapted readings](https://github.com/emdyeray/library-of-stars/blob/main/src/imported_books.cpp): `src/imported_books.cpp`
- [Technical notes](https://github.com/emdyeray/library-of-stars/blob/main/src/technical_notes.cpp): `src/technical_notes.cpp`

### Rooms and rendering

- [Room navigation](https://github.com/emdyeray/library-of-stars/blob/main/src/room.cpp): `src/room.cpp`
- [Room layout](https://github.com/emdyeray/library-of-stars/blob/main/src/room_layout.cpp): `src/room_layout.cpp`
- [3D renderer](https://github.com/emdyeray/library-of-stars/blob/main/src/render.cpp): `src/render.cpp`

### Pages and pop-ups

- [Book page artwork](https://github.com/emdyeray/library-of-stars/blob/main/src/printing.cpp): `src/printing.cpp`
- [Foldable pop-ups](https://github.com/emdyeray/library-of-stars/blob/main/src/popup.cpp): `src/popup.cpp`

### Language and references

- [Language selection](https://github.com/emdyeray/library-of-stars/blob/main/src/locale.hpp): `src/locale.hpp`
- [Mission references](https://github.com/emdyeray/library-of-stars/blob/main/src/references.hpp): `src/references.hpp`

### Other components

- **Library visitor**

## Connections

- Library visitor → Desktop window: uses controls (evidence: `README.md`)
- Application entry → Desktop window: starts (evidence: `src/main.cpp`)
- Desktop window → Interface interaction: dispatches input
- Interface interaction → Library state: selects and reads (evidence: `README.md`)
- Library state → Book collections: provides catalog (evidence: `src/library.cpp`)
- Library state → Room navigation: navigates rooms
- Library state → Room layout: uses layout (evidence: `src/library.cpp`)
- Library state → Language selection: uses language (evidence: `src/library.cpp`)
- Book collections → Original stories: uses stories (evidence: `src/library.cpp`)
- Book collections → Children's readings: uses readings (evidence: `src/library.cpp`)
- Book collections → Adult readings: uses readings (evidence: `src/library.cpp`)
- Book collections → Adapted readings: uses readings (evidence: `src/library.cpp`)
- Book collections → Technical notes: uses notes (evidence: `src/library.cpp`)
- Interface interaction → Mission references: opens links (evidence: `README.md`)
- Interface interaction → 3D renderer: requests drawing
- 3D renderer → Room navigation: draws rooms (evidence: `src/render.cpp`)
- 3D renderer → Book page artwork: renders pages (evidence: `src/render.cpp`)
- 3D renderer → Foldable pop-ups: loads scenes (evidence: `src/render.cpp`)
- Book page artwork → Original stories: uses chapter art (evidence: `src/printing.cpp`)
- Foldable pop-ups → Original stories: maps figures (evidence: `src/popup.cpp`)
- Language selection → Children's readings: selects translation (evidence: `src/locale.hpp`)
- Language selection → Adult readings: selects translation (evidence: `src/locale.hpp`)
- Language selection → Adapted readings: selects translation (evidence: `src/locale.hpp`)
- Language selection → Technical notes: selects translation (evidence: `src/locale.hpp`)
