# priyankshu-07/vision architecture

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

- Interactive diagram: https://gitdiagram.com/priyankshu-07/vision
- Repository: https://github.com/priyankshu-07/vision

## Overview

VISION takes YouTube URLs, PDFs, or typed text through a Streamlit interface, sends them to FastAPI for extraction and optional transcription, summarization, and quiz generation, then saves outputs for later history viewing. The graph follows the sampled call sites and README-described MongoDB/Groq capabilities; dashboard history reads MongoDB directly in the sampled UI code. Unsampled details are not inferred.

Main entry points: [`backend/main.py`](https://github.com/priyankshu-07/vision/blob/main/backend/main.py) (FastAPI routes), [`frontend/app.py`](https://github.com/priyankshu-07/vision/blob/main/frontend/app.py) (Page router), [`frontend/main.py`](https://github.com/priyankshu-07/vision/blob/main/frontend/main.py) (Input and results), [`frontend/dashboard.py`](https://github.com/priyankshu-07/vision/blob/main/frontend/dashboard.py) (History dashboard)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Learning interface"]
  node_streamlit["Page router<br/>[app.py]"]
  node_home["Welcome page<br/>[home.py]"]
  node_summarizer["Input and results<br/>[main.py]"]
  node_dashboard["History dashboard<br/>[dashboard.py]"]
end

subgraph group_api["Backend orchestration"]
  node_api["FastAPI routes<br/>[main.py]"]
end

subgraph group_processing["Content processing"]
  node_pdf["PDF extraction<br/>[pdf_reader.py]"]
  node_youtube["Audio transcription"]
  node_whisper["Whisper model<br/>[whisper_model.py]"]
  node_summary["T5 summarization<br/>[T5.py]"]
  node_questions["Quiz generation"]
  node_langchain["LLM prompt chain"]
end

subgraph group_state["History storage"]
  node_dbhelper["Persistence helper<br/>[db.py]"]
  node_mongo[("MongoDB results")]
end

node_learner(("Learner"))
node_groq["Groq LLaMA API"]

node_learner -->|"uses"| node_streamlit
node_streamlit -->|"routes to"| node_home
node_streamlit -->|"routes to"| node_summarizer
node_streamlit -->|"routes to"| node_dashboard
node_summarizer -->|"submits inputs"| node_api
node_api -->|"extracts text"| node_pdf
node_api -->|"transcribes URL"| node_youtube
node_youtube -->|"transcribes audio"| node_whisper
node_api -->|"summarizes text"| node_summary
node_api -->|"generates questions"| node_questions
node_questions -->|"runs chain"| node_langchain
node_langchain -->|"calls model"| node_groq
node_api -->|"saves results"| node_dbhelper
node_dbhelper -->|"inserts records"| node_mongo
node_dashboard -->|"reads history"| node_mongo
node_api -->|"returns outputs"| node_summarizer

click node_streamlit "https://github.com/priyankshu-07/vision/blob/main/frontend/app.py"
click node_home "https://github.com/priyankshu-07/vision/blob/main/frontend/home.py"
click node_summarizer "https://github.com/priyankshu-07/vision/blob/main/frontend/main.py"
click node_dashboard "https://github.com/priyankshu-07/vision/blob/main/frontend/dashboard.py"
click node_api "https://github.com/priyankshu-07/vision/blob/main/backend/main.py"
click node_pdf "https://github.com/priyankshu-07/vision/blob/main/backend/pdf_reader.py"
click node_youtube "https://github.com/priyankshu-07/vision/blob/main/backend/youtube_transcriber.py"
click node_whisper "https://github.com/priyankshu-07/vision/blob/main/models/whisper_model.py"
click node_summary "https://github.com/priyankshu-07/vision/blob/main/models/T5.py"
click node_questions "https://github.com/priyankshu-07/vision/blob/main/backend/question_generator.py"
click node_langchain "https://github.com/priyankshu-07/vision/blob/main/backend/langchain_helper.py"
click node_dbhelper "https://github.com/priyankshu-07/vision/blob/main/backend/db.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_streamlit,node_home,node_summarizer,node_dashboard toneBlue
class node_api toneAmber
class node_pdf,node_youtube,node_whisper,node_summary,node_questions,node_langchain,node_groq toneMint
class node_dbhelper,node_mongo toneRose
class node_learner toneIndigo
```

## Components

### Learning interface

- [Page router](https://github.com/priyankshu-07/vision/blob/main/frontend/app.py): `frontend/app.py`
- [Welcome page](https://github.com/priyankshu-07/vision/blob/main/frontend/home.py): `frontend/home.py`
- [Input and results](https://github.com/priyankshu-07/vision/blob/main/frontend/main.py): `frontend/main.py`
- [History dashboard](https://github.com/priyankshu-07/vision/blob/main/frontend/dashboard.py): `frontend/dashboard.py`

### Backend orchestration

- [FastAPI routes](https://github.com/priyankshu-07/vision/blob/main/backend/main.py): `backend/main.py`

### Content processing

- [PDF extraction](https://github.com/priyankshu-07/vision/blob/main/backend/pdf_reader.py): `backend/pdf_reader.py`
- [Audio transcription](https://github.com/priyankshu-07/vision/blob/main/backend/youtube_transcriber.py): `backend/youtube_transcriber.py`
- [Whisper model](https://github.com/priyankshu-07/vision/blob/main/models/whisper_model.py): `models/whisper_model.py`
- [T5 summarization](https://github.com/priyankshu-07/vision/blob/main/models/T5.py): `models/T5.py`
- [Quiz generation](https://github.com/priyankshu-07/vision/blob/main/backend/question_generator.py): `backend/question_generator.py`
- [LLM prompt chain](https://github.com/priyankshu-07/vision/blob/main/backend/langchain_helper.py): `backend/langchain_helper.py`

### History storage

- [Persistence helper](https://github.com/priyankshu-07/vision/blob/main/backend/db.py): `backend/db.py`
- **MongoDB results**

### Other components

- **Learner**
- **Groq LLaMA API**

## Connections

- Learner → Page router: uses (evidence: `README.md`)
- Page router → Welcome page: routes to (evidence: `frontend/app.py`)
- Page router → Input and results: routes to (evidence: `frontend/app.py`)
- Page router → History dashboard: routes to (evidence: `frontend/app.py`)
- Input and results → FastAPI routes: submits inputs (evidence: `frontend/main.py`)
- FastAPI routes → PDF extraction: extracts text (evidence: `backend/main.py`)
- FastAPI routes → Audio transcription: transcribes URL (evidence: `backend/main.py`)
- Audio transcription → Whisper model: transcribes audio (evidence: `backend/youtube_transcriber.py`)
- FastAPI routes → T5 summarization: summarizes text (evidence: `backend/main.py`)
- FastAPI routes → Quiz generation: generates questions (evidence: `backend/main.py`)
- Quiz generation → LLM prompt chain: runs chain (evidence: `backend/question_generator.py`)
- LLM prompt chain → Groq LLaMA API: calls model (evidence: `backend/langchain_helper.py`)
- FastAPI routes → Persistence helper: saves results (evidence: `backend/main.py`)
- Persistence helper → MongoDB results: inserts records (evidence: `backend/db.py`)
- History dashboard → MongoDB results: reads history (evidence: `frontend/dashboard.py`)
- FastAPI routes → Input and results: returns outputs (evidence: `frontend/main.py`)
