How prathamj2309/tutor_ai_model works
TutorAI is a personalized IIT-JEE learning platform whose main workflow is authenticated student questions—optionally with an image—through a React client and FastAPI API to OCR and subject-routed AI tutoring, with conversation history persisted in Supabase. Separate branches provide OCR, mock exams, and profile/weakness features documented in the README. The graph shows only source-supported calls; quiz, profile, and weakness internals are represented at their known router/service paths because their implementations were not sampled.
Main entry points: App.jsx Web application · chat.py Chat endpoints · auth.py Token verification · quiz.py Quiz endpoints
Components 27
Student experience
- Web application
frontend/src/App.jsx - Sign-in UI
frontend/src/components/auth/LoginPage.jsx - Auth session hook
frontend/src/hooks/useAuth.js - Auth state
frontend/src/store/authStore.js - Chat experience
frontend/src/pages/ChatPage.jsx - Chat workflow
frontend/src/hooks/useChat.js - Image question UI
frontend/src/pages/OCRPage.jsx - Quiz experience
frontend/src/pages/QuizPage.jsx - Profile and progress
frontend/src/pages/ProfilePage.jsx
API and identity
- FastAPI application
backend/app/main.py - Token verification
backend/app/middleware/auth.py - Chat endpoints
backend/app/routers/chat.py - OCR endpoint
backend/app/routers/ocr.py - Quiz endpoints
backend/app/routers/quiz.py - Profile endpoints
backend/app/routers/profile.py - API schemas
backend/app/models/schemas.py
Tutoring and vision
- Subject-routed tutor
backend/app/services/llm_service.py - Image extraction service
backend/app/services/ocr_service.py - Qwen image reader
Image_To_Text_Classifier/main.py
Assessment and progress
- Mock test generator
backend/app/services/mock_test_service.py - Weakness analysis
backend/app/services/weakness_service.py
Persistence and auth
- Conversation history
backend/app/services/history_service.py - Supabase client
backend/app/core/supabase_client.py
Other components
- Student
- Supabase Auth
- Supabase database
- Model providers
Connections 37
- Student → Web application: uses
README.md - Web application → Sign-in UI: routes to
frontend/src/App.jsx - Web application → Chat experience: routes to
frontend/src/App.jsx - Web application → Image question UI: routes to
frontend/src/App.jsx - Web application → Quiz experience: routes to
frontend/src/App.jsx - Web application → Profile and progress: routes to
frontend/src/App.jsx - Web application → Auth session hook: initializes
frontend/src/App.jsx - Sign-in UI → Auth session hook: uses
frontend/src/components/auth/LoginPage.jsx - Auth session hook → Auth state: updates
frontend/src/hooks/useAuth.js - Auth session hook → Supabase Auth: authenticates with
frontend/src/hooks/useAuth.js - Chat experience → Chat workflow: uses
frontend/src/pages/ChatPage.jsx - Chat workflow → Chat endpoints: sends requests
frontend/src/hooks/useChat.js - Image question UI → OCR endpoint: submits images
frontend/src/pages/OCRPage.jsx - Quiz experience → Quiz endpoints: uses
- Profile and progress → Profile endpoints: uses
- FastAPI application → Chat endpoints: registers
backend/app/main.py - FastAPI application → OCR endpoint: registers
backend/app/main.py - FastAPI application → Quiz endpoints: registers
backend/app/main.py - FastAPI application → Profile endpoints: registers
backend/app/main.py - Chat endpoints → Token verification: checks identity
backend/app/routers/chat.py - OCR endpoint → Token verification: checks identity
backend/app/routers/ocr.py - Quiz endpoints → Token verification: checks identity
backend/app/routers/quiz.py - Profile endpoints → Token verification: checks identity
backend/app/routers/profile.py - Token verification → Supabase client: verifies token
backend/app/middleware/auth.py - Token verification → Supabase database: creates profile
backend/app/middleware/auth.py - Chat endpoints → Subject-routed tutor: requests answers
backend/app/routers/chat.py - Chat endpoints → Image extraction service: extracts image text
backend/app/routers/chat.py - OCR endpoint → Image extraction service: extracts image text
backend/app/routers/ocr.py - Image extraction service → Qwen image reader: runs inference
backend/app/services/ocr_service.py - Subject-routed tutor → Model providers: loads and generates
backend/app/services/llm_service.py - Chat endpoints → Conversation history: loads and saves
backend/app/routers/chat.py - Conversation history → Supabase client: queries
backend/app/services/history_service.py - Supabase client → Supabase database: reads and writes
- Quiz endpoints → Mock test generator: generates tests
backend/app/routers/quiz.py - Quiz endpoints → Weakness analysis: uses progress
backend/app/routers/quiz.py - Profile endpoints → Weakness analysis: loads progress
backend/app/routers/profile.py - Profile endpoints → Supabase client: queries profile
backend/app/routers/profile.py