How kitrak005/boli-language-learning-app works
Purpose and Entry Points
A Vite/React TypeScript single-page learning application, apparently focused on language/cultural learning with lessons, practice, pronunciation coaching, progress tracking, and an “Ask Guru” assistant. Client bootstraps at src/main.tsx, renders the application shell in src/App.tsx, and is served through index.html. A separate TypeScript server/API surface is represented by server.ts and api/ask-guru.ts.
Application Shell and Navigation
src/App.tsx is the primary UI state coordinator: it likely selects active views, owns cross-view state, and opens shared modal/celebration experiences. Persistent app chrome is split into src/components/TopAppBar.tsx and src/components/BottomNavBar.tsx, establishing mobile-oriented navigation boundaries between home, learn, practice, explore, and profile flows.
Learning and Practice Experiences
The main content domains are isolated as view components:
• src/components/HomeView.tsx
• src/components/LearnView.tsx
• src/components/PracticeView.tsx
Lessons are launched or presented through src/components/LessonModal.tsx; tradition/course selection is handled by src/components/TraditionSelectModal.tsx. This separates navigation-level screens from focused instructional overlays.
Progress, Gamification, and Visualization
Learning progress is surfaced through dedicated components rather than embedded in each view:
• src/components/DailyGoalTracker.tsx
• src/components/WeeklyXpD3Chart.tsx
• src/components/LevelUpCelebrationModal.tsx
src/components/ConfettiCanvas.tsx supplies the visual celebration effect. The XP chart’s name indicates D3 is a material visualization runtime/dependency, while modal-driven level-up feedback is a distinct event boundary triggered by progress updates.
Speech and Audio Boundary
Pronunciation practice is encapsulated by src/components/PronunciationCoach.tsx, backed by browser-facing utility layers:
• src/utils/speechRecognition.ts
• src/utils/audio.ts
This boundary keeps Web Speech API recognition and audio playback/recording concerns outside lesson and practice UI orchestration. Browser microphone permission and speech-recognition availability are important runtime constraints.
Guru Assistant and Backend Boundary
src/components/AskGuruChat.tsx is the client chat interface. It communicates with a backend/API endpoint at api/ask-guru.ts, with server.ts likely providing local serving or API integration. Environment-backed secrets/configuration are implied by .env.example; AI-provider credentials should remain server-side and not enter the Vite client bundle.
Data Model and Supporting Runtime
src/types.ts defines shared domain contracts for lessons, learner state, navigation, or chat data. src/data/mockData.ts provides the current local content/state source, making the application likely demo- or prototype-oriented until persistence/content APIs replace it. Build and development execution use Vite via vite.config.ts, with dependencies and scripts defined in package.json.
Main entry points: App.tsx App shell · BottomNavBar.tsx Bottom navigation · PronunciationCoach.tsx Pronunciation coach · mockData.ts Local learning data
Components 22
Vite React Client
Single-page learning experience.
- Vite runtime · Builds and serves the client.
vite.config.ts - Client entry
src/main.tsx - App shell · Owns active-view and shared overlay state.
src/App.tsx - Top app bar
src/components/TopAppBar.tsx - Bottom navigation
src/components/BottomNavBar.tsx - Domain contracts
src/types.ts - Ask Guru chat
src/components/AskGuruChat.tsx
Learning Experiences
- Home
src/components/HomeView.tsx - Learn
src/components/LearnView.tsx - Practice
src/components/PracticeView.tsx - Lesson modal
src/components/LessonModal.tsx - Tradition selector
src/components/TraditionSelectModal.tsx - Local learning data · Current prototype content and state source.
src/data/mockData.ts
Progress & Feedback
- Daily goals
src/components/DailyGoalTracker.tsx - Weekly XP chart
src/components/WeeklyXpD3Chart.tsx - Level-up modal
src/components/LevelUpCelebrationModal.tsx - Confetti canvas
src/components/ConfettiCanvas.tsx
Speech & Audio
Browser capability boundary.
- Pronunciation coach · Requires microphone permission and recognition support.
src/components/PronunciationCoach.tsx - Speech recognition
src/utils/speechRecognition.ts - Audio utilities
src/utils/audio.ts
Guru Backend
Server-side AI credential boundary.
- Ask Guru API · Keeps AI-provider credentials off the client.
api/ask-guru.ts - Server integration · Local serving or API integration surface.
server.ts
Connections 23
- Vite runtime → Client entry: serves
- Client entry → App shell: renders
- App shell → Top app bar: composes
- App shell → Bottom navigation: composes
- Bottom navigation → Home: navigates
- Bottom navigation → Learn: navigates
- Bottom navigation → Practice: navigates
- App shell → Lesson modal: opens
- App shell → Tradition selector: opens
- Learn → Local learning data: loads content
- Lesson modal → Local learning data: uses lessons
- App shell → Daily goals: shows progress
- App shell → Weekly XP chart: shows progress
- App shell → Level-up modal: triggers
- Level-up modal → Confetti canvas: renders
- Practice → Pronunciation coach: hosts
- Pronunciation coach → Speech recognition: recognizes speech
- Pronunciation coach → Audio utilities: records or plays
- App shell → Ask Guru chat: opens
- Ask Guru chat → Ask Guru API: sends chat request
- Server integration → Ask Guru API: integrates
- App shell → Domain contracts: uses contracts
- Local learning data → Domain contracts: conforms to