How bhavika-007/tubelens works
TubeLens turns a YouTube video into timestamp-aware transcript chunks, then answers video questions with either broad transcript context or locally retrieved passages. The web app adds authenticated video and chat management. The graph reflects the sampled backend orchestration and indexed module references; some retrieval internals and frontend HTTP wiring were not excerpted, so those links are omitted or marked unverified.
Main entry points: chat.py Chat routes · video.py Video routes · videoProcessor.py Video processing · main.py FastAPI app
Components 30
Web client
- App routing
Frontend/src/App.jsx - Chat screen
Frontend/src/pages/Chat.jsx - Login and register
Frontend/src/pages/Login.jsx - API client
Frontend/src/api/api.js
Backend service
- FastAPI app
Backend/main.py - Authentication routes
Backend/routes/auth.py - Video routes
Backend/routes/video.py - Chat routes
Backend/routes/chat.py - JWT authentication
Backend/utils/auth.py
Transcript ingestion
- YouTube utilities
Backend/utils/youtube.py - Video processing
videoProcessor.py - Transcript extraction
transcriptExtraction.py - Timestamped chunks
chunker.py - Embedding generation
embeddings.py
Question answering
- Query routing
queryRouter.py - Follow-up rewriting
queryRewrite.py - Hybrid retrieval
hybridRetrieval.py - Vector retrieval
vectorRetrieval.py - Keyword retrieval
bm25Retrieval.py - Passage reranking
reranker.py - Relevance check
relevanceGuard.py - Grounded answers
llm.py - Global answers
globalAnswer.py - Timestamp selection
timestamp.py
Persistence
- Vector storage
vectordb.py - MongoDB collections
Backend/database.py
Other components
- Viewer
- Groq LLM service
- YouTube transcript service
- ChromaDB
Connections 38
- Viewer → App routing: uses
Frontend/src/App.jsx - App routing → Chat screen: routes to
Frontend/src/App.jsx - App routing → Login and register: routes to
Frontend/src/App.jsx - Chat screen → API client: requests
Frontend/src/pages/Chat.jsx - Login and register → API client: requests
Frontend/src/pages/Login.jsx - FastAPI app → Authentication routes: registers
Backend/main.py - FastAPI app → Video routes: registers
Backend/main.py - FastAPI app → Chat routes: registers
Backend/main.py - Authentication routes → JWT authentication: uses
Backend/routes/auth.py - Chat routes → JWT authentication: authenticates
Backend/routes/chat.py - Video routes → JWT authentication: authenticates
Backend/routes/video.py - JWT authentication → MongoDB collections: reads users
Backend/utils/auth.py - Authentication routes → MongoDB collections: uses
Backend/routes/auth.py - Video routes → MongoDB collections: uses
Backend/routes/video.py - Chat routes → MongoDB collections: reads and writes
Backend/routes/chat.py - Video routes → Video processing: processes video
Backend/routes/video.py - Video routes → YouTube utilities: uses
Backend/routes/video.py - Chat routes → YouTube utilities: builds watch URL
Backend/routes/chat.py - Video processing → Transcript extraction: extracts transcript
videoProcessor.py - Video processing → Timestamped chunks: creates chunks
videoProcessor.py - Video processing → Embedding generation: embeds chunks
videoProcessor.py - Video processing → Vector storage: stores vectors
videoProcessor.py - Transcript extraction → YouTube transcript service: retrieves captions
transcriptExtraction.py - Vector storage → ChromaDB: stores in
- Chat routes → Follow-up rewriting: rewrites query
Backend/routes/chat.py - Chat routes → Query routing: classifies query
Backend/routes/chat.py - Chat routes → Global answers: answers global query
Backend/routes/chat.py - Chat routes → Hybrid retrieval: retrieves passages
Backend/routes/chat.py - Chat routes → Passage reranking: reranks passages
Backend/routes/chat.py - Chat routes → Relevance check: checks relevance
Backend/routes/chat.py - Chat routes → Grounded answers: generates answer
Backend/routes/chat.py - Chat routes → Timestamp selection: selects timestamp
Backend/routes/chat.py - Query routing → Grounded answers: classifies with
queryRouter.py - Hybrid retrieval → Vector retrieval: combines results
hybridRetrieval.py - Hybrid retrieval → Keyword retrieval: combines results
hybridRetrieval.py - Global answers → Grounded answers: uses model
globalAnswer.py - Grounded answers → Groq LLM service: requests completion
llm.py - API client → FastAPI app: calls API