# bhaskar9832/ai-tution architecture

> Architecture diagram of the GitHub repository bhaskar9832/ai-tution, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-02). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/bhaskar9832/ai-tution
- Repository: https://github.com/bhaskar9832/ai-tution

## Overview

AI-Tution is a learning platform with web and Expo mobile clients, a Flask API, AI-generated study resources, and Supabase-backed authentication and user data. The main workflow is a student signing in, uploading material, and studying generated resources; dashboards and video recommendations are additional capabilities. README statements support the backend processing and integration branches, while sampled client excerpts show web auth and UI composition. Several backend and mobile details are unsampled, so uncertain client-to-API links are marked dashed.

Main entry points: [`backend/app.py`](https://github.com/bhaskar9832/ai-tution/blob/main/backend/app.py) (Flask API), [`frontend/AITUTION/src/components/StudyUI.jsx`](https://github.com/bhaskar9832/ai-tution/blob/main/frontend/AITUTION/src/components/StudyUI.jsx) (Web study UI), [`studyai/StudyContext.tsx`](https://github.com/bhaskar9832/ai-tution/blob/main/studyai/StudyContext.tsx) (Study state), [`studyai/app/home.tsx`](https://github.com/bhaskar9832/ai-tution/blob/main/studyai/app/home.tsx) (Mobile home)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web client"]
  node_webapp["Web app<br/>[App.jsx]"]
  node_web_auth["Web sign-in<br/>[AuthScreen.jsx]"]
  node_web_study["Web study UI<br/>[StudyUI.jsx]"]
  node_web_upload["Material upload<br/>[UploadCard.jsx]"]
  node_web_resources["Study viewers<br/>[SummaryView.jsx]"]
  node_web_quiz["Quiz and Q&amp;A<br/>[Quiz.jsx]"]
  node_web_cards["Flashcards<br/>[FlashcardsView.jsx]"]
  node_web_videos["Video suggestions"]
end

subgraph group_mobile["Mobile client"]
  node_mobile_auth["Mobile sign-in<br/>[index.tsx]"]
  node_mobile_home["Mobile home<br/>[home.tsx]"]
  node_mobile_state["Study state<br/>[StudyContext.tsx]"]
  node_mobile_tools["Study screens<br/>[summary.tsx]"]
  node_mobile_quiz["Quiz and tests<br/>[quiz.tsx]"]
  node_mobile_mindmap["Mind maps<br/>[mindmap.tsx]"]
  node_mobile_ask["Study Q&amp;A<br/>[ask.tsx]"]
  node_mobile_videos["Video suggestions<br/>[videos.tsx]"]
  node_dashboards["Progress dashboards<br/>[index.tsx]"]
end

subgraph group_backend["Learning API"]
  node_api["Flask API<br/>[app.py]"]
  node_document_processing["PDF and OCR<br/>[app.py]"]
  node_generation["AI study generation<br/>[app.py]"]
  node_backend_mindmap["Mind map generation<br/>[app.py]"]
  node_backend_videos["Video recommendations<br/>[app.py]"]
end

subgraph group_integrations["Data and services"]
  node_supabase[("Supabase")]
  node_gemini["Gemini API"]
  node_tesseract["Tesseract OCR"]
  node_youtube["YouTube"]
end

node_student(("Student"))

node_student -->|"uses"| node_webapp
node_webapp -->|"shows signed out"| node_web_auth
node_webapp -->|"shows signed in"| node_web_study
node_web_auth -->|"authenticates"| node_supabase
node_webapp -->|"checks session"| node_supabase
node_web_study -->|"renders"| node_web_upload
node_web_study -->|"renders"| node_web_resources
node_web_study -->|"renders"| node_web_quiz
node_web_study -->|"renders"| node_web_cards
node_web_study -->|"renders"| node_web_videos
node_student -->|"uses"| node_mobile_auth
node_mobile_auth -->|"authenticates"| node_supabase
node_student -.->|"uses"| node_mobile_home
node_mobile_home -->|"uses"| node_mobile_state
node_mobile_home -.->|"requests study data"| node_api
node_mobile_state -->|"defines API routes"| node_api
node_mobile_state -.->|"shares study state"| node_mobile_tools
node_mobile_state -->|"shares study state"| node_mobile_quiz
node_mobile_state -->|"shares study state"| node_mobile_mindmap
node_mobile_state -->|"shares study state"| node_dashboards
node_student -->|"uploads material"| node_api
node_api -->|"processes documents"| node_document_processing
node_document_processing -->|"scans documents"| node_tesseract
node_document_processing -->|"provides extracted text"| node_generation
node_generation -->|"generates resources"| node_gemini
node_api -->|"generates mind maps"| node_backend_mindmap
node_api -->|"recommends videos"| node_backend_videos
node_api -->|"manages user data"| node_supabase
node_api -->|"returns study materials"| node_student
node_backend_videos -.->|"finds videos"| node_youtube
node_mobile_auth -->|"routes after login"| node_mobile_home
node_mobile_home -.->|"offers Q&amp;A"| node_mobile_ask
node_mobile_home -.->|"offers videos"| node_mobile_videos

click node_webapp "https://github.com/bhaskar9832/ai-tution/blob/main/frontend/AITUTION/src/App.jsx"
click node_web_auth "https://github.com/bhaskar9832/ai-tution/blob/main/frontend/AITUTION/src/components/AuthScreen.jsx"
click node_web_study "https://github.com/bhaskar9832/ai-tution/blob/main/frontend/AITUTION/src/components/StudyUI.jsx"
click node_web_upload "https://github.com/bhaskar9832/ai-tution/blob/main/frontend/AITUTION/src/components/UploadCard.jsx"
click node_web_resources "https://github.com/bhaskar9832/ai-tution/blob/main/frontend/AITUTION/src/components/SummaryView.jsx"
click node_web_quiz "https://github.com/bhaskar9832/ai-tution/blob/main/frontend/AITUTION/src/components/Quiz.jsx"
click node_web_cards "https://github.com/bhaskar9832/ai-tution/blob/main/frontend/AITUTION/src/components/FlashcardsView.jsx"
click node_web_videos "https://github.com/bhaskar9832/ai-tution/blob/main/frontend/AITUTION/src/components/RecommendedVideos.jsx"
click node_mobile_auth "https://github.com/bhaskar9832/ai-tution/blob/main/studyai/app/index.tsx"
click node_mobile_home "https://github.com/bhaskar9832/ai-tution/blob/main/studyai/app/home.tsx"
click node_mobile_state "https://github.com/bhaskar9832/ai-tution/blob/main/studyai/StudyContext.tsx"
click node_mobile_tools "https://github.com/bhaskar9832/ai-tution/blob/main/studyai/app/summary.tsx"
click node_mobile_quiz "https://github.com/bhaskar9832/ai-tution/blob/main/studyai/app/quiz.tsx"
click node_mobile_mindmap "https://github.com/bhaskar9832/ai-tution/blob/main/studyai/app/mindmap.tsx"
click node_mobile_ask "https://github.com/bhaskar9832/ai-tution/blob/main/studyai/app/ask.tsx"
click node_mobile_videos "https://github.com/bhaskar9832/ai-tution/blob/main/studyai/app/videos.tsx"
click node_dashboards "https://github.com/bhaskar9832/ai-tution/blob/main/studyai/app/user-dashboard/index.tsx"
click node_api "https://github.com/bhaskar9832/ai-tution/blob/main/backend/app.py"
click node_document_processing "https://github.com/bhaskar9832/ai-tution/blob/main/backend/app.py"
click node_generation "https://github.com/bhaskar9832/ai-tution/blob/main/backend/app.py"
click node_backend_mindmap "https://github.com/bhaskar9832/ai-tution/blob/main/backend/app.py"
click node_backend_videos "https://github.com/bhaskar9832/ai-tution/blob/main/backend/app.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_webapp,node_web_auth,node_web_study,node_web_upload,node_web_resources,node_web_quiz,node_web_cards,node_web_videos toneBlue
class node_mobile_auth,node_mobile_home,node_mobile_state,node_mobile_tools,node_mobile_quiz,node_mobile_mindmap,node_mobile_ask,node_mobile_videos,node_dashboards toneAmber
class node_api,node_document_processing,node_generation,node_backend_mindmap,node_backend_videos toneMint
class node_supabase,node_gemini,node_tesseract,node_youtube toneRose
class node_student toneIndigo
```

## Components

### Web client

- [Web app](https://github.com/bhaskar9832/ai-tution/blob/main/frontend/AITUTION/src/App.jsx): `frontend/AITUTION/src/App.jsx`
- [Web sign-in](https://github.com/bhaskar9832/ai-tution/blob/main/frontend/AITUTION/src/components/AuthScreen.jsx): `frontend/AITUTION/src/components/AuthScreen.jsx`
- [Web study UI](https://github.com/bhaskar9832/ai-tution/blob/main/frontend/AITUTION/src/components/StudyUI.jsx): `frontend/AITUTION/src/components/StudyUI.jsx`
- [Material upload](https://github.com/bhaskar9832/ai-tution/blob/main/frontend/AITUTION/src/components/UploadCard.jsx): `frontend/AITUTION/src/components/UploadCard.jsx`
- [Study viewers](https://github.com/bhaskar9832/ai-tution/blob/main/frontend/AITUTION/src/components/SummaryView.jsx): `frontend/AITUTION/src/components/SummaryView.jsx`
- [Quiz and Q&A](https://github.com/bhaskar9832/ai-tution/blob/main/frontend/AITUTION/src/components/Quiz.jsx): `frontend/AITUTION/src/components/Quiz.jsx`
- [Flashcards](https://github.com/bhaskar9832/ai-tution/blob/main/frontend/AITUTION/src/components/FlashcardsView.jsx): `frontend/AITUTION/src/components/FlashcardsView.jsx`
- [Video suggestions](https://github.com/bhaskar9832/ai-tution/blob/main/frontend/AITUTION/src/components/RecommendedVideos.jsx): `frontend/AITUTION/src/components/RecommendedVideos.jsx`

### Mobile client

- [Mobile sign-in](https://github.com/bhaskar9832/ai-tution/blob/main/studyai/app/index.tsx): `studyai/app/index.tsx`
- [Mobile home](https://github.com/bhaskar9832/ai-tution/blob/main/studyai/app/home.tsx): `studyai/app/home.tsx`
- [Study state](https://github.com/bhaskar9832/ai-tution/blob/main/studyai/StudyContext.tsx): `studyai/StudyContext.tsx`
- [Study screens](https://github.com/bhaskar9832/ai-tution/blob/main/studyai/app/summary.tsx): `studyai/app/summary.tsx`
- [Quiz and tests](https://github.com/bhaskar9832/ai-tution/blob/main/studyai/app/quiz.tsx): `studyai/app/quiz.tsx`
- [Mind maps](https://github.com/bhaskar9832/ai-tution/blob/main/studyai/app/mindmap.tsx): `studyai/app/mindmap.tsx`
- [Study Q&A](https://github.com/bhaskar9832/ai-tution/blob/main/studyai/app/ask.tsx): `studyai/app/ask.tsx`
- [Video suggestions](https://github.com/bhaskar9832/ai-tution/blob/main/studyai/app/videos.tsx): `studyai/app/videos.tsx`
- [Progress dashboards](https://github.com/bhaskar9832/ai-tution/blob/main/studyai/app/user-dashboard/index.tsx): `studyai/app/user-dashboard/index.tsx`

### Learning API

- [Flask API](https://github.com/bhaskar9832/ai-tution/blob/main/backend/app.py): `backend/app.py`
- [PDF and OCR](https://github.com/bhaskar9832/ai-tution/blob/main/backend/app.py): `backend/app.py`
- [AI study generation](https://github.com/bhaskar9832/ai-tution/blob/main/backend/app.py): `backend/app.py`
- [Mind map generation](https://github.com/bhaskar9832/ai-tution/blob/main/backend/app.py): `backend/app.py`
- [Video recommendations](https://github.com/bhaskar9832/ai-tution/blob/main/backend/app.py): `backend/app.py`

### Data and services

- **Supabase**
- **Gemini API**
- **Tesseract OCR**
- **YouTube**

### Other components

- **Student**

## Connections

- Student → Web app: uses
- Web app → Web sign-in: shows signed out (evidence: `frontend/AITUTION/src/App.jsx`)
- Web app → Web study UI: shows signed in (evidence: `frontend/AITUTION/src/App.jsx`)
- Web sign-in → Supabase: authenticates (evidence: `frontend/AITUTION/src/components/AuthScreen.jsx`)
- Web app → Supabase: checks session (evidence: `frontend/AITUTION/src/App.jsx`)
- Web study UI → Material upload: renders (evidence: `frontend/AITUTION/src/components/StudyUI.jsx`)
- Web study UI → Study viewers: renders (evidence: `frontend/AITUTION/src/components/StudyUI.jsx`)
- Web study UI → Quiz and Q&A: renders (evidence: `frontend/AITUTION/src/components/StudyUI.jsx`)
- Web study UI → Flashcards: renders (evidence: `frontend/AITUTION/src/components/StudyUI.jsx`)
- Web study UI → Video suggestions: renders (evidence: `frontend/AITUTION/src/components/StudyUI.jsx`)
- Student → Mobile sign-in: uses (evidence: `studyai/app/index.tsx`)
- Mobile sign-in → Supabase: authenticates (evidence: `studyai/app/index.tsx`)
- Student → Mobile home: uses
- Mobile home → Study state: uses (evidence: `studyai/app/home.tsx`)
- Mobile home → Flask API: requests study data
- Study state → Flask API: defines API routes (evidence: `studyai/StudyContext.tsx`)
- Study state → Study screens: shares study state
- Study state → Quiz and tests: shares study state (evidence: `studyai/app/quiz.tsx`)
- Study state → Mind maps: shares study state (evidence: `studyai/app/mindmap.tsx`)
- Study state → Progress dashboards: shares study state (evidence: `studyai/app/user-dashboard/index.tsx`)
- Student → Flask API: uploads material (evidence: `README.md`)
- Flask API → PDF and OCR: processes documents (evidence: `README.md`)
- PDF and OCR → Tesseract OCR: scans documents (evidence: `README.md`)
- PDF and OCR → AI study generation: provides extracted text (evidence: `README.md`)
- AI study generation → Gemini API: generates resources (evidence: `README.md`)
- Flask API → Mind map generation: generates mind maps (evidence: `README.md`)
- Flask API → Video recommendations: recommends videos (evidence: `README.md`)
- Flask API → Supabase: manages user data (evidence: `README.md`)
- Flask API → Student: returns study materials (evidence: `README.md`)
- Video recommendations → YouTube: finds videos
- Mobile sign-in → Mobile home: routes after login (evidence: `studyai/app/index.tsx`)
- Mobile home → Study Q&A: offers Q&A
- Mobile home → Video suggestions: offers videos
