# mendezjerick/readirect-v2 architecture

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

- Interactive diagram: https://gitdiagram.com/mendezjerick/readirect-v2
- Repository: https://github.com/mendezjerick/readirect-v2

## Overview

ReaDirect is a learner-facing literacy and reading-practice platform with teacher and school administration tools, browser/native clients, game experiences, and speech services. The principal workflow is learner entry through the web app, lesson or assessment activity, speech processing where needed, and persisted progress/results; teachers can review learner assessment progress. The excerpts support several key calls, but many routes and integrations are unsampled, so those links are omitted rather than inferred. The README chiefly documents service boundaries and privacy constraints, not detailed product flows.

Main entry points: [`apps/api/app/Http/Controllers/LearnerLessonTwoController.php`](https://github.com/mendezjerick/readirect-v2/blob/deployment/playstore/apps/api/app/Http/Controllers/LearnerLessonTwoController.php) (Lesson Runtime), [`apps/web/src/App.tsx`](https://github.com/mendezjerick/readirect-v2/blob/deployment/playstore/apps/web/src/App.tsx) (Application Router), [`apps/web/src/features/assessment/AssessmentPartOnePage.tsx`](https://github.com/mendezjerick/readirect-v2/blob/deployment/playstore/apps/web/src/features/assessment/AssessmentPartOnePage.tsx) (Assessments), [`apps/web/src/features/lesson/LessonFivePage.tsx`](https://github.com/mendezjerick/readirect-v2/blob/deployment/playstore/apps/web/src/features/lesson/LessonFivePage.tsx) (Lesson Activities)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Learner and Staff Web"]
  node_webapp["Application Router<br/>[App.tsx]"]
  node_learnerapi["Learner API Client<br/>[learnerApi.ts]"]
  node_assessmentui["Assessments"]
  node_lessonsui["Lesson Activities<br/>[LessonFivePage.tsx]"]
  node_offline["Offline Practice"]
end

subgraph group_learning["Learning and Records"]
  node_lessoncontroller["Lesson Runtime"]
  node_lessoncontent["Lesson Content"]
  node_lessonstate["Teaching State"]
  node_lessonaccess["Lesson Access"]
  node_completion["Progress Completion"]
  node_lessonrun[("Lesson Runs<br/>[LessonRun.php]")]
  node_response[("Lesson Responses<br/>[LessonResponse.php]")]
  node_attempt[("Item Attempts")]
end

subgraph group_speech["Speech Services"]
  node_assessmentasr["Assessment ASR Adapter"]
  node_equivalence["Speech Equivalence"]
  node_asr["ASR Service<br/>[main.py]"]
  node_asrqueue["ASR Inference Queue<br/>[inference_queue.py]"]
  node_tts["TTS Service<br/>[main.py]"]
  node_ttsqueue["TTS Inference Queue<br/>[inference_queue.py]"]
end

subgraph group_games["Game Experiences"]
  node_gamehost["Game Hosts"]
  node_gamelobby["Game Lobby<br/>[GameLobbyPage.tsx]"]
  node_gameone["Game One<br/>[prototypeMap.ts]"]
  node_gamealpha["Game Alpha"]
  node_gameonehost["Game One Adapter"]
end

subgraph group_admin["Staff Administration"]
  node_staffapi["Staff API Client<br/>[staffApi.ts]"]
  node_staffreview["Assessment Review"]
  node_sandbox["Speech Sandbox"]
end

node_learner(("Learner"))

node_learner -.->|"opens"| node_webapp
node_webapp -->|"routes to"| node_assessmentui
node_webapp -.->|"routes to"| node_lessonsui
node_webapp -->|"routes to"| node_offline
node_webapp -.->|"routes to"| node_gamelobby
node_assessmentui -.->|"uses"| node_learnerapi
node_lessonsui -.->|"uses"| node_learnerapi
node_webapp -->|"routes to"| node_gamehost
node_gamehost -.->|"hosts"| node_gameonehost
node_gameonehost -.->|"integrates"| node_gameone
node_gamelobby -.->|"launches"| node_gamealpha
node_lessoncontroller -->|"loads"| node_lessoncontent
node_lessoncontroller -->|"advances"| node_lessonstate
node_lessoncontroller -->|"checks access"| node_lessonaccess
node_lessoncontroller -->|"completes"| node_completion
node_lessoncontroller -->|"updates"| node_lessonrun
node_lessoncontroller -->|"records"| node_response
node_lessoncontroller -->|"records"| node_attempt
node_assessmentasr -->|"resolves"| node_equivalence
node_asr -->|"dispatches"| node_asrqueue
node_tts -->|"dispatches"| node_ttsqueue
node_staffreview -.->|"reads progress"| node_lessonrun
node_sandbox -->|"forwards audio"| node_asr
node_webapp -.->|"loads staff routes"| node_staffapi

click node_webapp "https://github.com/mendezjerick/readirect-v2/blob/deployment/playstore/apps/web/src/App.tsx"
click node_learnerapi "https://github.com/mendezjerick/readirect-v2/blob/deployment/playstore/apps/web/src/features/learner-auth/learnerApi.ts"
click node_assessmentui "https://github.com/mendezjerick/readirect-v2/blob/deployment/playstore/apps/web/src/features/assessment/AssessmentPartOnePage.tsx"
click node_lessonsui "https://github.com/mendezjerick/readirect-v2/blob/deployment/playstore/apps/web/src/features/lesson/LessonFivePage.tsx"
click node_offline "https://github.com/mendezjerick/readirect-v2/blob/deployment/playstore/apps/web/src/features/offline-practice/offlinePracticeRepository.ts"
click node_gamehost "https://github.com/mendezjerick/readirect-v2/blob/deployment/playstore/apps/web/src/features/game-one/GameOneHostPage.tsx"
click node_gamelobby "https://github.com/mendezjerick/readirect-v2/blob/deployment/playstore/apps/games/lobby/src/GameLobbyPage.tsx"
click node_gameone "https://github.com/mendezjerick/readirect-v2/blob/deployment/playstore/apps/games/game-one/src/game/map/prototypeMap.ts"
click node_gamealpha "https://github.com/mendezjerick/readirect-v2/blob/deployment/playstore/apps/games/game-alpha/src/GameAlphaRoutePage.tsx"
click node_gameonehost "https://github.com/mendezjerick/readirect-v2/blob/deployment/playstore/apps/games/game-one/src/host/GameOneHostAdapter.ts"
click node_lessoncontroller "https://github.com/mendezjerick/readirect-v2/blob/deployment/playstore/apps/api/app/Http/Controllers/LearnerLessonTwoController.php"
click node_lessoncontent "https://github.com/mendezjerick/readirect-v2/blob/deployment/playstore/apps/api/app/Services/LessonContentCatalog.php"
click node_lessonstate "https://github.com/mendezjerick/readirect-v2/blob/deployment/playstore/apps/api/app/Services/LessonTeachingStateMachine.php"
click node_lessonaccess "https://github.com/mendezjerick/readirect-v2/blob/deployment/playstore/apps/api/app/Services/LearnerLessonAccessService.php"
click node_completion "https://github.com/mendezjerick/readirect-v2/blob/deployment/playstore/apps/api/app/Services/LearnerLessonCompletionService.php"
click node_lessonrun "https://github.com/mendezjerick/readirect-v2/blob/deployment/playstore/apps/api/app/Models/LessonRun.php"
click node_response "https://github.com/mendezjerick/readirect-v2/blob/deployment/playstore/apps/api/app/Models/LessonResponse.php"
click node_attempt "https://github.com/mendezjerick/readirect-v2/blob/deployment/playstore/apps/api/app/Models/LessonItemAttempt.php"
click node_assessmentasr "https://github.com/mendezjerick/readirect-v2/blob/deployment/playstore/apps/api/app/Services/LearnerAssessmentAsr.php"
click node_equivalence "https://github.com/mendezjerick/readirect-v2/blob/deployment/playstore/apps/api/app/Services/SpeechEquivalenceResolver.php"
click node_asr "https://github.com/mendezjerick/readirect-v2/blob/deployment/playstore/services/asr/main.py"
click node_asrqueue "https://github.com/mendezjerick/readirect-v2/blob/deployment/playstore/services/asr/app/inference_queue.py"
click node_tts "https://github.com/mendezjerick/readirect-v2/blob/deployment/playstore/services/tts/main.py"
click node_ttsqueue "https://github.com/mendezjerick/readirect-v2/blob/deployment/playstore/services/tts/inference_queue.py"
click node_staffapi "https://github.com/mendezjerick/readirect-v2/blob/deployment/playstore/apps/web/src/features/staff-auth/staffApi.ts"
click node_staffreview "https://github.com/mendezjerick/readirect-v2/blob/deployment/playstore/apps/api/app/Services/TeacherAssessmentReviewService.php"
click node_sandbox "https://github.com/mendezjerick/readirect-v2/blob/deployment/playstore/apps/api/app/Http/Controllers/SystemAdminSpeechSandboxController.php"

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_webapp,node_learnerapi,node_assessmentui,node_lessonsui,node_offline toneBlue
class node_lessoncontroller,node_lessoncontent,node_lessonstate,node_lessonaccess,node_completion,node_lessonrun,node_response,node_attempt toneAmber
class node_assessmentasr,node_equivalence,node_asr,node_asrqueue,node_tts,node_ttsqueue toneMint
class node_gamehost,node_gamelobby,node_gameone,node_gamealpha,node_gameonehost toneRose
class node_staffapi,node_staffreview,node_sandbox,node_learner toneIndigo
```

## Components

### Learner and Staff Web

- [Application Router](https://github.com/mendezjerick/readirect-v2/blob/deployment/playstore/apps/web/src/App.tsx): `apps/web/src/App.tsx`
- [Learner API Client](https://github.com/mendezjerick/readirect-v2/blob/deployment/playstore/apps/web/src/features/learner-auth/learnerApi.ts): `apps/web/src/features/learner-auth/learnerApi.ts`
- [Assessments](https://github.com/mendezjerick/readirect-v2/blob/deployment/playstore/apps/web/src/features/assessment/AssessmentPartOnePage.tsx): `apps/web/src/features/assessment/AssessmentPartOnePage.tsx`
- [Lesson Activities](https://github.com/mendezjerick/readirect-v2/blob/deployment/playstore/apps/web/src/features/lesson/LessonFivePage.tsx): `apps/web/src/features/lesson/LessonFivePage.tsx`
- [Offline Practice](https://github.com/mendezjerick/readirect-v2/blob/deployment/playstore/apps/web/src/features/offline-practice/offlinePracticeRepository.ts): `apps/web/src/features/offline-practice/offlinePracticeRepository.ts`

### Learning and Records

- [Lesson Runtime](https://github.com/mendezjerick/readirect-v2/blob/deployment/playstore/apps/api/app/Http/Controllers/LearnerLessonTwoController.php): `apps/api/app/Http/Controllers/LearnerLessonTwoController.php`
- [Lesson Content](https://github.com/mendezjerick/readirect-v2/blob/deployment/playstore/apps/api/app/Services/LessonContentCatalog.php): `apps/api/app/Services/LessonContentCatalog.php`
- [Teaching State](https://github.com/mendezjerick/readirect-v2/blob/deployment/playstore/apps/api/app/Services/LessonTeachingStateMachine.php): `apps/api/app/Services/LessonTeachingStateMachine.php`
- [Lesson Access](https://github.com/mendezjerick/readirect-v2/blob/deployment/playstore/apps/api/app/Services/LearnerLessonAccessService.php): `apps/api/app/Services/LearnerLessonAccessService.php`
- [Progress Completion](https://github.com/mendezjerick/readirect-v2/blob/deployment/playstore/apps/api/app/Services/LearnerLessonCompletionService.php): `apps/api/app/Services/LearnerLessonCompletionService.php`
- [Lesson Runs](https://github.com/mendezjerick/readirect-v2/blob/deployment/playstore/apps/api/app/Models/LessonRun.php): `apps/api/app/Models/LessonRun.php`
- [Lesson Responses](https://github.com/mendezjerick/readirect-v2/blob/deployment/playstore/apps/api/app/Models/LessonResponse.php): `apps/api/app/Models/LessonResponse.php`
- [Item Attempts](https://github.com/mendezjerick/readirect-v2/blob/deployment/playstore/apps/api/app/Models/LessonItemAttempt.php): `apps/api/app/Models/LessonItemAttempt.php`

### Speech Services

- [Assessment ASR Adapter](https://github.com/mendezjerick/readirect-v2/blob/deployment/playstore/apps/api/app/Services/LearnerAssessmentAsr.php): `apps/api/app/Services/LearnerAssessmentAsr.php`
- [Speech Equivalence](https://github.com/mendezjerick/readirect-v2/blob/deployment/playstore/apps/api/app/Services/SpeechEquivalenceResolver.php): `apps/api/app/Services/SpeechEquivalenceResolver.php`
- [ASR Service](https://github.com/mendezjerick/readirect-v2/blob/deployment/playstore/services/asr/main.py): `services/asr/main.py`
- [ASR Inference Queue](https://github.com/mendezjerick/readirect-v2/blob/deployment/playstore/services/asr/app/inference_queue.py): `services/asr/app/inference_queue.py`
- [TTS Service](https://github.com/mendezjerick/readirect-v2/blob/deployment/playstore/services/tts/main.py): `services/tts/main.py`
- [TTS Inference Queue](https://github.com/mendezjerick/readirect-v2/blob/deployment/playstore/services/tts/inference_queue.py): `services/tts/inference_queue.py`

### Game Experiences

- [Game Hosts](https://github.com/mendezjerick/readirect-v2/blob/deployment/playstore/apps/web/src/features/game-one/GameOneHostPage.tsx): `apps/web/src/features/game-one/GameOneHostPage.tsx`
- [Game Lobby](https://github.com/mendezjerick/readirect-v2/blob/deployment/playstore/apps/games/lobby/src/GameLobbyPage.tsx): `apps/games/lobby/src/GameLobbyPage.tsx`
- [Game One](https://github.com/mendezjerick/readirect-v2/blob/deployment/playstore/apps/games/game-one/src/game/map/prototypeMap.ts): `apps/games/game-one/src/game/map/prototypeMap.ts`
- [Game Alpha](https://github.com/mendezjerick/readirect-v2/blob/deployment/playstore/apps/games/game-alpha/src/GameAlphaRoutePage.tsx): `apps/games/game-alpha/src/GameAlphaRoutePage.tsx`
- [Game One Adapter](https://github.com/mendezjerick/readirect-v2/blob/deployment/playstore/apps/games/game-one/src/host/GameOneHostAdapter.ts): `apps/games/game-one/src/host/GameOneHostAdapter.ts`

### Staff Administration

- [Staff API Client](https://github.com/mendezjerick/readirect-v2/blob/deployment/playstore/apps/web/src/features/staff-auth/staffApi.ts): `apps/web/src/features/staff-auth/staffApi.ts`
- [Assessment Review](https://github.com/mendezjerick/readirect-v2/blob/deployment/playstore/apps/api/app/Services/TeacherAssessmentReviewService.php): `apps/api/app/Services/TeacherAssessmentReviewService.php`
- [Speech Sandbox](https://github.com/mendezjerick/readirect-v2/blob/deployment/playstore/apps/api/app/Http/Controllers/SystemAdminSpeechSandboxController.php): `apps/api/app/Http/Controllers/SystemAdminSpeechSandboxController.php`

### Other components

- **Learner**

## Connections

- Learner → Application Router: opens
- Application Router → Assessments: routes to (evidence: `apps/web/src/App.tsx`)
- Application Router → Lesson Activities: routes to (evidence: `apps/web/src/App.tsx`)
- Application Router → Offline Practice: routes to (evidence: `apps/web/src/App.tsx`)
- Application Router → Game Lobby: routes to
- Assessments → Learner API Client: uses
- Lesson Activities → Learner API Client: uses
- Application Router → Game Hosts: routes to (evidence: `apps/web/src/App.tsx`)
- Game Hosts → Game One Adapter: hosts
- Game One Adapter → Game One: integrates
- Game Lobby → Game Alpha: launches
- Lesson Runtime → Lesson Content: loads (evidence: `apps/api/app/Http/Controllers/LearnerLessonTwoController.php`)
- Lesson Runtime → Teaching State: advances (evidence: `apps/api/app/Http/Controllers/LearnerLessonTwoController.php`)
- Lesson Runtime → Lesson Access: checks access (evidence: `apps/api/app/Http/Controllers/LearnerLessonTwoController.php`)
- Lesson Runtime → Progress Completion: completes (evidence: `apps/api/app/Http/Controllers/LearnerLessonTwoController.php`)
- Lesson Runtime → Lesson Runs: updates (evidence: `apps/api/app/Http/Controllers/LearnerLessonTwoController.php`)
- Lesson Runtime → Lesson Responses: records (evidence: `apps/api/app/Http/Controllers/LearnerLessonTwoController.php`)
- Lesson Runtime → Item Attempts: records (evidence: `apps/api/app/Http/Controllers/LearnerLessonTwoController.php`)
- Assessment ASR Adapter → Speech Equivalence: resolves (evidence: `apps/api/app/Services/LearnerAssessmentAsr.php`)
- ASR Service → ASR Inference Queue: dispatches (evidence: `services/asr/main.py`)
- TTS Service → TTS Inference Queue: dispatches (evidence: `services/tts/main.py`)
- Assessment Review → Lesson Runs: reads progress
- Speech Sandbox → ASR Service: forwards audio (evidence: `apps/api/app/Http/Controllers/SystemAdminSpeechSandboxController.php`)
- Application Router → Staff API Client: loads staff routes
