# vishaldeo71-art/learnflow architecture

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

- Interactive diagram: https://gitdiagram.com/vishaldeo71-art/learnflow
- Repository: https://github.com/vishaldeo71-art/learnflow

## Overview

Learnflow is a timestamp-aware course learning assistant with a separate personalized mock-interview workflow. Learners use a video player and chat to ask questions about watched lesson content; the API imports or ingests material, retrieves eligible evidence, and returns cited responses. Interview sessions parse candidate context, generate follow-up questions, and produce a practice scorecard. The README also documents multiple model and storage options. Source excerpts are partial, so links to unsampled subsystems are included only where the README or SOURCE INDEX supports them.

Main entry points: [`backend/app/main.py`](https://github.com/vishaldeo71-art/learnflow/blob/main/backend/app/main.py) (FastAPI application), [`backend/app/retrieval.py`](https://github.com/vishaldeo71-art/learnflow/blob/main/backend/app/retrieval.py) (Timestamp-aware retrieval), [`backend/app/interview.py`](https://github.com/vishaldeo71-art/learnflow/blob/main/backend/app/interview.py) (Interview workflow), [`backend/app/embeddings.py`](https://github.com/vishaldeo71-art/learnflow/blob/main/backend/app/embeddings.py) (Embedding providers)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Learner experience"]
  node_assistant_ui["Learning assistant<br/>[Assistant.tsx]"]
  node_video_player["Video player<br/>[LessonPlayer.tsx]"]
  node_video_source["Video source parser<br/>[video-source.ts]"]
  node_api_proxy["Server API proxy<br/>[route.ts]"]
end

subgraph group_api["API workflows"]
  node_api_app["FastAPI application<br/>[main.py]"]
  node_domain["Learning domain models<br/>[domain.py]"]
  node_languages["Language support<br/>[languages.py]"]
end

subgraph group_content["Course content"]
  node_course_ingestion["Resource ingestion<br/>[ingestion.py]"]
  node_youtube_import["YouTube captions<br/>[youtube.py]"]
  node_video_notes["AI video notes<br/>[video_notes.py]"]
  node_course_store[("Course and session store<br/>[storage.py]")]
end

subgraph group_learning["Learning intelligence"]
  node_embedding["Embedding providers<br/>[embeddings.py]"]
  node_retrieval["Timestamp-aware retrieval<br/>[retrieval.py]"]
  node_source_quality["Source quality checks<br/>[source_quality.py]"]
  node_llm["Language model adapters<br/>[providers.py]"]
end

subgraph group_interviews["Interview practice"]
  node_interview_flow["Interview workflow<br/>[interview.py]"]
end

node_learner(("Learner"))
node_youtube_service["YouTube captions service"]
node_supabase[("Supabase PostgreSQL")]
node_model_services["Hosted model services"]

node_learner -->|"asks questions"| node_assistant_ui
node_learner -->|"plays lesson"| node_video_player
node_video_player -->|"parses URL"| node_video_source
node_assistant_ui -.->|"sends requests"| node_api_proxy
node_api_proxy -->|"forwards API calls"| node_api_app
node_api_app -->|"parses uploads"| node_course_ingestion
node_api_app -->|"imports captions"| node_youtube_import
node_api_app -->|"generates notes"| node_video_notes
node_api_app -->|"reads and writes"| node_course_store
node_api_app -->|"retrieves evidence"| node_retrieval
node_api_app -->|"generates responses"| node_llm
node_api_app -->|"runs interviews"| node_interview_flow
node_api_app -->|"creates embeddings"| node_embedding
node_api_app -->|"uses domain types"| node_domain
node_api_app -->|"serves languages"| node_languages
node_course_ingestion -->|"embeds chunks"| node_embedding
node_retrieval -->|"embeds queries"| node_embedding
node_retrieval -->|"queries eligible chunks"| node_course_store
node_retrieval -->|"filters passages"| node_source_quality
node_interview_flow -->|"generates questions"| node_llm
node_interview_flow -->|"formats language"| node_languages
node_interview_flow -->|"uses interview model"| node_domain
node_course_store -->|"persists courses"| node_supabase
node_youtube_import -->|"fetches captions"| node_youtube_service
node_embedding -.->|"requests vectors"| node_model_services
node_llm -.->|"requests generation"| node_model_services

click node_assistant_ui "https://github.com/vishaldeo71-art/learnflow/blob/main/frontend/components/Assistant.tsx"
click node_video_player "https://github.com/vishaldeo71-art/learnflow/blob/main/frontend/components/LessonPlayer.tsx"
click node_video_source "https://github.com/vishaldeo71-art/learnflow/blob/main/frontend/lib/video-source.ts"
click node_api_proxy "https://github.com/vishaldeo71-art/learnflow/blob/main/frontend/app/api/%5B...path%5D/route.ts"
click node_api_app "https://github.com/vishaldeo71-art/learnflow/blob/main/backend/app/main.py"
click node_course_ingestion "https://github.com/vishaldeo71-art/learnflow/blob/main/backend/app/ingestion.py"
click node_youtube_import "https://github.com/vishaldeo71-art/learnflow/blob/main/backend/app/youtube.py"
click node_video_notes "https://github.com/vishaldeo71-art/learnflow/blob/main/backend/app/video_notes.py"
click node_course_store "https://github.com/vishaldeo71-art/learnflow/blob/main/backend/app/storage.py"
click node_embedding "https://github.com/vishaldeo71-art/learnflow/blob/main/backend/app/embeddings.py"
click node_retrieval "https://github.com/vishaldeo71-art/learnflow/blob/main/backend/app/retrieval.py"
click node_source_quality "https://github.com/vishaldeo71-art/learnflow/blob/main/backend/app/source_quality.py"
click node_llm "https://github.com/vishaldeo71-art/learnflow/blob/main/backend/app/providers.py"
click node_interview_flow "https://github.com/vishaldeo71-art/learnflow/blob/main/backend/app/interview.py"
click node_domain "https://github.com/vishaldeo71-art/learnflow/blob/main/backend/app/domain.py"
click node_languages "https://github.com/vishaldeo71-art/learnflow/blob/main/backend/app/languages.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_assistant_ui,node_video_player,node_video_source,node_api_proxy toneBlue
class node_api_app,node_domain,node_languages,node_supabase toneAmber
class node_course_ingestion,node_youtube_import,node_video_notes,node_course_store toneMint
class node_embedding,node_retrieval,node_source_quality,node_llm toneRose
class node_interview_flow,node_learner,node_youtube_service,node_model_services toneIndigo
```

## Components

### Learner experience

- [Learning assistant](https://github.com/vishaldeo71-art/learnflow/blob/main/frontend/components/Assistant.tsx): `frontend/components/Assistant.tsx`
- [Video player](https://github.com/vishaldeo71-art/learnflow/blob/main/frontend/components/LessonPlayer.tsx): `frontend/components/LessonPlayer.tsx`
- [Video source parser](https://github.com/vishaldeo71-art/learnflow/blob/main/frontend/lib/video-source.ts): `frontend/lib/video-source.ts`
- [Server API proxy](https://github.com/vishaldeo71-art/learnflow/blob/main/frontend/app/api/%5B...path%5D/route.ts): `frontend/app/api/[...path]/route.ts`

### API workflows

- [FastAPI application](https://github.com/vishaldeo71-art/learnflow/blob/main/backend/app/main.py): `backend/app/main.py`
- [Learning domain models](https://github.com/vishaldeo71-art/learnflow/blob/main/backend/app/domain.py): `backend/app/domain.py`
- [Language support](https://github.com/vishaldeo71-art/learnflow/blob/main/backend/app/languages.py): `backend/app/languages.py`

### Course content

- [Resource ingestion](https://github.com/vishaldeo71-art/learnflow/blob/main/backend/app/ingestion.py): `backend/app/ingestion.py`
- [YouTube captions](https://github.com/vishaldeo71-art/learnflow/blob/main/backend/app/youtube.py): `backend/app/youtube.py`
- [AI video notes](https://github.com/vishaldeo71-art/learnflow/blob/main/backend/app/video_notes.py): `backend/app/video_notes.py`
- [Course and session store](https://github.com/vishaldeo71-art/learnflow/blob/main/backend/app/storage.py): `backend/app/storage.py`

### Learning intelligence

- [Embedding providers](https://github.com/vishaldeo71-art/learnflow/blob/main/backend/app/embeddings.py): `backend/app/embeddings.py`
- [Timestamp-aware retrieval](https://github.com/vishaldeo71-art/learnflow/blob/main/backend/app/retrieval.py): `backend/app/retrieval.py`
- [Source quality checks](https://github.com/vishaldeo71-art/learnflow/blob/main/backend/app/source_quality.py): `backend/app/source_quality.py`
- [Language model adapters](https://github.com/vishaldeo71-art/learnflow/blob/main/backend/app/providers.py): `backend/app/providers.py`

### Interview practice

- [Interview workflow](https://github.com/vishaldeo71-art/learnflow/blob/main/backend/app/interview.py): `backend/app/interview.py`

### Other components

- **Learner**
- **YouTube captions service**
- **Supabase PostgreSQL**
- **Hosted model services**

## Connections

- Learner → Learning assistant: asks questions (evidence: `README.md`)
- Learner → Video player: plays lesson (evidence: `README.md`)
- Video player → Video source parser: parses URL (evidence: `frontend/components/LessonPlayer.tsx`)
- Learning assistant → Server API proxy: sends requests
- Server API proxy → FastAPI application: forwards API calls (evidence: `README.md`)
- FastAPI application → Resource ingestion: parses uploads (evidence: `backend/app/main.py`)
- FastAPI application → YouTube captions: imports captions (evidence: `backend/app/main.py`)
- FastAPI application → AI video notes: generates notes (evidence: `backend/app/main.py`)
- FastAPI application → Course and session store: reads and writes (evidence: `backend/app/main.py`)
- FastAPI application → Timestamp-aware retrieval: retrieves evidence (evidence: `backend/app/main.py`)
- FastAPI application → Language model adapters: generates responses (evidence: `backend/app/main.py`)
- FastAPI application → Interview workflow: runs interviews (evidence: `backend/app/main.py`)
- FastAPI application → Embedding providers: creates embeddings (evidence: `backend/app/main.py`)
- FastAPI application → Learning domain models: uses domain types (evidence: `backend/app/main.py`)
- FastAPI application → Language support: serves languages (evidence: `backend/app/main.py`)
- Resource ingestion → Embedding providers: embeds chunks (evidence: `backend/app/ingestion.py`)
- Timestamp-aware retrieval → Embedding providers: embeds queries (evidence: `backend/app/retrieval.py`)
- Timestamp-aware retrieval → Course and session store: queries eligible chunks (evidence: `backend/app/retrieval.py`)
- Timestamp-aware retrieval → Source quality checks: filters passages (evidence: `backend/app/retrieval.py`)
- Interview workflow → Language model adapters: generates questions (evidence: `backend/app/interview.py`)
- Interview workflow → Language support: formats language (evidence: `backend/app/interview.py`)
- Interview workflow → Learning domain models: uses interview model (evidence: `backend/app/interview.py`)
- Course and session store → Supabase PostgreSQL: persists courses (evidence: `README.md`)
- YouTube captions → YouTube captions service: fetches captions (evidence: `README.md`)
- Embedding providers → Hosted model services: requests vectors (evidence: `README.md`)
- Language model adapters → Hosted model services: requests generation (evidence: `README.md`)
