# namelessproj/namelessstory architecture

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

- Interactive diagram: https://gitdiagram.com/namelessproj/namelessstory
- Repository: https://github.com/namelessproj/namelessstory

## Overview

NamelessStory is a React visual-novel engine: creators supply a JSON story and media, and players move from the title screen into scenes with dialogue, choices or text input, then may save, load, or view credits. The graph separates story loading/state, page navigation, gameplay orchestration, and presentation plus supporting text/audio behavior. Relationships are limited to README statements and the shown source/index references; some unsampled page and credit components are represented by their exact paths without inferred internal calls.

Main entry points: [`src/components/VisualNovelComponents/VisualNovel/index.tsx`](https://github.com/namelessproj/namelessstory/blob/main/src/components/VisualNovelComponents/VisualNovel/index.tsx) (Gameplay controller), [`src/components/VNPlayer/index.tsx`](https://github.com/namelessproj/namelessstory/blob/main/src/components/VNPlayer/index.tsx) (Story loader), [`src/components/VisualNovelComponents/Scene/index.tsx`](https://github.com/namelessproj/namelessstory/blob/main/src/components/VisualNovelComponents/Scene/index.tsx) (Scene renderer), [`src/components/PageToDisplay/index.tsx`](https://github.com/namelessproj/namelessstory/blob/main/src/components/PageToDisplay/index.tsx) (Page dispatcher)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_loading["Story and state"]
  node_player["Story loader<br/>[index.tsx]"]
  node_schema["Story validation<br/>[storySchema.ts]"]
  node_provider["Shared state provider<br/>[DataProvider.tsx]"]
  node_datactx["Game state context<br/>[DataContext.ts]"]
  node_typectx["Typing state context"]
end

subgraph group_pages["Page navigation"]
  node_app["Application entry<br/>[App.tsx]"]
  node_dispatch["Page dispatcher<br/>[index.tsx]"]
  node_title["Title screen<br/>[index.tsx]"]
  node_credits["Credits screen<br/>[index.tsx]"]
end

subgraph group_gameplay["Novel gameplay"]
  node_novel["Gameplay controller<br/>[index.tsx]"]
  node_scene["Scene renderer<br/>[index.tsx]"]
end

subgraph group_presentation["Presentation and media"]
  node_dialogue["Dialogue display<br/>[index.tsx]"]
  node_options["Choice options<br/>[index.tsx]"]
  node_input["Player text input<br/>[index.tsx]"]
  node_sprite["Character sprites<br/>[index.tsx]"]
  node_background["Scene backgrounds<br/>[index.tsx]"]
  node_overlays["Gameplay overlays<br/>[index.tsx]"]
  node_transitions["Transition effects<br/>[index.tsx]"]
end

subgraph group_support["Text and persistence"]
  node_typewriter["Typewriter display<br/>[index.tsx]"]
  node_markup["Text formatting<br/>[markupParser.ts]"]
  node_tokenizer["Typing and pauses<br/>[typewriterUtils.ts]"]
  node_audio["Background music<br/>[useBGM.ts]"]
  node_volume["Volume control<br/>[index.tsx]"]
  node_save["Save and load<br/>[saveFile.ts]"]
  node_storage[("Browser save storage<br/>[saveStorage.ts]")]
end

node_author(("Story creator"))
node_story["Story JSON"]

node_author -->|"writes"| node_story
node_story -->|"loads"| node_player
node_player -->|"validates"| node_schema
node_player -->|"loads save"| node_storage
node_player -->|"parses save"| node_save
node_player -->|"provides state"| node_provider
node_provider -->|"provides"| node_datactx
node_provider -->|"provides"| node_typectx
node_app -->|"renders"| node_player
node_player -->|"renders"| node_dispatch
node_dispatch -->|"selects page"| node_title
node_dispatch -->|"selects page"| node_credits
node_dispatch -->|"selects page"| node_novel
node_title -->|"loads save"| node_save
node_novel -->|"renders"| node_scene
node_novel -->|"renders"| node_overlays
node_novel -->|"renders"| node_transitions
node_novel -->|"controls music"| node_audio
node_novel -->|"saves state"| node_storage
node_novel -->|"exports save"| node_save
node_scene -->|"renders"| node_background
node_scene -->|"renders"| node_sprite
node_scene -->|"renders"| node_dialogue
node_scene -->|"renders"| node_options
node_scene -->|"renders"| node_input
node_dialogue -->|"renders"| node_typewriter
node_typewriter -->|"parses markup"| node_markup
node_typewriter -->|"tokenizes text"| node_tokenizer
node_volume -->|"controls volume"| node_audio

click node_player "https://github.com/namelessproj/namelessstory/blob/main/src/components/VNPlayer/index.tsx"
click node_schema "https://github.com/namelessproj/namelessstory/blob/main/src/utils/storySchema.ts"
click node_provider "https://github.com/namelessproj/namelessstory/blob/main/src/context/DataProvider.tsx"
click node_datactx "https://github.com/namelessproj/namelessstory/blob/main/src/context/DataContext.ts"
click node_typectx "https://github.com/namelessproj/namelessstory/blob/main/src/context/TypewriterContext.ts"
click node_app "https://github.com/namelessproj/namelessstory/blob/main/src/App.tsx"
click node_dispatch "https://github.com/namelessproj/namelessstory/blob/main/src/components/PageToDisplay/index.tsx"
click node_title "https://github.com/namelessproj/namelessstory/blob/main/src/components/TitleScreen/index.tsx"
click node_credits "https://github.com/namelessproj/namelessstory/blob/main/src/components/CreditsComponents/CreditsPage/index.tsx"
click node_novel "https://github.com/namelessproj/namelessstory/blob/main/src/components/VisualNovelComponents/VisualNovel/index.tsx"
click node_scene "https://github.com/namelessproj/namelessstory/blob/main/src/components/VisualNovelComponents/Scene/index.tsx"
click node_dialogue "https://github.com/namelessproj/namelessstory/blob/main/src/components/VisualNovelComponents/Dialogue/index.tsx"
click node_options "https://github.com/namelessproj/namelessstory/blob/main/src/components/VisualNovelComponents/OptionsGroup/index.tsx"
click node_input "https://github.com/namelessproj/namelessstory/blob/main/src/components/VisualNovelComponents/UserInput/index.tsx"
click node_sprite "https://github.com/namelessproj/namelessstory/blob/main/src/components/VisualNovelComponents/CharacterFullSprite/index.tsx"
click node_background "https://github.com/namelessproj/namelessstory/blob/main/src/components/BackgroundImage/index.tsx"
click node_overlays "https://github.com/namelessproj/namelessstory/blob/main/src/components/VisualNovelComponents/VNTopOverlay/index.tsx"
click node_transitions "https://github.com/namelessproj/namelessstory/blob/main/src/components/VisualNovelComponents/TransitionOverlay/index.tsx"
click node_typewriter "https://github.com/namelessproj/namelessstory/blob/main/src/components/Typewriter/index.tsx"
click node_markup "https://github.com/namelessproj/namelessstory/blob/main/src/utils/markupParser.ts"
click node_tokenizer "https://github.com/namelessproj/namelessstory/blob/main/src/utils/typewriterUtils.ts"
click node_audio "https://github.com/namelessproj/namelessstory/blob/main/src/hooks/useBGM.ts"
click node_volume "https://github.com/namelessproj/namelessstory/blob/main/src/components/VolumeSlider/index.tsx"
click node_save "https://github.com/namelessproj/namelessstory/blob/main/src/utils/saveFile.ts"
click node_storage "https://github.com/namelessproj/namelessstory/blob/main/src/utils/saveStorage.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_player,node_schema,node_provider,node_datactx,node_typectx toneBlue
class node_app,node_dispatch,node_title,node_credits toneAmber
class node_novel,node_scene toneMint
class node_dialogue,node_options,node_input,node_sprite,node_background,node_overlays,node_transitions toneRose
class node_typewriter,node_markup,node_tokenizer,node_audio,node_volume,node_save,node_storage,node_author,node_story toneIndigo
```

## Components

### Story and state

- [Story loader](https://github.com/namelessproj/namelessstory/blob/main/src/components/VNPlayer/index.tsx): `src/components/VNPlayer/index.tsx`
- [Story validation](https://github.com/namelessproj/namelessstory/blob/main/src/utils/storySchema.ts): `src/utils/storySchema.ts`
- [Shared state provider](https://github.com/namelessproj/namelessstory/blob/main/src/context/DataProvider.tsx): `src/context/DataProvider.tsx`
- [Game state context](https://github.com/namelessproj/namelessstory/blob/main/src/context/DataContext.ts): `src/context/DataContext.ts`
- [Typing state context](https://github.com/namelessproj/namelessstory/blob/main/src/context/TypewriterContext.ts): `src/context/TypewriterContext.ts`

### Page navigation

- [Application entry](https://github.com/namelessproj/namelessstory/blob/main/src/App.tsx): `src/App.tsx`
- [Page dispatcher](https://github.com/namelessproj/namelessstory/blob/main/src/components/PageToDisplay/index.tsx): `src/components/PageToDisplay/index.tsx`
- [Title screen](https://github.com/namelessproj/namelessstory/blob/main/src/components/TitleScreen/index.tsx): `src/components/TitleScreen/index.tsx`
- [Credits screen](https://github.com/namelessproj/namelessstory/blob/main/src/components/CreditsComponents/CreditsPage/index.tsx): `src/components/CreditsComponents/CreditsPage/index.tsx`

### Novel gameplay

- [Gameplay controller](https://github.com/namelessproj/namelessstory/blob/main/src/components/VisualNovelComponents/VisualNovel/index.tsx): `src/components/VisualNovelComponents/VisualNovel/index.tsx`
- [Scene renderer](https://github.com/namelessproj/namelessstory/blob/main/src/components/VisualNovelComponents/Scene/index.tsx): `src/components/VisualNovelComponents/Scene/index.tsx`

### Presentation and media

- [Dialogue display](https://github.com/namelessproj/namelessstory/blob/main/src/components/VisualNovelComponents/Dialogue/index.tsx): `src/components/VisualNovelComponents/Dialogue/index.tsx`
- [Choice options](https://github.com/namelessproj/namelessstory/blob/main/src/components/VisualNovelComponents/OptionsGroup/index.tsx): `src/components/VisualNovelComponents/OptionsGroup/index.tsx`
- [Player text input](https://github.com/namelessproj/namelessstory/blob/main/src/components/VisualNovelComponents/UserInput/index.tsx): `src/components/VisualNovelComponents/UserInput/index.tsx`
- [Character sprites](https://github.com/namelessproj/namelessstory/blob/main/src/components/VisualNovelComponents/CharacterFullSprite/index.tsx): `src/components/VisualNovelComponents/CharacterFullSprite/index.tsx`
- [Scene backgrounds](https://github.com/namelessproj/namelessstory/blob/main/src/components/BackgroundImage/index.tsx): `src/components/BackgroundImage/index.tsx`
- [Gameplay overlays](https://github.com/namelessproj/namelessstory/blob/main/src/components/VisualNovelComponents/VNTopOverlay/index.tsx): `src/components/VisualNovelComponents/VNTopOverlay/index.tsx`
- [Transition effects](https://github.com/namelessproj/namelessstory/blob/main/src/components/VisualNovelComponents/TransitionOverlay/index.tsx): `src/components/VisualNovelComponents/TransitionOverlay/index.tsx`

### Text and persistence

- [Typewriter display](https://github.com/namelessproj/namelessstory/blob/main/src/components/Typewriter/index.tsx): `src/components/Typewriter/index.tsx`
- [Text formatting](https://github.com/namelessproj/namelessstory/blob/main/src/utils/markupParser.ts): `src/utils/markupParser.ts`
- [Typing and pauses](https://github.com/namelessproj/namelessstory/blob/main/src/utils/typewriterUtils.ts): `src/utils/typewriterUtils.ts`
- [Background music](https://github.com/namelessproj/namelessstory/blob/main/src/hooks/useBGM.ts): `src/hooks/useBGM.ts`
- [Volume control](https://github.com/namelessproj/namelessstory/blob/main/src/components/VolumeSlider/index.tsx): `src/components/VolumeSlider/index.tsx`
- [Save and load](https://github.com/namelessproj/namelessstory/blob/main/src/utils/saveFile.ts): `src/utils/saveFile.ts`
- [Browser save storage](https://github.com/namelessproj/namelessstory/blob/main/src/utils/saveStorage.ts): `src/utils/saveStorage.ts`

### Other components

- **Story creator**
- **Story JSON**

## Connections

- Story creator → Story JSON: writes (evidence: `README.md`)
- Story JSON → Story loader: loads (evidence: `src/components/VNPlayer/index.tsx`)
- Story loader → Story validation: validates (evidence: `src/components/VNPlayer/index.tsx`)
- Story loader → Browser save storage: loads save (evidence: `src/components/VNPlayer/index.tsx`)
- Story loader → Save and load: parses save (evidence: `src/components/VNPlayer/index.tsx`)
- Story loader → Shared state provider: provides state (evidence: `src/components/VNPlayer/index.tsx`)
- Shared state provider → Game state context: provides (evidence: `src/context/DataProvider.tsx`)
- Shared state provider → Typing state context: provides (evidence: `src/context/DataProvider.tsx`)
- Application entry → Story loader: renders (evidence: `src/App.tsx`)
- Story loader → Page dispatcher: renders (evidence: `src/components/VNPlayer/index.tsx`)
- Page dispatcher → Title screen: selects page (evidence: `src/components/PageToDisplay/index.tsx`)
- Page dispatcher → Credits screen: selects page (evidence: `src/components/PageToDisplay/index.tsx`)
- Page dispatcher → Gameplay controller: selects page (evidence: `src/components/PageToDisplay/index.tsx`)
- Title screen → Save and load: loads save (evidence: `src/components/TitleScreen/index.tsx`)
- Gameplay controller → Scene renderer: renders (evidence: `src/components/VisualNovelComponents/VisualNovel/index.tsx`)
- Gameplay controller → Gameplay overlays: renders (evidence: `src/components/VisualNovelComponents/VisualNovel/index.tsx`)
- Gameplay controller → Transition effects: renders (evidence: `src/components/VisualNovelComponents/VisualNovel/index.tsx`)
- Gameplay controller → Background music: controls music (evidence: `src/components/VisualNovelComponents/VisualNovel/index.tsx`)
- Gameplay controller → Browser save storage: saves state (evidence: `src/components/VisualNovelComponents/VisualNovel/index.tsx`)
- Gameplay controller → Save and load: exports save (evidence: `src/components/VisualNovelComponents/VisualNovel/index.tsx`)
- Scene renderer → Scene backgrounds: renders (evidence: `src/components/VisualNovelComponents/Scene/index.tsx`)
- Scene renderer → Character sprites: renders (evidence: `src/components/VisualNovelComponents/Scene/index.tsx`)
- Scene renderer → Dialogue display: renders (evidence: `src/components/VisualNovelComponents/Scene/index.tsx`)
- Scene renderer → Choice options: renders (evidence: `src/components/VisualNovelComponents/Scene/index.tsx`)
- Scene renderer → Player text input: renders (evidence: `src/components/VisualNovelComponents/Scene/index.tsx`)
- Dialogue display → Typewriter display: renders (evidence: `src/components/VisualNovelComponents/Dialogue/index.tsx`)
- Typewriter display → Text formatting: parses markup (evidence: `src/components/Typewriter/index.tsx`)
- Typewriter display → Typing and pauses: tokenizes text (evidence: `src/components/Typewriter/index.tsx`)
- Volume control → Background music: controls volume (evidence: `src/components/VolumeSlider/index.tsx`)
