# abhij5681-eng/project_veda_new architecture

> Architecture diagram of the GitHub repository abhij5681-eng/project_veda_new, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-12-03). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/abhij5681-eng/project_veda_new
- Repository: https://github.com/abhij5681-eng/project_veda_new

## Overview

Project Veda is an AI study tutor: learners authenticate, organize workspaces, upload study materials, and use document-grounded chat and adaptive practice. The frontend calls a FastAPI backend, whose services handle ingestion, tutoring, quizzes, and persistence. The graph preserves the documented UI and backend capabilities, but excerpts do not show every endpoint or service call; uncertain links are omitted.

Main entry points: [`frontend/src/App.jsx`](https://github.com/abhij5681-eng/project_veda_new/blob/main/frontend/src/App.jsx) (App shell), [`backend/main.py`](https://github.com/abhij5681-eng/project_veda_new/blob/main/backend/main.py) (HTTP API), [`frontend/src/api.js`](https://github.com/abhij5681-eng/project_veda_new/blob/main/frontend/src/api.js) (API client), [`backend/db_services.py`](https://github.com/abhij5681-eng/project_veda_new/blob/main/backend/db_services.py) (Database services)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Learner interface"]
  node_app["App shell<br/>[App.jsx]"]
  node_auth_ui["Sign-in UI<br/>[Auth.jsx]"]
  node_sidebar["Workspace sidebar<br/>[Sidebar.jsx]"]
  node_chat_ui["Study chat<br/>[ChatInterface.jsx]"]
  node_settings["Preferences UI<br/>[Settings.jsx]"]
  node_session["Session guardian"]
  node_api["API client<br/>[api.js]"]
end

subgraph group_backend["Tutor backend"]
  node_backend_api["HTTP API<br/>[main.py]"]
end

subgraph group_learning["Learning services"]
  node_parser["Document parser<br/>[document_parser.py]"]
  node_tutor["AI tutor<br/>[ai_services.py]"]
  node_quiz["Adaptive quizzes<br/>[quiz_services.py]"]
end

subgraph group_persistence["Data and identity"]
  node_auth["Auth services<br/>[auth_services.py]"]
  node_data["Database services<br/>[db_services.py]"]
end

node_learner(("Learner"))
node_supabase[("Supabase")]
node_email["Brevo email API"]
node_gemini["Gemini"]

node_learner -->|"uses"| node_app
node_app -->|"renders"| node_auth_ui
node_app -->|"renders"| node_sidebar
node_app -->|"renders"| node_chat_ui
node_app -->|"renders"| node_settings
node_app -->|"renders"| node_session
node_auth_ui -->|"requests auth"| node_api
node_sidebar -->|"manages workspace"| node_api
node_chat_ui -->|"requests tutoring"| node_api
node_app -->|"loads preferences"| node_api
node_settings -->|"updates preferences"| node_app
node_api -->|"HTTP requests"| node_backend_api
node_backend_api -->|"uses auth"| node_auth
node_backend_api -->|"uses persistence"| node_data
node_backend_api -->|"uses parsing"| node_parser
node_backend_api -->|"uses tutoring"| node_tutor
node_backend_api -->|"routes quizzes"| node_quiz
node_auth -->|"sends OTP"| node_email
node_data -->|"reads and writes"| node_supabase
node_backend_api -->|"manages storage"| node_supabase
node_tutor -->|"retrieves context"| node_data
node_quiz -->|"loads mastery"| node_data
node_quiz -->|"generates questions"| node_gemini

click node_app "https://github.com/abhij5681-eng/project_veda_new/blob/main/frontend/src/App.jsx"
click node_auth_ui "https://github.com/abhij5681-eng/project_veda_new/blob/main/frontend/src/components/Auth.jsx"
click node_sidebar "https://github.com/abhij5681-eng/project_veda_new/blob/main/frontend/src/components/Sidebar.jsx"
click node_chat_ui "https://github.com/abhij5681-eng/project_veda_new/blob/main/frontend/src/components/ChatInterface.jsx"
click node_settings "https://github.com/abhij5681-eng/project_veda_new/blob/main/frontend/src/components/Settings.jsx"
click node_session "https://github.com/abhij5681-eng/project_veda_new/blob/main/frontend/src/components/SessionGuardian.jsx"
click node_api "https://github.com/abhij5681-eng/project_veda_new/blob/main/frontend/src/api.js"
click node_backend_api "https://github.com/abhij5681-eng/project_veda_new/blob/main/backend/main.py"
click node_auth "https://github.com/abhij5681-eng/project_veda_new/blob/main/backend/auth_services.py"
click node_parser "https://github.com/abhij5681-eng/project_veda_new/blob/main/backend/document_parser.py"
click node_tutor "https://github.com/abhij5681-eng/project_veda_new/blob/main/backend/ai_services.py"
click node_quiz "https://github.com/abhij5681-eng/project_veda_new/blob/main/backend/quiz_services.py"
click node_data "https://github.com/abhij5681-eng/project_veda_new/blob/main/backend/db_services.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_app,node_auth_ui,node_sidebar,node_chat_ui,node_settings,node_session,node_api toneBlue
class node_backend_api,node_supabase toneAmber
class node_parser,node_tutor,node_quiz,node_email toneMint
class node_auth,node_data toneRose
class node_learner,node_gemini toneIndigo
```

## Components

### Learner interface

- [App shell](https://github.com/abhij5681-eng/project_veda_new/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Sign-in UI](https://github.com/abhij5681-eng/project_veda_new/blob/main/frontend/src/components/Auth.jsx): `frontend/src/components/Auth.jsx`
- [Workspace sidebar](https://github.com/abhij5681-eng/project_veda_new/blob/main/frontend/src/components/Sidebar.jsx): `frontend/src/components/Sidebar.jsx`
- [Study chat](https://github.com/abhij5681-eng/project_veda_new/blob/main/frontend/src/components/ChatInterface.jsx): `frontend/src/components/ChatInterface.jsx`
- [Preferences UI](https://github.com/abhij5681-eng/project_veda_new/blob/main/frontend/src/components/Settings.jsx): `frontend/src/components/Settings.jsx`
- [Session guardian](https://github.com/abhij5681-eng/project_veda_new/blob/main/frontend/src/components/SessionGuardian.jsx): `frontend/src/components/SessionGuardian.jsx`
- [API client](https://github.com/abhij5681-eng/project_veda_new/blob/main/frontend/src/api.js): `frontend/src/api.js`

### Tutor backend

- [HTTP API](https://github.com/abhij5681-eng/project_veda_new/blob/main/backend/main.py): `backend/main.py`

### Learning services

- [Document parser](https://github.com/abhij5681-eng/project_veda_new/blob/main/backend/document_parser.py): `backend/document_parser.py`
- [AI tutor](https://github.com/abhij5681-eng/project_veda_new/blob/main/backend/ai_services.py): `backend/ai_services.py`
- [Adaptive quizzes](https://github.com/abhij5681-eng/project_veda_new/blob/main/backend/quiz_services.py): `backend/quiz_services.py`

### Data and identity

- [Auth services](https://github.com/abhij5681-eng/project_veda_new/blob/main/backend/auth_services.py): `backend/auth_services.py`
- [Database services](https://github.com/abhij5681-eng/project_veda_new/blob/main/backend/db_services.py): `backend/db_services.py`

### Other components

- **Learner**
- **Supabase**
- **Brevo email API**
- **Gemini**

## Connections

- Learner → App shell: uses
- App shell → Sign-in UI: renders (evidence: `frontend/src/App.jsx`)
- App shell → Workspace sidebar: renders (evidence: `frontend/src/App.jsx`)
- App shell → Study chat: renders (evidence: `frontend/src/App.jsx`)
- App shell → Preferences UI: renders (evidence: `frontend/src/App.jsx`)
- App shell → Session guardian: renders (evidence: `frontend/src/App.jsx`)
- Sign-in UI → API client: requests auth (evidence: `frontend/src/components/Auth.jsx`)
- Workspace sidebar → API client: manages workspace (evidence: `frontend/src/components/Sidebar.jsx`)
- Study chat → API client: requests tutoring (evidence: `frontend/src/components/ChatInterface.jsx`)
- App shell → API client: loads preferences (evidence: `frontend/src/App.jsx`)
- Preferences UI → App shell: updates preferences (evidence: `frontend/src/App.jsx`)
- API client → HTTP API: HTTP requests (evidence: `frontend/src/api.js`)
- HTTP API → Auth services: uses auth (evidence: `backend/main.py`)
- HTTP API → Database services: uses persistence (evidence: `backend/main.py`)
- HTTP API → Document parser: uses parsing (evidence: `backend/main.py`)
- HTTP API → AI tutor: uses tutoring (evidence: `backend/main.py`)
- HTTP API → Adaptive quizzes: routes quizzes (evidence: `backend/main.py`)
- Auth services → Brevo email API: sends OTP (evidence: `backend/auth_services.py`)
- Database services → Supabase: reads and writes (evidence: `backend/db_services.py`)
- HTTP API → Supabase: manages storage (evidence: `backend/main.py`)
- AI tutor → Database services: retrieves context (evidence: `backend/ai_services.py`)
- Adaptive quizzes → Database services: loads mastery (evidence: `backend/quiz_services.py`)
- Adaptive quizzes → Gemini: generates questions (evidence: `backend/quiz_services.py`)
