# pranaya890/tutor_system architecture

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

- Interactive diagram: https://gitdiagram.com/pranaya890/tutor_system
- Repository: https://github.com/pranaya890/tutor_system

## Overview

This Django platform takes students from account access and PDF upload through document-grounded tutoring and quiz practice, then uses quiz attempts to show performance and recommend next steps. Document ingestion, retrieval, quiz generation/evaluation, and adaptive analysis are distinct stages. The graph includes the main internal service layer and documented dashboard capabilities. Some dashboard and analytics internals are unsampled; their nodes and links are limited to README claims and indexed references.

Main entry points: [`apps/quiz/services.py`](https://github.com/pranaya890/tutor_system/blob/main/apps/quiz/services.py) (Quiz Generation and Evaluation), [`apps/documents/services.py`](https://github.com/pranaya890/tutor_system/blob/main/apps/documents/services.py) (PDF Processing), [`apps/documents/rag.py`](https://github.com/pranaya890/tutor_system/blob/main/apps/documents/rag.py) (RAG Answering), [`apps/tutor/views.py`](https://github.com/pranaya890/tutor_system/blob/main/apps/tutor/views.py) (Tutor and Dashboard)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_identity["Student Access"]
  node_account_views["Account Views<br/>[views.py]"]
  node_account_forms["Account Forms<br/>[forms.py]"]
  node_account_data[("Account Records<br/>[models.py]")]
end

subgraph group_learning["Learning Content"]
  node_document_views["Document Views<br/>[views.py]"]
  node_document_api["Document API<br/>[api_views.py]"]
  node_document_processing["PDF Processing<br/>[services.py]"]
  node_document_validation["PDF Validation<br/>[validators.py]"]
  node_document_data[("Document Records<br/>[models.py]")]
  node_vector_store[("Vector Retrieval<br/>[vector_store.py]")]
  node_embedding["Embedding Generation<br/>[embeddings.py]"]
  node_rag["RAG Answering<br/>[rag.py]"]
  node_tutor_views["Tutor and Dashboard<br/>[views.py]"]
  node_tutor_data[("Tutor Sessions<br/>[models.py]")]
end

subgraph group_assessment["Quiz Practice"]
  node_quiz_api["Quiz API<br/>[api_views.py]"]
  node_quiz_services["Quiz Generation and Evaluation<br/>[services.py]"]
  node_quiz_data[("Quiz and Attempt Records<br/>[models.py]")]
end

subgraph group_insights["Progress Insights"]
  node_recommendation_service["Adaptive Recommendations<br/>[services.py]"]
  node_reset_data[("Performance Reset Records<br/>[models.py]")]
  node_analytics["Learning Analytics"]
end

node_student(("Student"))
node_gemini{{"Gemini AI"}}

node_student -->|"registers or signs in"| node_account_views
node_account_views -->|"uses forms"| node_account_forms
node_student -->|"uploads PDF"| node_document_views
node_document_views -->|"creates document"| node_document_processing
node_document_processing -->|"validates PDF"| node_document_validation
node_document_processing -->|"writes content and chunks"| node_document_data
node_document_processing -->|"stores chunks"| node_vector_store
node_vector_store -->|"generates vectors"| node_embedding
node_embedding -->|"requests embeddings"| node_gemini
node_student -->|"asks study question"| node_tutor_views
node_tutor_views -->|"requests grounded answer"| node_rag
node_rag -->|"retrieves matching chunks"| node_vector_store
node_rag -->|"looks up source titles"| node_document_data
node_rag -->|"generates answer"| node_gemini
node_tutor_views -->|"reads and saves sessions"| node_tutor_data
node_student -->|"requests quiz practice"| node_quiz_api
node_quiz_api -->|"generates quiz"| node_quiz_services
node_quiz_services -->|"retrieves topic context"| node_vector_store
node_quiz_services -->|"checks document ownership"| node_document_data
node_quiz_services -->|"creates quiz questions"| node_quiz_data
node_quiz_services -->|"generates and evaluates"| node_gemini
node_quiz_api -->|"saves attempt answers"| node_quiz_data
node_quiz_api -->|"requests performance analysis"| node_recommendation_service
node_recommendation_service -->|"aggregates completed attempts"| node_quiz_data
node_recommendation_service -->|"applies reset cutoffs"| node_reset_data
node_tutor_views -->|"builds dashboard insights"| node_recommendation_service
node_student -->|"views learning progress"| node_analytics
node_analytics -.->|"summarizes quiz results"| node_quiz_data

click node_account_views "https://github.com/pranaya890/tutor_system/blob/main/apps/accounts/views.py"
click node_account_forms "https://github.com/pranaya890/tutor_system/blob/main/apps/accounts/forms.py"
click node_account_data "https://github.com/pranaya890/tutor_system/blob/main/apps/accounts/models.py"
click node_document_views "https://github.com/pranaya890/tutor_system/blob/main/apps/documents/views.py"
click node_document_api "https://github.com/pranaya890/tutor_system/blob/main/apps/documents/api_views.py"
click node_document_processing "https://github.com/pranaya890/tutor_system/blob/main/apps/documents/services.py"
click node_document_validation "https://github.com/pranaya890/tutor_system/blob/main/apps/documents/validators.py"
click node_document_data "https://github.com/pranaya890/tutor_system/blob/main/apps/documents/models.py"
click node_vector_store "https://github.com/pranaya890/tutor_system/blob/main/apps/documents/vector_store.py"
click node_embedding "https://github.com/pranaya890/tutor_system/blob/main/apps/documents/embeddings.py"
click node_rag "https://github.com/pranaya890/tutor_system/blob/main/apps/documents/rag.py"
click node_tutor_views "https://github.com/pranaya890/tutor_system/blob/main/apps/tutor/views.py"
click node_tutor_data "https://github.com/pranaya890/tutor_system/blob/main/apps/tutor/models.py"
click node_quiz_api "https://github.com/pranaya890/tutor_system/blob/main/apps/quiz/api_views.py"
click node_quiz_services "https://github.com/pranaya890/tutor_system/blob/main/apps/quiz/services.py"
click node_quiz_data "https://github.com/pranaya890/tutor_system/blob/main/apps/quiz/models.py"
click node_recommendation_service "https://github.com/pranaya890/tutor_system/blob/main/apps/recommendations/services.py"
click node_reset_data "https://github.com/pranaya890/tutor_system/blob/main/apps/recommendations/models.py"
click node_analytics "https://github.com/pranaya890/tutor_system/tree/main/apps/analytics"

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_account_views,node_account_forms,node_account_data toneBlue
class node_document_views,node_document_api,node_document_processing,node_document_validation,node_document_data,node_vector_store,node_embedding,node_rag,node_tutor_views,node_tutor_data toneAmber
class node_quiz_api,node_quiz_services,node_quiz_data toneMint
class node_recommendation_service,node_reset_data,node_analytics toneRose
class node_student,node_gemini toneIndigo
```

## Components

### Student Access

- [Account Views](https://github.com/pranaya890/tutor_system/blob/main/apps/accounts/views.py): `apps/accounts/views.py`
- [Account Forms](https://github.com/pranaya890/tutor_system/blob/main/apps/accounts/forms.py): `apps/accounts/forms.py`
- [Account Records](https://github.com/pranaya890/tutor_system/blob/main/apps/accounts/models.py): `apps/accounts/models.py`

### Learning Content

- [Document Views](https://github.com/pranaya890/tutor_system/blob/main/apps/documents/views.py): `apps/documents/views.py`
- [Document API](https://github.com/pranaya890/tutor_system/blob/main/apps/documents/api_views.py): `apps/documents/api_views.py`
- [PDF Processing](https://github.com/pranaya890/tutor_system/blob/main/apps/documents/services.py): `apps/documents/services.py`
- [PDF Validation](https://github.com/pranaya890/tutor_system/blob/main/apps/documents/validators.py): `apps/documents/validators.py`
- [Document Records](https://github.com/pranaya890/tutor_system/blob/main/apps/documents/models.py): `apps/documents/models.py`
- [Vector Retrieval](https://github.com/pranaya890/tutor_system/blob/main/apps/documents/vector_store.py): `apps/documents/vector_store.py`
- [Embedding Generation](https://github.com/pranaya890/tutor_system/blob/main/apps/documents/embeddings.py): `apps/documents/embeddings.py`
- [RAG Answering](https://github.com/pranaya890/tutor_system/blob/main/apps/documents/rag.py): `apps/documents/rag.py`
- [Tutor and Dashboard](https://github.com/pranaya890/tutor_system/blob/main/apps/tutor/views.py): `apps/tutor/views.py`
- [Tutor Sessions](https://github.com/pranaya890/tutor_system/blob/main/apps/tutor/models.py): `apps/tutor/models.py`

### Quiz Practice

- [Quiz API](https://github.com/pranaya890/tutor_system/blob/main/apps/quiz/api_views.py): `apps/quiz/api_views.py`
- [Quiz Generation and Evaluation](https://github.com/pranaya890/tutor_system/blob/main/apps/quiz/services.py): `apps/quiz/services.py`
- [Quiz and Attempt Records](https://github.com/pranaya890/tutor_system/blob/main/apps/quiz/models.py): `apps/quiz/models.py`

### Progress Insights

- [Adaptive Recommendations](https://github.com/pranaya890/tutor_system/blob/main/apps/recommendations/services.py): `apps/recommendations/services.py`
- [Performance Reset Records](https://github.com/pranaya890/tutor_system/blob/main/apps/recommendations/models.py): `apps/recommendations/models.py`
- [Learning Analytics](https://github.com/pranaya890/tutor_system/tree/main/apps/analytics): `apps/analytics`

### Other components

- **Student**
- **Gemini AI**

## Connections

- Student → Account Views: registers or signs in (evidence: `README.md`)
- Account Views → Account Forms: uses forms (evidence: `apps/accounts/views.py`)
- Student → Document Views: uploads PDF (evidence: `README.md`)
- Document Views → PDF Processing: creates document (evidence: `apps/documents/views.py`)
- PDF Processing → PDF Validation: validates PDF (evidence: `apps/documents/services.py`)
- PDF Processing → Document Records: writes content and chunks (evidence: `apps/documents/services.py`)
- PDF Processing → Vector Retrieval: stores chunks (evidence: `apps/documents/services.py`)
- Vector Retrieval → Embedding Generation: generates vectors (evidence: `apps/documents/vector_store.py`)
- Embedding Generation → Gemini AI: requests embeddings (evidence: `apps/documents/embeddings.py`)
- Student → Tutor and Dashboard: asks study question (evidence: `README.md`)
- Tutor and Dashboard → RAG Answering: requests grounded answer (evidence: `apps/tutor/views.py`)
- RAG Answering → Vector Retrieval: retrieves matching chunks (evidence: `apps/documents/rag.py`)
- RAG Answering → Document Records: looks up source titles (evidence: `apps/documents/rag.py`)
- RAG Answering → Gemini AI: generates answer (evidence: `apps/documents/rag.py`)
- Tutor and Dashboard → Tutor Sessions: reads and saves sessions (evidence: `apps/tutor/views.py`)
- Student → Quiz API: requests quiz practice (evidence: `README.md`)
- Quiz API → Quiz Generation and Evaluation: generates quiz (evidence: `apps/quiz/api_views.py`)
- Quiz Generation and Evaluation → Vector Retrieval: retrieves topic context (evidence: `apps/quiz/services.py`)
- Quiz Generation and Evaluation → Document Records: checks document ownership (evidence: `apps/quiz/services.py`)
- Quiz Generation and Evaluation → Quiz and Attempt Records: creates quiz questions (evidence: `apps/quiz/services.py`)
- Quiz Generation and Evaluation → Gemini AI: generates and evaluates (evidence: `apps/quiz/services.py`)
- Quiz API → Quiz and Attempt Records: saves attempt answers (evidence: `apps/quiz/api_views.py`)
- Quiz API → Adaptive Recommendations: requests performance analysis (evidence: `apps/quiz/api_views.py`)
- Adaptive Recommendations → Quiz and Attempt Records: aggregates completed attempts (evidence: `apps/recommendations/services.py`)
- Adaptive Recommendations → Performance Reset Records: applies reset cutoffs (evidence: `apps/recommendations/services.py`)
- Tutor and Dashboard → Adaptive Recommendations: builds dashboard insights (evidence: `apps/tutor/views.py`)
- Student → Learning Analytics: views learning progress (evidence: `README.md`)
- Learning Analytics → Quiz and Attempt Records: summarizes quiz results (evidence: `README.md`)
