# abhishek-deshmukh9/preppilot architecture

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

- Interactive diagram: https://gitdiagram.com/abhishek-deshmukh9/preppilot
- Repository: https://github.com/abhishek-deshmukh9/preppilot

## Overview

PrepPilot AI turns uploaded study documents into searchable, AI-grounded tutoring and study materials, plus mock interviews. The main workflow is document upload and processing, followed by retrieval or content generation through the API, with results presented in the React study tools. The README documents several backend service connections not shown in sampled source; those relationships are represented at subsystem level. The tree and excerpts do not establish the full internal call wiring for every route.

Main entry points: [`backend/app/main.py`](https://github.com/abhishek-deshmukh9/preppilot/blob/main/backend/app/main.py) (API Application), [`backend/app/services/rag/document_processor.py`](https://github.com/abhishek-deshmukh9/preppilot/blob/main/backend/app/services/rag/document_processor.py) (Document Processing), [`backend/app/database/base.py`](https://github.com/abhishek-deshmukh9/preppilot/blob/main/backend/app/database/base.py) (Metadata Database), [`frontend/src/pages`](https://github.com/abhishek-deshmukh9/preppilot/tree/main/frontend/src/pages) (Study Pages)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Study Interface"]
  node_webapp["Study App<br/>[App.jsx]"]
  node_documents_ui["Document Tools<br/>[documentService.js]"]
  node_study_ui["Study Tools<br/>[studyService.js]"]
  node_chat_ui["Tutor Chat<br/>[chatService.js]"]
  node_companion["Learning Companion"]
  node_pages["Study Pages"]
end

subgraph group_api["Backend API"]
  node_api_app["API Application<br/>[main.py]"]
  node_upload["Upload Route<br/>[upload.py]"]
  node_documents["Document Routes<br/>[documents.py]"]
  node_chat["Chat Route<br/>[chat.py]"]
  node_history["History Route<br/>[history.py]"]
  node_study_routes["Study Routes"]
  node_interview_route["Interview Route<br/>[interview.py]"]
end

subgraph group_knowledge["Document Intelligence"]
  node_processor["Document Processing"]
  node_chunker["Text Chunking<br/>[chunker.py]"]
  node_embeddings["Embedding Service<br/>[embeddings.py]"]
  node_retriever["Context Retrieval<br/>[retriever.py]"]
  node_vector_store[("Vector Store<br/>[vector_store.py]")]
end

subgraph group_learning["Learning Features"]
  node_generators["Study Generators"]
  node_interview_generator["Interview Generator"]
  node_gemini["Gemini AI<br/>[gemini_client.py]"]
end

subgraph group_state["Persistence"]
  node_local_files[("Uploaded Files")]
  node_metadata[("Metadata Database<br/>[base.py]")]
  node_models["Stored Records"]
end

node_learner(("Learner"))

node_learner -->|"uses"| node_webapp
node_webapp -->|"routes to"| node_pages
node_pages -->|"requests documents"| node_documents_ui
node_pages -->|"requests study content"| node_study_ui
node_pages -->|"sends questions"| node_chat_ui
node_pages -->|"requests tutoring"| node_companion
node_documents_ui -->|"calls API"| node_api_app
node_study_ui -->|"calls API"| node_api_app
node_chat_ui -->|"calls API"| node_api_app
node_companion -->|"calls API"| node_api_app
node_api_app -->|"dispatches"| node_upload
node_api_app -->|"dispatches"| node_documents
node_api_app -->|"dispatches"| node_chat
node_api_app -->|"dispatches"| node_history
node_api_app -->|"dispatches"| node_study_routes
node_api_app -->|"dispatches"| node_interview_route
node_upload -->|"processes upload"| node_processor
node_processor -->|"chunks text"| node_chunker
node_processor -->|"embeds chunks"| node_embeddings
node_processor -->|"indexes chunks"| node_vector_store
node_processor -->|"stores files"| node_local_files
node_processor -->|"records metadata"| node_metadata
node_documents -->|"reads and updates"| node_metadata
node_documents -->|"manages document vectors"| node_vector_store
node_chat -->|"retrieves context"| node_retriever
node_retriever -->|"embeds query"| node_embeddings
node_retriever -->|"searches vectors"| node_vector_store
node_chat -->|"generates grounded reply"| node_gemini
node_chat -->|"records chat history"| node_metadata
node_history -->|"reads and clears history"| node_metadata
node_study_routes -->|"generates study materials"| node_generators
node_generators -->|"generates content"| node_gemini
node_generators -->|"uses document context"| node_vector_store
node_study_routes -->|"stores generated content"| node_metadata
node_interview_route -->|"builds interview"| node_interview_generator
node_interview_generator -->|"generates questions"| node_gemini
node_metadata -->|"persists records"| node_models

click node_webapp "https://github.com/abhishek-deshmukh9/preppilot/blob/main/frontend/src/App.jsx"
click node_documents_ui "https://github.com/abhishek-deshmukh9/preppilot/blob/main/frontend/src/services/documentService.js"
click node_study_ui "https://github.com/abhishek-deshmukh9/preppilot/blob/main/frontend/src/services/studyService.js"
click node_chat_ui "https://github.com/abhishek-deshmukh9/preppilot/blob/main/frontend/src/services/chatService.js"
click node_companion "https://github.com/abhishek-deshmukh9/preppilot/blob/main/frontend/src/services/companionService.js"
click node_pages "https://github.com/abhishek-deshmukh9/preppilot/tree/main/frontend/src/pages"
click node_api_app "https://github.com/abhishek-deshmukh9/preppilot/blob/main/backend/app/main.py"
click node_upload "https://github.com/abhishek-deshmukh9/preppilot/blob/main/backend/app/api/routes/upload.py"
click node_documents "https://github.com/abhishek-deshmukh9/preppilot/blob/main/backend/app/api/routes/documents.py"
click node_chat "https://github.com/abhishek-deshmukh9/preppilot/blob/main/backend/app/api/routes/chat.py"
click node_history "https://github.com/abhishek-deshmukh9/preppilot/blob/main/backend/app/api/routes/history.py"
click node_study_routes "https://github.com/abhishek-deshmukh9/preppilot/tree/main/backend/app/api/routes"
click node_interview_route "https://github.com/abhishek-deshmukh9/preppilot/blob/main/backend/app/api/routes/interview.py"
click node_processor "https://github.com/abhishek-deshmukh9/preppilot/blob/main/backend/app/services/rag/document_processor.py"
click node_chunker "https://github.com/abhishek-deshmukh9/preppilot/blob/main/backend/app/services/rag/chunker.py"
click node_embeddings "https://github.com/abhishek-deshmukh9/preppilot/blob/main/backend/app/services/rag/embeddings.py"
click node_retriever "https://github.com/abhishek-deshmukh9/preppilot/blob/main/backend/app/services/rag/retriever.py"
click node_vector_store "https://github.com/abhishek-deshmukh9/preppilot/blob/main/backend/app/services/rag/vector_store.py"
click node_generators "https://github.com/abhishek-deshmukh9/preppilot/tree/main/backend/app/services/generators"
click node_interview_generator "https://github.com/abhishek-deshmukh9/preppilot/blob/main/backend/app/services/generators/interview_generator.py"
click node_gemini "https://github.com/abhishek-deshmukh9/preppilot/blob/main/backend/app/services/llm/gemini_client.py"
click node_metadata "https://github.com/abhishek-deshmukh9/preppilot/blob/main/backend/app/database/base.py"
click node_models "https://github.com/abhishek-deshmukh9/preppilot/tree/main/backend/app/models"

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_documents_ui,node_study_ui,node_chat_ui,node_companion,node_pages toneBlue
class node_api_app,node_upload,node_documents,node_chat,node_history,node_study_routes,node_interview_route toneAmber
class node_processor,node_chunker,node_embeddings,node_retriever,node_vector_store toneMint
class node_generators,node_interview_generator,node_gemini toneRose
class node_local_files,node_metadata,node_models,node_learner toneIndigo
```

## Components

### Study Interface

- [Study App](https://github.com/abhishek-deshmukh9/preppilot/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Document Tools](https://github.com/abhishek-deshmukh9/preppilot/blob/main/frontend/src/services/documentService.js): `frontend/src/services/documentService.js`
- [Study Tools](https://github.com/abhishek-deshmukh9/preppilot/blob/main/frontend/src/services/studyService.js): `frontend/src/services/studyService.js`
- [Tutor Chat](https://github.com/abhishek-deshmukh9/preppilot/blob/main/frontend/src/services/chatService.js): `frontend/src/services/chatService.js`
- [Learning Companion](https://github.com/abhishek-deshmukh9/preppilot/blob/main/frontend/src/services/companionService.js): `frontend/src/services/companionService.js`
- [Study Pages](https://github.com/abhishek-deshmukh9/preppilot/tree/main/frontend/src/pages): `frontend/src/pages`

### Backend API

- [API Application](https://github.com/abhishek-deshmukh9/preppilot/blob/main/backend/app/main.py): `backend/app/main.py`
- [Upload Route](https://github.com/abhishek-deshmukh9/preppilot/blob/main/backend/app/api/routes/upload.py): `backend/app/api/routes/upload.py`
- [Document Routes](https://github.com/abhishek-deshmukh9/preppilot/blob/main/backend/app/api/routes/documents.py): `backend/app/api/routes/documents.py`
- [Chat Route](https://github.com/abhishek-deshmukh9/preppilot/blob/main/backend/app/api/routes/chat.py): `backend/app/api/routes/chat.py`
- [History Route](https://github.com/abhishek-deshmukh9/preppilot/blob/main/backend/app/api/routes/history.py): `backend/app/api/routes/history.py`
- [Study Routes](https://github.com/abhishek-deshmukh9/preppilot/tree/main/backend/app/api/routes): `backend/app/api/routes`
- [Interview Route](https://github.com/abhishek-deshmukh9/preppilot/blob/main/backend/app/api/routes/interview.py): `backend/app/api/routes/interview.py`

### Document Intelligence

- [Document Processing](https://github.com/abhishek-deshmukh9/preppilot/blob/main/backend/app/services/rag/document_processor.py): `backend/app/services/rag/document_processor.py`
- [Text Chunking](https://github.com/abhishek-deshmukh9/preppilot/blob/main/backend/app/services/rag/chunker.py): `backend/app/services/rag/chunker.py`
- [Embedding Service](https://github.com/abhishek-deshmukh9/preppilot/blob/main/backend/app/services/rag/embeddings.py): `backend/app/services/rag/embeddings.py`
- [Context Retrieval](https://github.com/abhishek-deshmukh9/preppilot/blob/main/backend/app/services/rag/retriever.py): `backend/app/services/rag/retriever.py`
- [Vector Store](https://github.com/abhishek-deshmukh9/preppilot/blob/main/backend/app/services/rag/vector_store.py): `backend/app/services/rag/vector_store.py`

### Learning Features

- [Study Generators](https://github.com/abhishek-deshmukh9/preppilot/tree/main/backend/app/services/generators): `backend/app/services/generators`
- [Interview Generator](https://github.com/abhishek-deshmukh9/preppilot/blob/main/backend/app/services/generators/interview_generator.py): `backend/app/services/generators/interview_generator.py`
- [Gemini AI](https://github.com/abhishek-deshmukh9/preppilot/blob/main/backend/app/services/llm/gemini_client.py): `backend/app/services/llm/gemini_client.py`

### Persistence

- **Uploaded Files**
- [Metadata Database](https://github.com/abhishek-deshmukh9/preppilot/blob/main/backend/app/database/base.py): `backend/app/database/base.py`
- [Stored Records](https://github.com/abhishek-deshmukh9/preppilot/tree/main/backend/app/models): `backend/app/models`

### Other components

- **Learner**

## Connections

- Learner → Study App: uses
- Study App → Study Pages: routes to
- Study Pages → Document Tools: requests documents
- Study Pages → Study Tools: requests study content
- Study Pages → Tutor Chat: sends questions
- Study Pages → Learning Companion: requests tutoring
- Document Tools → API Application: calls API
- Study Tools → API Application: calls API
- Tutor Chat → API Application: calls API
- Learning Companion → API Application: calls API
- API Application → Upload Route: dispatches
- API Application → Document Routes: dispatches
- API Application → Chat Route: dispatches
- API Application → History Route: dispatches
- API Application → Study Routes: dispatches
- API Application → Interview Route: dispatches
- Upload Route → Document Processing: processes upload
- Document Processing → Text Chunking: chunks text
- Document Processing → Embedding Service: embeds chunks
- Document Processing → Vector Store: indexes chunks
- Document Processing → Uploaded Files: stores files
- Document Processing → Metadata Database: records metadata
- Document Routes → Metadata Database: reads and updates
- Document Routes → Vector Store: manages document vectors
- Chat Route → Context Retrieval: retrieves context
- Context Retrieval → Embedding Service: embeds query
- Context Retrieval → Vector Store: searches vectors
- Chat Route → Gemini AI: generates grounded reply
- Chat Route → Metadata Database: records chat history
- History Route → Metadata Database: reads and clears history
- Study Routes → Study Generators: generates study materials
- Study Generators → Gemini AI: generates content
- Study Generators → Vector Store: uses document context
- Study Routes → Metadata Database: stores generated content
- Interview Route → Interview Generator: builds interview
- Interview Generator → Gemini AI: generates questions
- Metadata Database → Stored Records: persists records
