How avaneeshtkur/virallens--insight-engine works
ViralLens compares a YouTube video with an Instagram Reel, then lets users ask transcript- and engagement-focused questions. The principal flow is URL submission, parallel video data collection, engagement calculation and chunk indexing, followed by session-scoped retrieval and streamed local-LLM answers with source citations. The graph also includes the documented LangGraph retrieval implementation. The excerpts show both that graph and a direct chat path in the API; unsampled UI and backend wiring is included only where the README documents it.
Main entry points: main.py FastAPI routes · App.jsx App session · nodes.py Retrieve context · ChatPanel.jsx Chat panel
Components 20
User interface
- App session
frontend/src/App.jsx - URL input
frontend/src/components/InputBar.jsx - Video cards
frontend/src/components/VideoCard.jsx - Chat panel
frontend/src/components/ChatPanel.jsx - Chat messages
frontend/src/components/ChatMessage.jsx - SSE client
frontend/src/hooks/useSSE.js
Video ingestion
- FastAPI routes
backend/main.py - YouTube fetch
backend/services/youtube_service.py - Instagram fetch
backend/services/instagram_service.py - Engagement rate
backend/utils/engagement.py - Transcript chunking
backend/services/chunker.py
Retrieval and analysis
- Local embeddings
backend/services/embedder.py - Chroma vector store
backend/services/vector_store.py - Retrieval graph
backend/graph/graph.py - Graph state
backend/graph/state.py - Retrieve context
backend/graph/nodes.py - Graph answer generation
backend/graph/nodes.py
Local and platform services
- Ollama LLM
- Video platforms
Other components
- Video analyst
Connections 26
- Video analyst → URL input: submits URLs
README.md - URL input → App session: reports analysis
frontend/src/App.jsx - App session → FastAPI routes: requests ingestion
README.md - FastAPI routes → YouTube fetch: fetches video A
backend/main.py - FastAPI routes → Instagram fetch: fetches video B
backend/main.py - YouTube fetch → Video platforms: fetches data
backend/services/youtube_service.py - Instagram fetch → Video platforms: fetches data
backend/services/instagram_service.py - FastAPI routes → Engagement rate: computes rates
backend/main.py - FastAPI routes → Transcript chunking: chunks transcripts
backend/main.py - FastAPI routes → Local embeddings: gets embedder
backend/main.py - FastAPI routes → Chroma vector store: indexes chunks
backend/main.py - FastAPI routes → App session: returns session data
README.md - App session → Video cards: displays videos
frontend/src/App.jsx - App session → Chat panel: opens session chat
frontend/src/App.jsx - Chat panel → Chat messages: renders messages
frontend/src/components/ChatPanel.jsx - Chat panel → SSE client: sends questions
frontend/src/components/ChatPanel.jsx - SSE client → FastAPI routes: streams chat request
README.md - FastAPI routes → Chroma vector store: retrieves chunks
backend/main.py - FastAPI routes → Ollama LLM: streams completion
README.md - Retrieval graph → Retrieve context: dispatches retrieval
backend/graph/graph.py - Retrieval graph → Graph answer generation: dispatches generation
backend/graph/graph.py - Retrieve context → Local embeddings: gets embeddings
backend/graph/nodes.py - Retrieve context → Chroma vector store: searches chunks
backend/graph/nodes.py - Graph answer generation → Ollama LLM: generates answer
backend/graph/nodes.py - Graph state → Retrieve context: holds graph inputs
backend/graph/nodes.py - Graph state → Graph answer generation: holds graph inputs
backend/graph/nodes.py