# stephen-t-2023/dreambound architecture

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

- Interactive diagram: https://gitdiagram.com/stephen-t-2023/dreambound
- Repository: https://github.com/stephen-t-2023/dreambound

## Overview

DreamBound is a browser-based interactive story game. The player starts from the menu, enters a branching narrative, and can review recorded choices or return to the menu; a separate end scene is routed by the app. Shared audio playback and volume controls are available through settings. The sampled code establishes the router, choice-history handoff, and audio-control wiring. The story-data module is indexed as a dependency but was not excerpted, so its internal branches are not expanded here.

Main entry points: [`src/App.jsx`](https://github.com/stephen-t-2023/dreambound/blob/main/src/App.jsx) (Route shell), [`src/choice_screen.jsx`](https://github.com/stephen-t-2023/dreambound/blob/main/src/choice_screen.jsx) (Choice story), [`src/main_menu.jsx`](https://github.com/stephen-t-2023/dreambound/blob/main/src/main_menu.jsx) (Main menu), [`src/components/settings.jsx`](https://github.com/stephen-t-2023/dreambound/blob/main/src/components/settings.jsx) (Settings modal)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_game["Game screens"]
  node_menu["Main menu<br/>[main_menu.jsx]"]
  node_story["Choice story<br/>[choice_screen.jsx]"]
  node_storydata["Story content<br/>[textData.jsx]"]
  node_reflection["Choice reflection"]
  node_ending["End scene<br/>[end_scene.jsx]"]
end

subgraph group_audio["Audio controls"]
  node_settings["Settings modal<br/>[settings.jsx]"]
  node_playercontrols["Audio player<br/>[AudioPlayer.jsx]"]
  node_audiostate["Shared audio state<br/>[AudioContext.jsx]"]
  node_track["Background track"]
end

subgraph group_runtime["App runtime"]
  node_entry["React entry<br/>[main.jsx]"]
  node_router["Route shell<br/>[App.jsx]"]
end

node_player(("Player"))

node_player -->|"opens game"| node_entry
node_entry -->|"renders"| node_router
node_router -->|"routes home"| node_menu
node_router -->|"routes choices"| node_story
node_router -->|"routes reflection"| node_reflection
node_router -->|"routes ending"| node_ending
node_menu -->|"navigates to"| node_story
node_story -->|"reads story"| node_storydata
node_story -->|"passes history"| node_reflection
node_menu -->|"opens"| node_settings
node_story -->|"opens"| node_settings
node_settings -->|"renders"| node_playercontrols
node_playercontrols -->|"uses controls"| node_audiostate
node_menu -->|"starts audio"| node_audiostate
node_audiostate -->|"plays track"| node_track

click node_entry "https://github.com/stephen-t-2023/dreambound/blob/main/src/main.jsx"
click node_router "https://github.com/stephen-t-2023/dreambound/blob/main/src/App.jsx"
click node_menu "https://github.com/stephen-t-2023/dreambound/blob/main/src/main_menu.jsx"
click node_story "https://github.com/stephen-t-2023/dreambound/blob/main/src/choice_screen.jsx"
click node_storydata "https://github.com/stephen-t-2023/dreambound/blob/main/src/assets/textData.jsx"
click node_reflection "https://github.com/stephen-t-2023/dreambound/blob/main/src/reflect_choices.jsx"
click node_ending "https://github.com/stephen-t-2023/dreambound/blob/main/src/end_scene.jsx"
click node_settings "https://github.com/stephen-t-2023/dreambound/blob/main/src/components/settings.jsx"
click node_playercontrols "https://github.com/stephen-t-2023/dreambound/blob/main/src/components/AudioPlayer.jsx"
click node_audiostate "https://github.com/stephen-t-2023/dreambound/blob/main/src/components/AudioContext.jsx"
click node_track "https://github.com/stephen-t-2023/dreambound/blob/main/src/assets/background_loop.mp3"

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_menu,node_story,node_storydata,node_reflection,node_ending toneBlue
class node_settings,node_playercontrols,node_audiostate,node_track toneAmber
class node_entry,node_router toneMint
class node_player toneIndigo
```

## Components

### Game screens

- [Main menu](https://github.com/stephen-t-2023/dreambound/blob/main/src/main_menu.jsx): `src/main_menu.jsx`
- [Choice story](https://github.com/stephen-t-2023/dreambound/blob/main/src/choice_screen.jsx): `src/choice_screen.jsx`
- [Story content](https://github.com/stephen-t-2023/dreambound/blob/main/src/assets/textData.jsx): `src/assets/textData.jsx`
- [Choice reflection](https://github.com/stephen-t-2023/dreambound/blob/main/src/reflect_choices.jsx): `src/reflect_choices.jsx`
- [End scene](https://github.com/stephen-t-2023/dreambound/blob/main/src/end_scene.jsx): `src/end_scene.jsx`

### Audio controls

- [Settings modal](https://github.com/stephen-t-2023/dreambound/blob/main/src/components/settings.jsx): `src/components/settings.jsx`
- [Audio player](https://github.com/stephen-t-2023/dreambound/blob/main/src/components/AudioPlayer.jsx): `src/components/AudioPlayer.jsx`
- [Shared audio state](https://github.com/stephen-t-2023/dreambound/blob/main/src/components/AudioContext.jsx): `src/components/AudioContext.jsx`
- [Background track](https://github.com/stephen-t-2023/dreambound/blob/main/src/assets/background_loop.mp3): `src/assets/background_loop.mp3`

### App runtime

- [React entry](https://github.com/stephen-t-2023/dreambound/blob/main/src/main.jsx): `src/main.jsx`
- [Route shell](https://github.com/stephen-t-2023/dreambound/blob/main/src/App.jsx): `src/App.jsx`

### Other components

- **Player**

## Connections

- Player → React entry: opens game
- React entry → Route shell: renders (evidence: `src/main.jsx`)
- Route shell → Main menu: routes home (evidence: `src/App.jsx`)
- Route shell → Choice story: routes choices (evidence: `src/App.jsx`)
- Route shell → Choice reflection: routes reflection (evidence: `src/App.jsx`)
- Route shell → End scene: routes ending (evidence: `src/App.jsx`)
- Main menu → Choice story: navigates to (evidence: `src/main_menu.jsx`)
- Choice story → Story content: reads story (evidence: `src/choice_screen.jsx`)
- Choice story → Choice reflection: passes history (evidence: `src/choice_screen.jsx`)
- Main menu → Settings modal: opens (evidence: `src/main_menu.jsx`)
- Choice story → Settings modal: opens (evidence: `src/choice_screen.jsx`)
- Settings modal → Audio player: renders (evidence: `src/components/settings.jsx`)
- Audio player → Shared audio state: uses controls (evidence: `src/components/AudioPlayer.jsx`)
- Main menu → Shared audio state: starts audio (evidence: `src/main_menu.jsx`)
- Shared audio state → Background track: plays track (evidence: `src/components/AudioContext.jsx`)
