# bluebleaze/bellbound architecture

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

- Interactive diagram: https://gitdiagram.com/bluebleaze/bellbound
- Repository: https://github.com/bluebleaze/bellbound

## Overview

Bellbound is an educational pixel-art RPG: players customize a student, explore the school, trigger teacher exams, dodge subject-specific attacks, answer quiz questions, and progress toward a multi-stage ending. The graph preserves the README’s major support features—study aids, schedule, tutorial, dev menu, audio, and character rendering—alongside that main loop. Relationships are based on the README and the supplied source index or excerpts; some UI routing details are documented but not visible in the sampled code, so those links are dashed.

Main entry points: [`src/App.tsx`](https://github.com/bluebleaze/bellbound/blob/main/src/App.tsx) (Game State Manager), [`src/components/Overworld.tsx`](https://github.com/bluebleaze/bellbound/blob/main/src/components/Overworld.tsx) (School Overworld), [`src/components/BattleArena.tsx`](https://github.com/bluebleaze/bellbound/blob/main/src/components/BattleArena.tsx) (Teacher Battles), [`src/data/questions.ts`](https://github.com/bluebleaze/bellbound/blob/main/src/data/questions.ts) (Subject Question Bank)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_gameflow["Game Flow"]
  node_app["Game State Manager<br/>[App.tsx]"]
  node_types["Game Types &amp; Schedule<br/>[types.ts]"]
end

subgraph group_worldbattle["World &amp; Battle"]
  node_overworld["School Overworld<br/>[Overworld.tsx]"]
  node_battle["Teacher Battles<br/>[BattleArena.tsx]"]
end

subgraph group_learning["Learning &amp; Results"]
  node_questions["Subject Question Bank<br/>[questions.ts]"]
  node_notes["Study Notes"]
  node_schedule["Class Schedule<br/>[ScheduleModal.tsx]"]
  node_victory["Victory Summary<br/>[VictoryModal.tsx]"]
  node_ending["Three-Stage Ending<br/>[EndingModal.tsx]"]
end

subgraph group_presentation["Character &amp; UI"]
  node_login["Login &amp; Difficulty<br/>[LoginScreen.tsx]"]
  node_customizer["Character Customizer"]
  node_sprites["Pixel Sprite Renderer<br/>[PixelSprites.ts]"]
  node_hud["Header HUD<br/>[HeaderHUD.tsx]"]
  node_sidebar["Game Sidebar<br/>[GameSidebar.tsx]"]
  node_tutorial["Tutorial<br/>[TutorialModal.tsx]"]
  node_devmenu["Developer Menu<br/>[DevMenuModal.tsx]"]
end

subgraph group_audio["Audio"]
  node_audiofx["Synthesized Sound Effects<br/>[AudioEngine.ts]"]
  node_music["Music Playback Engine<br/>[MusicEngine.ts]"]
end

node_player(("Player"))

node_player -->|"plays"| node_app
node_app -.->|"shows exploration"| node_overworld
node_overworld -.->|"starts exam"| node_app
node_app -.->|"shows battle"| node_battle
node_battle -->|"uses questions"| node_questions
node_battle -->|"draws teacher"| node_sprites
node_battle -->|"plays effects"| node_audiofx
node_battle -.->|"reports victory"| node_app
node_app -->|"shows login"| node_login
node_app -->|"shows customization"| node_customizer
node_app -->|"renders HUD"| node_hud
node_app -->|"renders sidebar"| node_sidebar
node_app -->|"shows tutorial"| node_tutorial
node_app -->|"offers dev controls"| node_devmenu
node_app -->|"shows study notes"| node_notes
node_app -->|"shows schedule"| node_schedule
node_app -->|"shows victory"| node_victory
node_app -->|"opens final ending"| node_ending
node_login -->|"previews character"| node_sprites
node_customizer -->|"renders preview"| node_sprites
node_overworld -->|"draws school sprites"| node_sprites
node_overworld -->|"reads teacher data"| node_questions
node_overworld -->|"plays effects"| node_audiofx
node_notes -->|"reads study notes"| node_questions
node_victory -->|"reads subject data"| node_questions
node_ending -->|"reads teacher data"| node_questions
node_ending -->|"renders character"| node_sprites
node_overworld -.->|"requests exam start"| node_app
node_app -.->|"synchronizes music"| node_music
node_hud -->|"plays effects"| node_audiofx
node_app -->|"controls sound"| node_audiofx
node_app -->|"uses game state types"| node_types
node_overworld -->|"uses schedule types"| node_types

click node_app "https://github.com/bluebleaze/bellbound/blob/main/src/App.tsx"
click node_overworld "https://github.com/bluebleaze/bellbound/blob/main/src/components/Overworld.tsx"
click node_battle "https://github.com/bluebleaze/bellbound/blob/main/src/components/BattleArena.tsx"
click node_questions "https://github.com/bluebleaze/bellbound/blob/main/src/data/questions.ts"
click node_notes "https://github.com/bluebleaze/bellbound/blob/main/src/components/StudyNotesModal.tsx"
click node_schedule "https://github.com/bluebleaze/bellbound/blob/main/src/components/ScheduleModal.tsx"
click node_victory "https://github.com/bluebleaze/bellbound/blob/main/src/components/VictoryModal.tsx"
click node_ending "https://github.com/bluebleaze/bellbound/blob/main/src/components/EndingModal.tsx"
click node_login "https://github.com/bluebleaze/bellbound/blob/main/src/components/LoginScreen.tsx"
click node_customizer "https://github.com/bluebleaze/bellbound/blob/main/src/components/CustomizerModal.tsx"
click node_sprites "https://github.com/bluebleaze/bellbound/blob/main/src/components/PixelSprites.ts"
click node_hud "https://github.com/bluebleaze/bellbound/blob/main/src/components/HeaderHUD.tsx"
click node_sidebar "https://github.com/bluebleaze/bellbound/blob/main/src/components/GameSidebar.tsx"
click node_tutorial "https://github.com/bluebleaze/bellbound/blob/main/src/components/TutorialModal.tsx"
click node_devmenu "https://github.com/bluebleaze/bellbound/blob/main/src/components/DevMenuModal.tsx"
click node_types "https://github.com/bluebleaze/bellbound/blob/main/src/types.ts"
click node_audiofx "https://github.com/bluebleaze/bellbound/blob/main/src/utils/AudioEngine.ts"
click node_music "https://github.com/bluebleaze/bellbound/blob/main/src/utils/MusicEngine.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_types toneBlue
class node_overworld,node_battle toneAmber
class node_questions,node_notes,node_schedule,node_victory,node_ending toneMint
class node_login,node_customizer,node_sprites,node_hud,node_sidebar,node_tutorial,node_devmenu toneRose
class node_audiofx,node_music,node_player toneIndigo
```

## Components

### Game Flow

- [Game State Manager](https://github.com/bluebleaze/bellbound/blob/main/src/App.tsx): `src/App.tsx`
- [Game Types & Schedule](https://github.com/bluebleaze/bellbound/blob/main/src/types.ts): `src/types.ts`

### World & Battle

- [School Overworld](https://github.com/bluebleaze/bellbound/blob/main/src/components/Overworld.tsx): `src/components/Overworld.tsx`
- [Teacher Battles](https://github.com/bluebleaze/bellbound/blob/main/src/components/BattleArena.tsx): `src/components/BattleArena.tsx`

### Learning & Results

- [Subject Question Bank](https://github.com/bluebleaze/bellbound/blob/main/src/data/questions.ts): `src/data/questions.ts`
- [Study Notes](https://github.com/bluebleaze/bellbound/blob/main/src/components/StudyNotesModal.tsx): `src/components/StudyNotesModal.tsx`
- [Class Schedule](https://github.com/bluebleaze/bellbound/blob/main/src/components/ScheduleModal.tsx): `src/components/ScheduleModal.tsx`
- [Victory Summary](https://github.com/bluebleaze/bellbound/blob/main/src/components/VictoryModal.tsx): `src/components/VictoryModal.tsx`
- [Three-Stage Ending](https://github.com/bluebleaze/bellbound/blob/main/src/components/EndingModal.tsx): `src/components/EndingModal.tsx`

### Character & UI

- [Login & Difficulty](https://github.com/bluebleaze/bellbound/blob/main/src/components/LoginScreen.tsx): `src/components/LoginScreen.tsx`
- [Character Customizer](https://github.com/bluebleaze/bellbound/blob/main/src/components/CustomizerModal.tsx): `src/components/CustomizerModal.tsx`
- [Pixel Sprite Renderer](https://github.com/bluebleaze/bellbound/blob/main/src/components/PixelSprites.ts): `src/components/PixelSprites.ts`
- [Header HUD](https://github.com/bluebleaze/bellbound/blob/main/src/components/HeaderHUD.tsx): `src/components/HeaderHUD.tsx`
- [Game Sidebar](https://github.com/bluebleaze/bellbound/blob/main/src/components/GameSidebar.tsx): `src/components/GameSidebar.tsx`
- [Tutorial](https://github.com/bluebleaze/bellbound/blob/main/src/components/TutorialModal.tsx): `src/components/TutorialModal.tsx`
- [Developer Menu](https://github.com/bluebleaze/bellbound/blob/main/src/components/DevMenuModal.tsx): `src/components/DevMenuModal.tsx`

### Audio

- [Synthesized Sound Effects](https://github.com/bluebleaze/bellbound/blob/main/src/utils/AudioEngine.ts): `src/utils/AudioEngine.ts`
- [Music Playback Engine](https://github.com/bluebleaze/bellbound/blob/main/src/utils/MusicEngine.ts): `src/utils/MusicEngine.ts`

### Other components

- **Player**

## Connections

- Player → Game State Manager: plays (evidence: `README.md`)
- Game State Manager → School Overworld: shows exploration (evidence: `src/App.tsx`)
- School Overworld → Game State Manager: starts exam (evidence: `src/App.tsx`)
- Game State Manager → Teacher Battles: shows battle (evidence: `src/App.tsx`)
- Teacher Battles → Subject Question Bank: uses questions (evidence: `src/components/BattleArena.tsx`)
- Teacher Battles → Pixel Sprite Renderer: draws teacher (evidence: `src/components/BattleArena.tsx`)
- Teacher Battles → Synthesized Sound Effects: plays effects (evidence: `src/components/BattleArena.tsx`)
- Teacher Battles → Game State Manager: reports victory (evidence: `src/App.tsx`)
- Game State Manager → Login & Difficulty: shows login (evidence: `src/App.tsx`)
- Game State Manager → Character Customizer: shows customization (evidence: `src/App.tsx`)
- Game State Manager → Header HUD: renders HUD (evidence: `src/App.tsx`)
- Game State Manager → Game Sidebar: renders sidebar (evidence: `src/App.tsx`)
- Game State Manager → Tutorial: shows tutorial (evidence: `src/App.tsx`)
- Game State Manager → Developer Menu: offers dev controls (evidence: `src/App.tsx`)
- Game State Manager → Study Notes: shows study notes (evidence: `src/App.tsx`)
- Game State Manager → Class Schedule: shows schedule (evidence: `src/App.tsx`)
- Game State Manager → Victory Summary: shows victory (evidence: `src/App.tsx`)
- Game State Manager → Three-Stage Ending: opens final ending (evidence: `src/App.tsx`)
- Login & Difficulty → Pixel Sprite Renderer: previews character (evidence: `src/components/LoginScreen.tsx`)
- Character Customizer → Pixel Sprite Renderer: renders preview (evidence: `src/components/CustomizerModal.tsx`)
- School Overworld → Pixel Sprite Renderer: draws school sprites (evidence: `src/components/Overworld.tsx`)
- School Overworld → Subject Question Bank: reads teacher data (evidence: `src/components/Overworld.tsx`)
- School Overworld → Synthesized Sound Effects: plays effects (evidence: `src/components/Overworld.tsx`)
- Study Notes → Subject Question Bank: reads study notes (evidence: `src/components/StudyNotesModal.tsx`)
- Victory Summary → Subject Question Bank: reads subject data (evidence: `src/components/VictoryModal.tsx`)
- Three-Stage Ending → Subject Question Bank: reads teacher data (evidence: `src/components/EndingModal.tsx`)
- Three-Stage Ending → Pixel Sprite Renderer: renders character (evidence: `src/components/EndingModal.tsx`)
- School Overworld → Game State Manager: requests exam start (evidence: `src/App.tsx`)
- Game State Manager → Music Playback Engine: synchronizes music (evidence: `README.md`)
- Header HUD → Synthesized Sound Effects: plays effects (evidence: `src/components/HeaderHUD.tsx`)
- Game State Manager → Synthesized Sound Effects: controls sound (evidence: `src/App.tsx`)
- Game State Manager → Game Types & Schedule: uses game state types (evidence: `src/App.tsx`)
- School Overworld → Game Types & Schedule: uses schedule types (evidence: `src/components/Overworld.tsx`)
