How trinhtt8/mentor-thena works
MentorThena helps elementary students complete coding quests: Python runs in the browser, the backend detects stuck states, supplies and checks progressively specific hints, and returns student status; correct output docks the student at Ithaca. Teachers assign quests and monitor the class Sea Map and class-level insights. The README documents this workflow and the major backend capabilities. Some frontend-to-API links are documented rather than visible in sampled API source; unsampled subsystem internals are represented only at their supported directory paths.
Main entry points: app.py Flask API · StudentPage.jsx Quest Workspace · hint_giver.py Hint Generation · gemini_client.py Gemini Service
Components 25
Student Voyage
- Voyage Map
frontend/src/pages/HomePage.jsx - Quest Workspace
frontend/src/pages/StudentPage.jsx - Python Runner
frontend/public/pyodide-worker.js - Student Components
frontend/src/components - Voyage State
frontend/src/voyage.js - Login
frontend/src/pages/LoginPage.jsx
Teacher Fleet
- Class & Quests
frontend/src/pages/TeacherHome.jsx - Sea Map
frontend/src/pages/TeacherPage.jsx - Demo & Voyage Store
frontend/src/voyageStore.js
Detection & Guidance
- Flask API
backend/app.py - Stuck Detection
backend/argus/watcher.py - Hint Generation
backend/athena/hint_giver.py - Hint Prompts & Fallbacks
backend/athena/prompts.py - Answer Guard
backend/athena/siren_guard.py - Runtime Settings
backend/config.py
Class Data & Memory
- MongoDB Atlas
- Database Access
backend/db.py - Helpful Hint Memory
backend/ships_log/memory.py - Dashboard Data
backend/seamap/dashboard.py - Class Counts
backend/tiresias/class_counts.py - Teacher Insight
backend/tiresias/insights.py
Other components
- Student
- Teacher
- API Client
frontend/src/api.js - Gemini Service
backend/gemini_client.py
Connections 35
- Student → Login: signs in
README.md - Login → Voyage Map: opens voyage
frontend/src/App.jsx - Student → Quest Workspace: writes code
README.md - Voyage Map → Quest Workspace: opens quest
README.md - Quest Workspace → Python Runner: runs code
README.md - Quest Workspace → API Client: sends run & heartbeat
README.md - Python Runner → Quest Workspace: returns output
README.md - Quest Workspace → Student Components: renders
frontend/src/pages/StudentPage.jsx - Quest Workspace → Voyage State: uses voyage
- Teacher → Class & Quests: assigns quests
README.md - Teacher → Sea Map: monitors class
README.md - Class & Quests → API Client: requests class data
frontend/src/pages/TeacherHome.jsx - Sea Map → API Client: refreshes dashboard
README.md - Class & Quests → Demo & Voyage Store: uses demo state
frontend/src/pages/TeacherHome.jsx - Sea Map → Demo & Voyage Store: uses voyage state
frontend/src/pages/TeacherPage.jsx - API Client → Flask API: calls JSON routes
README.md - Flask API → Stuck Detection: checks student state
backend/app.py - Flask API → Hint Generation: requests hint
backend/app.py - Flask API → Dashboard Data: requests ship data
backend/app.py - Flask API → Class Counts: requests insight
backend/app.py - Hint Generation → Hint Prompts & Fallbacks: builds hint prompt
backend/athena/hint_giver.py - Hint Generation → Answer Guard: checks hint
backend/athena/hint_giver.py - Hint Generation → Gemini Service: generates hint
backend/athena/hint_giver.py - Answer Guard → Gemini Service: checks hint safety
backend/athena/siren_guard.py - Hint Generation → Helpful Hint Memory: looks up prior hint
backend/athena/hint_giver.py - Flask API → Helpful Hint Memory: saves helpful hint
README.md - Helpful Hint Memory → Gemini Service: embeds bug
backend/ships_log/memory.py - Database Access → MongoDB Atlas: connects collections
backend/db.py - Dashboard Data → Database Access: reads class records
backend/seamap/dashboard.py - Class Counts → Database Access: counts stuck students
backend/tiresias/class_counts.py - Class Counts → Teacher Insight: requests teacher tip
backend/tiresias/class_counts.py - Teacher Insight → Gemini Service: writes class tip
backend/tiresias/insights.py - Runtime Settings → Stuck Detection: sets detection rules
backend/argus/watcher.py - Runtime Settings → Gemini Service: sets model settings
backend/gemini_client.py - Flask API → Database Access: reads and writes
backend/app.py