How sobbify/ai-tutor works
ELSA is a private English-speaking tutor for teachers. Learners enter through the host app, follow a 15-day journey or rehearse on demand, learn a moment, practise with an AI parent, and review feedback and progress. The graph also preserves stories, phrasebook, groups, and the admin console. Several backend routes and frontend screens are documented but unsampled; those links cite the README, while internal service links use the source index or excerpts as evidence.
Main entry points: JourneyPage.tsx Journey and home · useConversation.ts Conversation control · ConversationPage.tsx Role-play screen · content.py Practice content
Components 34
Learner experience
- Learner app
src/app/App.tsx - Journey and home
src/features/journey/JourneyPage.tsx - Learn moment
src/features/learn/LearnPage.tsx - Progress and certificate
src/features/progress/ProgressPage.tsx - Phrasebook
src/features/phrasebook/PhrasebookPage.tsx - Practice groups
src/features/group/GroupPage.tsx - Tell a story
src/features/story/StoryPage.tsx - Shared UI button
src/components/ui/Button.tsx - Shared UI icons
src/components/ui/Icons.tsx
Practice and feedback
- Role-play screen
src/features/conversation/ConversationPage.tsx - Conversation control
src/features/conversation/useConversation.ts - Live reply capture
src/hooks/useLiveReply.ts - Audio recorder
src/hooks/useRecorder.ts - Chat and feedback
src/features/conversation/ChatBubbles.tsx - Learner data queries
src/hooks/queries.ts - Tutor API contract
src/api/types.ts
Tutor backend
- FastAPI application
backend/src/ai_tutor/main.py - Practice websocket
backend/src/ai_tutor/api/practice_ws.py - Journey service
backend/src/ai_tutor/services/journey.py - Practice content
backend/src/ai_tutor/services/content.py - Speech listener
backend/src/ai_tutor/services/listen.py - Audio processing
backend/src/ai_tutor/services/audio.py - Reply evaluator
backend/src/ai_tutor/services/evaluator.py - Tutor voice
backend/src/ai_tutor/services/voice.py - Gemini key pool
backend/src/ai_tutor/services/keys.py - Persistent domain models
backend/src/ai_tutor/models.py - Domain schemas
backend/src/ai_tutor/schemas.py
Admin and operations
- Admin console
src/admin/AdminApp.tsx - Admin API client
src/admin/api.ts - Admin endpoints
backend/src/ai_tutor/api/admin.py - Admin operations
backend/src/ai_tutor/services/admin.py - Moment editor
src/admin/pages/MomentEditor.tsx
Other components
- Teacher
- Buddy's World host
Connections 35
- Buddy's World host → FastAPI application: opens signed link
- FastAPI application → Teacher: sets session
- Teacher → Learner app: uses
- Learner app → Journey and home: routes to
- Learner app → Role-play screen: routes to
- Journey and home → Learn moment: starts lesson
- Learn moment → Role-play screen: continues to
- Journey and home → Progress and certificate: offers progress
- Journey and home → Phrasebook: offers phrasebook
- Journey and home → Practice groups: offers groups
- Journey and home → Tell a story: offers stories
- Role-play screen → Conversation control: uses
- Conversation control → Learner data queries: loads run data
src/features/conversation/useConversation.ts - Conversation control → Live reply capture: captures live reply
src/features/conversation/useConversation.ts - Conversation control → Audio recorder: uses fallback
src/features/conversation/useConversation.ts - Role-play screen → Chat and feedback: renders transcript
- Learner data queries → Tutor API contract: uses API contract
src/hooks/queries.ts - Live reply capture → Practice websocket: streams practice audio
- FastAPI application → Practice websocket: serves practice
backend/src/ai_tutor/main.py - Practice websocket → Speech listener: handles speech
- Speech listener → Audio processing: uses audio processing
backend/src/ai_tutor/services/listen.py - Speech listener → Reply evaluator: requests evaluation
backend/src/ai_tutor/services/listen.py - Reply evaluator → Gemini key pool: selects credentials
backend/src/ai_tutor/services/evaluator.py - Journey service → Practice content: loads content
backend/src/ai_tutor/services/journey.py - Journey service → Reply evaluator: evaluates replies
backend/src/ai_tutor/services/journey.py - Tutor voice → Audio processing: uses audio
backend/src/ai_tutor/services/voice.py - Tutor voice → Practice content: loads content
backend/src/ai_tutor/services/voice.py - Tutor voice → Gemini key pool: uses credentials
backend/src/ai_tutor/services/voice.py - Practice content → Persistent domain models: reads domain records
backend/src/ai_tutor/services/content.py - Practice content → Domain schemas: validates content
backend/src/ai_tutor/services/content.py - Admin console → Admin API client: uses
- Moment editor → Admin API client: saves content
src/admin/pages/MomentEditor.tsx - Admin API client → Admin endpoints: calls admin API
- Admin endpoints → Admin operations: delegates operations
- Admin operations → Persistent domain models: manages records