How ahamie71/language_app works
Duolingua is a web language-learning app whose main loop is a learner chatting with an AI coach: the backend persists messages, calls the AI service for a reply and supporting translation/explanation, and stores the result. The frontend also offers direct, one-shot practice activities, alongside vocabulary, flashcards, dictation, and progress tracking. The README documents the AI service’s route/controller/model layers and local model runtimes. Some feature modules were not sampled, so their internal connections are shown only where documented.
Main entry points: controllers AI feature logic · conversationController.js Conversation handling · App.jsx App and routes · api.js API client
Components 23
Learning frontend
- App and routes
frontend/src/App.jsx - Conversation
frontend/src/pages/Conversation.jsx - Practice activities
frontend/src/pages/Exercises.jsx - Learning dashboard
frontend/src/pages/Dashboard.jsx - API client
frontend/src/services/api.js
Application backend
- HTTP API
backend/src/server.js - Conversation handling
backend/src/controllers/conversationController.js - Vocabulary and SRS
backend/src/controllers/vocabularyController.js - AI gateway
backend/src/services/aiService.js
AI service
- Flask route registry
ai_service/app.py - Feature endpoints
ai_service/routes - AI feature logic
ai_service/controllers - LLM client
ai_service/services/llm.py - NLLB translation
ai_service/services/translation.py - Intent classifier
ai_service/services/intent.py - Speech synthesis
ai_service/services/speech.py - Speech transcription
ai_service/services/transcription.py - Device selection
ai_service/services/device.py - Language model maps
ai_service/language
Data and models
- MySQL persistence
backend/src/config/database.js - Domain models
backend/src/models/index.js - Ollama LLM runtime
Other components
- Learner
Connections 26
- Learner → App and routes: uses
README.md - App and routes → Conversation: routes to
frontend/src/App.jsx - App and routes → Practice activities: routes to
frontend/src/App.jsx - Conversation → API client: calls
README.md - Practice activities → Flask route registry: calls directly
README.md - Learning dashboard → API client: uses
- API client → HTTP API: calls REST
README.md - HTTP API → Conversation handling: routes to
backend/src/server.js - Conversation handling → AI gateway: requests AI
backend/src/controllers/conversationController.js - Conversation handling → Vocabulary and SRS: extracts vocabulary
backend/src/controllers/conversationController.js - Conversation handling → Domain models: reads and writes
backend/src/controllers/conversationController.js - Vocabulary and SRS → Domain models: reads and writes
backend/src/controllers/vocabularyController.js - Domain models → MySQL persistence: uses Sequelize
- AI gateway → Flask route registry: calls endpoints
backend/src/services/aiService.js - Flask route registry → Feature endpoints: registers
ai_service/app.py - Feature endpoints → AI feature logic: dispatches
README.md - AI feature logic → LLM client: uses
README.md - AI feature logic → NLLB translation: uses
README.md - AI feature logic → Intent classifier: uses
README.md - AI feature logic → Speech synthesis: uses
README.md - AI feature logic → Speech transcription: uses
README.md - NLLB translation → Device selection: selects device
ai_service/services/translation.py - Speech synthesis → Device selection: selects device
ai_service/services/speech.py - Speech transcription → Language model maps: loads language maps
ai_service/services/transcription.py - LLM client → Ollama LLM runtime: HTTP chat
ai_service/services/llm.py - AI feature logic → Language model maps: uses language maps
README.md