How freger-ucu/ai-tutor works
AI Tutor is a React/FastAPI learning platform: students request answer feedback and learning support, while teachers generate notes, tests, and recommendations adapted to student performance. The backend exposes role-based APIs and LangGraph learning flows, with textbook-grounded retrieval and configurable LLM access. The frontend presents role-specific pages and keeps some materials and recommendations in browser storage. The tree and excerpts support the main subsystems; some endpoint-to-flow wiring is inferred only at the documented product-capability level, so uncertain internal links are omitted.
Main entry points: llm_client.py LLM client · pages Teacher pages · student.py Student endpoints · App.tsx Web application
Components 27
Learning interface
- Web application
frontend/src/App.tsx - Student pages
frontend/src/pages - Teacher pages
frontend/src/pages - Role API clients
frontend/src/api - HTTP client
frontend/src/api/client.ts
Application API
- FastAPI application
backend/app/main.py - API router
backend/app/api/v1/router.py - Student endpoints
backend/app/api/v1/student.py - Teacher endpoints
backend/app/api/v1/teacher.py
Learning workflows
- Answer checking
backend/app/graph/flows/check_answer.py - Answer feedback
backend/app/graph/flows/feedback.py - Note generation
backend/app/graph/flows/notes.py - Recommendations
backend/app/graph/flows/recommendation.py - Test solving
backend/app/services/solver.py
Knowledge and AI
- Workflow retrieval
backend/app/graph/shared/rag_node.py - Agentic retrieval
backend/app/rag/graph.py - Smart retrieval
backend/app/rag/nodes/smart_retrieve.py - Retrieval components
backend/app/rag/utils - LLM client
backend/app/rag/utils/llm_client.py - Textbook embeddings
backend/app/rag
Learning data
- Browser storage
- Materials storage
frontend/src/data/materialsStorage.ts - Recommendation storage
frontend/src/data/recommendationsStorage.ts - Student performance data
backend/app/services
Other components
- Student
- Teacher
- LLM providers
Connections 34
- Student → Web application: uses
- Teacher → Web application: uses
- Web application → Student pages: routes to
- Web application → Teacher pages: routes to
- Student pages → Role API clients: requests
- Teacher pages → Role API clients: requests
- Role API clients → HTTP client: calls
- HTTP client → FastAPI application: HTTP requests
- FastAPI application → API router: mounts
- API router → Student endpoints: dispatches
- API router → Teacher endpoints: dispatches
- Student endpoints → Answer checking: runs checking
- Student endpoints → Answer feedback: requests feedback
- Student endpoints → Test solving: requests analysis
- Teacher endpoints → Note generation: generates notes
- Teacher endpoints → Recommendations: generates recommendations
- Answer checking → Workflow retrieval: retrieves context
- Answer feedback → Workflow retrieval: retrieves context
- Note generation → Workflow retrieval: retrieves context
- Workflow retrieval → Retrieval components: searches
- Agentic retrieval → Smart retrieval: dispatches retrieval
- Smart retrieval → Retrieval components: uses
- Retrieval components → Textbook embeddings: reads embeddings
- Answer checking → LLM client: requests generation
- Answer feedback → LLM client: requests generation
- Note generation → LLM client: requests generation
- Recommendations → LLM client: requests generation
- LLM client → LLM providers: calls
- Teacher pages → Materials storage: manages materials
- Student pages → Materials storage: reads assigned materials
- Teacher pages → Recommendation storage: saves recommendations
- Materials storage → Browser storage: reads and writes
- Recommendation storage → Browser storage: reads and writes
- Recommendations → Student performance data: uses performance data