# daas-me/readlr architecture

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

- Interactive diagram: https://gitdiagram.com/daas-me/readlr
- Repository: https://github.com/daas-me/readlr

## Overview

Readlr combines a learner-facing reading curriculum and gamified progress experience with teacher administration, backed by an Express API and Supabase persistence. The main path is learner onboarding, curriculum practice and audio feedback, then synchronized progress and rewards; educators manage classrooms and review progress. The README documents broader learning activities than the sampled source establishes, so those capabilities are represented as product areas without guessed implementation links. Edges cite only shown calls or explicit README/API wiring.

Main entry points: [`frontend/src/app/App.tsx`](https://github.com/daas-me/readlr/blob/main/frontend/src/app/App.tsx) (Application flow), [`backend/src/database/db.ts`](https://github.com/daas-me/readlr/blob/main/backend/src/database/db.ts) (Supabase database), [`backend/src/modules/audio/audio.controller.ts`](https://github.com/daas-me/readlr/blob/main/backend/src/modules/audio/audio.controller.ts) (Audio analysis API), [`backend/src/modules/progress/progress.controller.ts`](https://github.com/daas-me/readlr/blob/main/backend/src/modules/progress/progress.controller.ts) (Progress API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Learner experience"]
  node_app["Application flow<br/>[App.tsx]"]
  node_auth_ui["Sign in and setup"]
  node_profile["Learner profile<br/>[LearnerProfile.tsx]"]
end

subgraph group_learning["Learning activities"]
  node_lessons["Lessons and stories<br/>[StoryScene.tsx]"]
  node_phonemes["Phoneme practice<br/>[PhonemeBank.tsx]"]
  node_cvc["CVC challenges<br/>[cvcContent.ts]"]
  node_audio_ui["Audio playback<br/>[useAudioManager.ts]"]
end

subgraph group_progress["Progress and rewards"]
  node_journey_sync["Journey synchronization<br/>[useJourneySync.ts]"]
  node_progress_ui["Progress dashboards"]
  node_rewards["Achievements and stickers<br/>[Achievements.tsx]"]
end

subgraph group_backend["Backend services"]
  node_audio_api["Audio analysis API"]
  node_audio_service["Audio processing<br/>[audio.service.ts]"]
  node_progress_api["Progress API"]
  node_learner_api["Learner service<br/>[learner.service.ts]"]
  node_frames["Avatar frames<br/>[frames.service.ts]"]
  node_database[("Supabase database<br/>[db.ts]")]
  node_api_app["API route setup<br/>[app.ts]"]
end

subgraph group_admin["Educator tools"]
  node_admin_ui["Teacher dashboard<br/>[AdminDashboard.tsx]"]
  node_classroom["Classroom management"]
  node_survey["Survey management"]
end

node_learner(("Learner"))
node_teacher(("Teacher"))
node_openai["OpenAI Whisper"]

node_learner -->|"uses"| node_app
node_app -->|"renders"| node_auth_ui
node_app -->|"routes to"| node_lessons
node_app -.->|"routes to"| node_phonemes
node_app -.->|"routes to"| node_progress_ui
node_auth_ui -.->|"sets up"| node_profile
node_lessons -->|"plays audio"| node_audio_ui
node_phonemes -->|"uses audio"| node_audio_ui
node_cvc -->|"provides lessons"| node_phonemes
node_audio_ui -.->|"optional speech input"| node_openai
node_learner -->|"submits recording"| node_audio_api
node_api_app -->|"mounts routes"| node_audio_api
node_audio_api -->|"processes with"| node_audio_service
node_audio_api -.->|"reads and writes"| node_database
node_journey_sync -->|"syncs journeys"| node_progress_api
node_progress_api -->|"checks learner"| node_learner_api
node_progress_api -->|"unlocks frames"| node_frames
node_frames -->|"reads and writes"| node_database
node_learner_api -.->|"persists profiles"| node_database
node_progress_ui -.->|"shows rewards"| node_rewards
node_teacher -->|"manages learners"| node_admin_ui
node_admin_ui -.->|"manages classrooms"| node_classroom
node_admin_ui -.->|"manages surveys"| node_survey
node_classroom -->|"reads and writes"| node_database
node_survey -->|"reads and writes"| node_database

click node_app "https://github.com/daas-me/readlr/blob/main/frontend/src/app/App.tsx"
click node_auth_ui "https://github.com/daas-me/readlr/tree/main/frontend/src/modules/auth/components"
click node_profile "https://github.com/daas-me/readlr/blob/main/frontend/src/app/components/LearnerProfile.tsx"
click node_lessons "https://github.com/daas-me/readlr/blob/main/frontend/src/app/components/StoryScene.tsx"
click node_phonemes "https://github.com/daas-me/readlr/blob/main/frontend/src/app/components/PhonemeBank.tsx"
click node_cvc "https://github.com/daas-me/readlr/blob/main/frontend/src/app/components/cvcContent.ts"
click node_audio_ui "https://github.com/daas-me/readlr/blob/main/frontend/src/hooks/useAudioManager.ts"
click node_audio_api "https://github.com/daas-me/readlr/blob/main/backend/src/modules/audio/audio.controller.ts"
click node_audio_service "https://github.com/daas-me/readlr/blob/main/backend/src/modules/audio/audio.service.ts"
click node_journey_sync "https://github.com/daas-me/readlr/blob/main/frontend/src/app/hooks/useJourneySync.ts"
click node_progress_ui "https://github.com/daas-me/readlr/blob/main/frontend/src/app/components/UnifiedDashboard.tsx"
click node_rewards "https://github.com/daas-me/readlr/blob/main/frontend/src/app/components/Achievements.tsx"
click node_progress_api "https://github.com/daas-me/readlr/blob/main/backend/src/modules/progress/progress.controller.ts"
click node_learner_api "https://github.com/daas-me/readlr/blob/main/backend/src/modules/learner/learner.service.ts"
click node_frames "https://github.com/daas-me/readlr/blob/main/backend/src/modules/frames/frames.service.ts"
click node_database "https://github.com/daas-me/readlr/blob/main/backend/src/database/db.ts"
click node_api_app "https://github.com/daas-me/readlr/blob/main/backend/src/app.ts"
click node_admin_ui "https://github.com/daas-me/readlr/blob/main/frontend/src/app/components/AdminDashboard.tsx"
click node_classroom "https://github.com/daas-me/readlr/blob/main/backend/src/modules/admin/classroom.controller.ts"
click node_survey "https://github.com/daas-me/readlr/blob/main/backend/src/modules/admin/survey.controller.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_auth_ui,node_profile toneBlue
class node_lessons,node_phonemes,node_cvc,node_audio_ui toneAmber
class node_journey_sync,node_progress_ui,node_rewards toneMint
class node_audio_api,node_audio_service,node_progress_api,node_learner_api,node_frames,node_database,node_api_app toneRose
class node_admin_ui,node_classroom,node_survey,node_learner,node_teacher,node_openai toneIndigo
```

## Components

### Learner experience

- [Application flow](https://github.com/daas-me/readlr/blob/main/frontend/src/app/App.tsx): `frontend/src/app/App.tsx`
- [Sign in and setup](https://github.com/daas-me/readlr/tree/main/frontend/src/modules/auth/components): `frontend/src/modules/auth/components`
- [Learner profile](https://github.com/daas-me/readlr/blob/main/frontend/src/app/components/LearnerProfile.tsx): `frontend/src/app/components/LearnerProfile.tsx`

### Learning activities

- [Lessons and stories](https://github.com/daas-me/readlr/blob/main/frontend/src/app/components/StoryScene.tsx): `frontend/src/app/components/StoryScene.tsx`
- [Phoneme practice](https://github.com/daas-me/readlr/blob/main/frontend/src/app/components/PhonemeBank.tsx): `frontend/src/app/components/PhonemeBank.tsx`
- [CVC challenges](https://github.com/daas-me/readlr/blob/main/frontend/src/app/components/cvcContent.ts): `frontend/src/app/components/cvcContent.ts`
- [Audio playback](https://github.com/daas-me/readlr/blob/main/frontend/src/hooks/useAudioManager.ts): `frontend/src/hooks/useAudioManager.ts`

### Progress and rewards

- [Journey synchronization](https://github.com/daas-me/readlr/blob/main/frontend/src/app/hooks/useJourneySync.ts): `frontend/src/app/hooks/useJourneySync.ts`
- [Progress dashboards](https://github.com/daas-me/readlr/blob/main/frontend/src/app/components/UnifiedDashboard.tsx): `frontend/src/app/components/UnifiedDashboard.tsx`
- [Achievements and stickers](https://github.com/daas-me/readlr/blob/main/frontend/src/app/components/Achievements.tsx): `frontend/src/app/components/Achievements.tsx`

### Backend services

- [Audio analysis API](https://github.com/daas-me/readlr/blob/main/backend/src/modules/audio/audio.controller.ts): `backend/src/modules/audio/audio.controller.ts`
- [Audio processing](https://github.com/daas-me/readlr/blob/main/backend/src/modules/audio/audio.service.ts): `backend/src/modules/audio/audio.service.ts`
- [Progress API](https://github.com/daas-me/readlr/blob/main/backend/src/modules/progress/progress.controller.ts): `backend/src/modules/progress/progress.controller.ts`
- [Learner service](https://github.com/daas-me/readlr/blob/main/backend/src/modules/learner/learner.service.ts): `backend/src/modules/learner/learner.service.ts`
- [Avatar frames](https://github.com/daas-me/readlr/blob/main/backend/src/modules/frames/frames.service.ts): `backend/src/modules/frames/frames.service.ts`
- [Supabase database](https://github.com/daas-me/readlr/blob/main/backend/src/database/db.ts): `backend/src/database/db.ts`
- [API route setup](https://github.com/daas-me/readlr/blob/main/backend/src/app.ts): `backend/src/app.ts`

### Educator tools

- [Teacher dashboard](https://github.com/daas-me/readlr/blob/main/frontend/src/app/components/AdminDashboard.tsx): `frontend/src/app/components/AdminDashboard.tsx`
- [Classroom management](https://github.com/daas-me/readlr/blob/main/backend/src/modules/admin/classroom.controller.ts): `backend/src/modules/admin/classroom.controller.ts`
- [Survey management](https://github.com/daas-me/readlr/blob/main/backend/src/modules/admin/survey.controller.ts): `backend/src/modules/admin/survey.controller.ts`

### Other components

- **Learner**
- **Teacher**
- **OpenAI Whisper**

## Connections

- Learner → Application flow: uses (evidence: `README.md`)
- Application flow → Sign in and setup: renders (evidence: `frontend/src/app/App.tsx`)
- Application flow → Lessons and stories: routes to (evidence: `frontend/src/app/App.tsx`)
- Application flow → Phoneme practice: routes to (evidence: `frontend/src/app/App.tsx`)
- Application flow → Progress dashboards: routes to (evidence: `frontend/src/app/App.tsx`)
- Sign in and setup → Learner profile: sets up
- Lessons and stories → Audio playback: plays audio (evidence: `frontend/src/app/components/StoryScene.tsx`)
- Phoneme practice → Audio playback: uses audio (evidence: `frontend/src/app/components/PhonemeBank.tsx`)
- CVC challenges → Phoneme practice: provides lessons (evidence: `frontend/src/app/components/PhonemeBank.tsx`)
- Audio playback → OpenAI Whisper: optional speech input
- Learner → Audio analysis API: submits recording (evidence: `README.md`)
- API route setup → Audio analysis API: mounts routes (evidence: `backend/src/app.ts`)
- Audio analysis API → Audio processing: processes with (evidence: `backend/src/modules/audio/audio.controller.ts`)
- Audio analysis API → Supabase database: reads and writes
- Journey synchronization → Progress API: syncs journeys (evidence: `frontend/src/app/hooks/useJourneySync.ts`)
- Progress API → Learner service: checks learner (evidence: `backend/src/modules/progress/progress.controller.ts`)
- Progress API → Avatar frames: unlocks frames (evidence: `backend/src/modules/progress/progress.controller.ts`)
- Avatar frames → Supabase database: reads and writes (evidence: `backend/src/modules/frames/frames.service.ts`)
- Learner service → Supabase database: persists profiles
- Progress dashboards → Achievements and stickers: shows rewards
- Teacher → Teacher dashboard: manages learners (evidence: `README.md`)
- Teacher dashboard → Classroom management: manages classrooms
- Teacher dashboard → Survey management: manages surveys
- Classroom management → Supabase database: reads and writes (evidence: `backend/src/modules/admin/classroom.controller.ts`)
- Survey management → Supabase database: reads and writes (evidence: `backend/src/modules/admin/survey.controller.ts`)
