# rahil0555/playbook architecture

> Architecture diagram of the GitHub repository rahil0555/playbook, 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/rahil0555/playbook
- Repository: https://github.com/rahil0555/playbook

## Overview

Edurance PlayLab is a standalone, embeddable early-literacy learning app. Children enter from Home, choose a learning activity, answer interactive questions, and receive feedback and round completion; progress and badges summarize results. The graph preserves the README’s distinct alphabet, phonics, word-building, sentence, matching, and progress capabilities, plus shared content, audio, and persistence layers. Relationships are limited to routes and calls documented in the README or source index; unsampled implementation details are not inferred.

Main entry points: [`src/playlab/app/routes.tsx`](https://github.com/rahil0555/playbook/blob/claude/edurance-playlab-playground-sqbe8i/src/playlab/app/routes.tsx) (View router), [`src/playlab/app/PlayLab.tsx`](https://github.com/rahil0555/playbook/blob/claude/edurance-playlab-playground-sqbe8i/src/playlab/app/PlayLab.tsx) (PlayLab component), [`src/playlab/hooks/useRound.ts`](https://github.com/rahil0555/playbook/blob/claude/edurance-playlab-playground-sqbe8i/src/playlab/hooks/useRound.ts) (Round state), [`src/playlab/features/alphabet/AlphabetActivity.tsx`](https://github.com/rahil0555/playbook/blob/claude/edurance-playlab-playground-sqbe8i/src/playlab/features/alphabet/AlphabetActivity.tsx) (Letter playground)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["App entry"]
  node_playlab["PlayLab component<br/>[PlayLab.tsx]"]
  node_router["View router<br/>[routes.tsx]"]
end

subgraph group_learning["Learning activities"]
  node_home["Home screen<br/>[HomeScreen.tsx]"]
  node_alphabet["Letter playground"]
  node_phonics["Sound discovery"]
  node_wordbuilder["Magic word builder"]
  node_sentence["Sentence activities"]
  node_matching["Matching games"]
  node_progressscreen["Progress screen<br/>[ProgressScreen.tsx]"]
end

subgraph group_shared["Shared learning services"]
  node_round["Round state<br/>[useRound.ts]"]
  node_context["PlayLab context<br/>[PlayLabContext.tsx]"]
  node_catalog["Activity catalog<br/>[activities.ts]"]
  node_content["Language content<br/>[alphabet.ts]"]
  node_audiohook["Audio hooks<br/>[useAudio.ts]"]
  node_audio["Audio service<br/>[audioService.ts]"]
  node_voice["Voice catalog<br/>[voiceCatalog.ts]"]
end

subgraph group_state["Progress and preferences"]
  node_likes[("Liked content<br/>[likesService.ts]")]
  node_progress["Progress service<br/>[progressService.ts]"]
  node_store[("Progress store<br/>[progressStore.ts]")]
  node_settings["Settings service<br/>[settingsService.ts]"]
end

node_child(("Child learner"))
node_host(("Embedding host"))
node_browser["Browser speech synthesis"]

node_child -->|"uses"| node_playlab
node_host -->|"embeds"| node_playlab
node_playlab -->|"renders"| node_router
node_router -->|"routes to"| node_home
node_router -->|"routes to"| node_alphabet
node_router -->|"routes to"| node_phonics
node_router -->|"routes to"| node_wordbuilder
node_router -->|"routes to"| node_sentence
node_router -->|"routes to"| node_matching
node_router -->|"routes to"| node_progressscreen
node_home -->|"lists activities"| node_catalog
node_alphabet -.->|"records answers"| node_round
node_phonics -.->|"records answers"| node_round
node_wordbuilder -.->|"records answers"| node_round
node_sentence -->|"uses rounds"| node_round
node_matching -.->|"records answers"| node_round
node_round -->|"records progress"| node_context
node_playlab -->|"provides state"| node_context
node_router -->|"reads view"| node_context
node_phonics -.->|"uses letters"| node_content
node_alphabet -->|"uses letters"| node_content
node_alphabet -->|"plays speech"| node_audiohook
node_audiohook -->|"reads audio"| node_context
node_audiohook -->|"calls"| node_audio
node_audio -->|"resolves voices"| node_voice
node_audio -->|"speaks"| node_browser
node_home -->|"toggles likes"| node_likes
node_progressscreen -.->|"reads likes"| node_likes
node_progress -.->|"persists snapshots"| node_store
node_playlab -->|"configures progress"| node_progress
node_progress -->|"uses activity ids"| node_catalog
node_playlab -->|"loads settings"| node_settings

click node_playlab "https://github.com/rahil0555/playbook/blob/claude/edurance-playlab-playground-sqbe8i/src/playlab/app/PlayLab.tsx"
click node_router "https://github.com/rahil0555/playbook/blob/claude/edurance-playlab-playground-sqbe8i/src/playlab/app/routes.tsx"
click node_home "https://github.com/rahil0555/playbook/blob/claude/edurance-playlab-playground-sqbe8i/src/playlab/features/home/HomeScreen.tsx"
click node_alphabet "https://github.com/rahil0555/playbook/blob/claude/edurance-playlab-playground-sqbe8i/src/playlab/features/alphabet/AlphabetActivity.tsx"
click node_phonics "https://github.com/rahil0555/playbook/blob/claude/edurance-playlab-playground-sqbe8i/src/playlab/features/phonics/PhonicsActivity.tsx"
click node_wordbuilder "https://github.com/rahil0555/playbook/blob/claude/edurance-playlab-playground-sqbe8i/src/playlab/features/word-builder/magic/MagicWordBuilder.tsx"
click node_sentence "https://github.com/rahil0555/playbook/blob/claude/edurance-playlab-playground-sqbe8i/src/playlab/features/sentence-builder/SentenceBuilderActivity.tsx"
click node_matching "https://github.com/rahil0555/playbook/blob/claude/edurance-playlab-playground-sqbe8i/src/playlab/features/matching/MatchingActivity.tsx"
click node_progressscreen "https://github.com/rahil0555/playbook/blob/claude/edurance-playlab-playground-sqbe8i/src/playlab/features/progress/ProgressScreen.tsx"
click node_round "https://github.com/rahil0555/playbook/blob/claude/edurance-playlab-playground-sqbe8i/src/playlab/hooks/useRound.ts"
click node_context "https://github.com/rahil0555/playbook/blob/claude/edurance-playlab-playground-sqbe8i/src/playlab/app/PlayLabContext.tsx"
click node_catalog "https://github.com/rahil0555/playbook/blob/claude/edurance-playlab-playground-sqbe8i/src/playlab/data/activities.ts"
click node_content "https://github.com/rahil0555/playbook/blob/claude/edurance-playlab-playground-sqbe8i/src/playlab/data/en/alphabet.ts"
click node_audiohook "https://github.com/rahil0555/playbook/blob/claude/edurance-playlab-playground-sqbe8i/src/playlab/hooks/useAudio.ts"
click node_audio "https://github.com/rahil0555/playbook/blob/claude/edurance-playlab-playground-sqbe8i/src/playlab/services/audioService.ts"
click node_voice "https://github.com/rahil0555/playbook/blob/claude/edurance-playlab-playground-sqbe8i/src/playlab/services/voiceCatalog.ts"
click node_likes "https://github.com/rahil0555/playbook/blob/claude/edurance-playlab-playground-sqbe8i/src/playlab/services/likesService.ts"
click node_progress "https://github.com/rahil0555/playbook/blob/claude/edurance-playlab-playground-sqbe8i/src/playlab/services/progressService.ts"
click node_store "https://github.com/rahil0555/playbook/blob/claude/edurance-playlab-playground-sqbe8i/src/playlab/services/progressStore.ts"
click node_settings "https://github.com/rahil0555/playbook/blob/claude/edurance-playlab-playground-sqbe8i/src/playlab/services/settingsService.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_playlab,node_router,node_browser toneBlue
class node_home,node_alphabet,node_phonics,node_wordbuilder,node_sentence,node_matching,node_progressscreen toneAmber
class node_round,node_context,node_catalog,node_content,node_audiohook,node_audio,node_voice toneMint
class node_likes,node_progress,node_store,node_settings toneRose
class node_child,node_host toneIndigo
```

## Components

### App entry

- [PlayLab component](https://github.com/rahil0555/playbook/blob/claude/edurance-playlab-playground-sqbe8i/src/playlab/app/PlayLab.tsx): `src/playlab/app/PlayLab.tsx`
- [View router](https://github.com/rahil0555/playbook/blob/claude/edurance-playlab-playground-sqbe8i/src/playlab/app/routes.tsx): `src/playlab/app/routes.tsx`

### Learning activities

- [Home screen](https://github.com/rahil0555/playbook/blob/claude/edurance-playlab-playground-sqbe8i/src/playlab/features/home/HomeScreen.tsx): `src/playlab/features/home/HomeScreen.tsx`
- [Letter playground](https://github.com/rahil0555/playbook/blob/claude/edurance-playlab-playground-sqbe8i/src/playlab/features/alphabet/AlphabetActivity.tsx): `src/playlab/features/alphabet/AlphabetActivity.tsx`
- [Sound discovery](https://github.com/rahil0555/playbook/blob/claude/edurance-playlab-playground-sqbe8i/src/playlab/features/phonics/PhonicsActivity.tsx): `src/playlab/features/phonics/PhonicsActivity.tsx`
- [Magic word builder](https://github.com/rahil0555/playbook/blob/claude/edurance-playlab-playground-sqbe8i/src/playlab/features/word-builder/magic/MagicWordBuilder.tsx): `src/playlab/features/word-builder/magic/MagicWordBuilder.tsx`
- [Sentence activities](https://github.com/rahil0555/playbook/blob/claude/edurance-playlab-playground-sqbe8i/src/playlab/features/sentence-builder/SentenceBuilderActivity.tsx): `src/playlab/features/sentence-builder/SentenceBuilderActivity.tsx`
- [Matching games](https://github.com/rahil0555/playbook/blob/claude/edurance-playlab-playground-sqbe8i/src/playlab/features/matching/MatchingActivity.tsx): `src/playlab/features/matching/MatchingActivity.tsx`
- [Progress screen](https://github.com/rahil0555/playbook/blob/claude/edurance-playlab-playground-sqbe8i/src/playlab/features/progress/ProgressScreen.tsx): `src/playlab/features/progress/ProgressScreen.tsx`

### Shared learning services

- [Round state](https://github.com/rahil0555/playbook/blob/claude/edurance-playlab-playground-sqbe8i/src/playlab/hooks/useRound.ts): `src/playlab/hooks/useRound.ts`
- [PlayLab context](https://github.com/rahil0555/playbook/blob/claude/edurance-playlab-playground-sqbe8i/src/playlab/app/PlayLabContext.tsx): `src/playlab/app/PlayLabContext.tsx`
- [Activity catalog](https://github.com/rahil0555/playbook/blob/claude/edurance-playlab-playground-sqbe8i/src/playlab/data/activities.ts): `src/playlab/data/activities.ts`
- [Language content](https://github.com/rahil0555/playbook/blob/claude/edurance-playlab-playground-sqbe8i/src/playlab/data/en/alphabet.ts): `src/playlab/data/en/alphabet.ts`
- [Audio hooks](https://github.com/rahil0555/playbook/blob/claude/edurance-playlab-playground-sqbe8i/src/playlab/hooks/useAudio.ts): `src/playlab/hooks/useAudio.ts`
- [Audio service](https://github.com/rahil0555/playbook/blob/claude/edurance-playlab-playground-sqbe8i/src/playlab/services/audioService.ts): `src/playlab/services/audioService.ts`
- [Voice catalog](https://github.com/rahil0555/playbook/blob/claude/edurance-playlab-playground-sqbe8i/src/playlab/services/voiceCatalog.ts): `src/playlab/services/voiceCatalog.ts`

### Progress and preferences

- [Liked content](https://github.com/rahil0555/playbook/blob/claude/edurance-playlab-playground-sqbe8i/src/playlab/services/likesService.ts): `src/playlab/services/likesService.ts`
- [Progress service](https://github.com/rahil0555/playbook/blob/claude/edurance-playlab-playground-sqbe8i/src/playlab/services/progressService.ts): `src/playlab/services/progressService.ts`
- [Progress store](https://github.com/rahil0555/playbook/blob/claude/edurance-playlab-playground-sqbe8i/src/playlab/services/progressStore.ts): `src/playlab/services/progressStore.ts`
- [Settings service](https://github.com/rahil0555/playbook/blob/claude/edurance-playlab-playground-sqbe8i/src/playlab/services/settingsService.ts): `src/playlab/services/settingsService.ts`

### Other components

- **Child learner**
- **Embedding host**
- **Browser speech synthesis**

## Connections

- Child learner → PlayLab component: uses
- Embedding host → PlayLab component: embeds
- PlayLab component → View router: renders (evidence: `src/playlab/app/PlayLab.tsx`)
- View router → Home screen: routes to (evidence: `src/playlab/app/routes.tsx`)
- View router → Letter playground: routes to (evidence: `src/playlab/app/routes.tsx`)
- View router → Sound discovery: routes to (evidence: `src/playlab/app/routes.tsx`)
- View router → Magic word builder: routes to (evidence: `src/playlab/app/routes.tsx`)
- View router → Sentence activities: routes to (evidence: `src/playlab/app/routes.tsx`)
- View router → Matching games: routes to (evidence: `src/playlab/app/routes.tsx`)
- View router → Progress screen: routes to (evidence: `src/playlab/app/routes.tsx`)
- Home screen → Activity catalog: lists activities (evidence: `src/playlab/features/home/HomeScreen.tsx`)
- Letter playground → Round state: records answers
- Sound discovery → Round state: records answers
- Magic word builder → Round state: records answers
- Sentence activities → Round state: uses rounds (evidence: `src/playlab/features/sentence-builder/SentenceBuilderActivity.tsx`)
- Matching games → Round state: records answers
- Round state → PlayLab context: records progress (evidence: `src/playlab/hooks/useRound.ts`)
- PlayLab component → PlayLab context: provides state (evidence: `src/playlab/app/PlayLab.tsx`)
- View router → PlayLab context: reads view (evidence: `src/playlab/app/routes.tsx`)
- Sound discovery → Language content: uses letters
- Letter playground → Language content: uses letters (evidence: `src/playlab/features/alphabet/AlphabetActivity.tsx`)
- Letter playground → Audio hooks: plays speech (evidence: `src/playlab/features/alphabet/AlphabetActivity.tsx`)
- Audio hooks → PlayLab context: reads audio (evidence: `src/playlab/hooks/useAudio.ts`)
- Audio hooks → Audio service: calls (evidence: `src/playlab/hooks/useAudio.ts`)
- Audio service → Voice catalog: resolves voices (evidence: `src/playlab/services/audioService.ts`)
- Audio service → Browser speech synthesis: speaks (evidence: `src/playlab/services/audioService.ts`)
- Home screen → Liked content: toggles likes (evidence: `src/playlab/features/home/HomeScreen.tsx`)
- Progress screen → Liked content: reads likes
- Progress service → Progress store: persists snapshots
- PlayLab component → Progress service: configures progress (evidence: `src/playlab/app/PlayLab.tsx`)
- Progress service → Activity catalog: uses activity ids (evidence: `src/playlab/services/progressService.ts`)
- PlayLab component → Settings service: loads settings (evidence: `src/playlab/app/PlayLab.tsx`)
