# PRD: "Lecture-Lift" (Zero-Storage Video Summarizer) ## 1. Project Goal To build a MERN stack application that processes 1-hour coding lecture videos (4–5 GB) directly from Google Drive links, extracts the "meat" of the content, and provides a **10-minute summary** with **"Look Here" code timestamps** — all with **zero local server storage**. --- ## 2. Technical Stack | Layer | Technology | |-------|-----------| | **Frontend** | React.js with Tailwind CSS (modern, dark-themed UI for `ocdev` branding) | | **Backend** | Node.js & Express | | **Database** | MongoDB (Stores generated summaries and session metadata. *Note: Full user auth/login is post-MVP; MVP focuses on caching*). | | **AI Engine** | Gemini 1.5 Pro (via Antigravity) using System Instructions for "Coding TA" persona. **Requires Bring Your Own Key (BYOK)**. | | **Processing** | FFmpeg (piped in Node.js) for audio/frame extraction | --- ## 3. Core Functional Requirements (MVP) ### A. The "Smart Link" Input - User pastes a Google Drive link (ZIP or MP4). - Backend validates the link and checks file size via Drive API metadata. ### B. The "Streaming" Engine *(Critical)* - **No `fs.writeFile`**: The backend must use `stream.pipeline` to move data from the Google Drive `ReadStream` through an FFmpeg transform and into the Gemini File API. - **Audio Strip**: Extract 128 kbps mono audio (small enough for the Gemini Free Tier). ### C. The "Look Here" Detection - The AI must scan the audio for keywords: *"Look at this," "For example," "On my screen," "Check this code."* - **Output**: A JSON array of timestamps with a 1-sentence context of what the mentor is showing. ### D. Privacy, Security & "Bring Your Own Key" (BYOK) - **Local Storage Only**: The frontend will prompt the user to input their Gemini API key, which is saved *only* in their browser's local storage. It is never saved to our MongoDB database. - **Secure Transmission**: The React app will send the key to the Node backend via a secure HTTP header (e.g., `x-gemini-api-key`), rather than in the open request body or URL. - **Zero Backend Retention**: The backend uses the provided key strictly in-memory for the duration of the FFmpeg stream. The backend code will explicitly prevent logging the key to the console or writing it to disk. ### E. MongoDB: The "History & Caching" Layer Even though we dropped storing keys and large files, MongoDB still serves two critical roles for the MVP: 1. **Caching Summaries**: If a user submits a Google Drive link that has *already* been processed by someone else, we can instantly return the cached JSON summary from MongoDB instead of running the 5GB stream process and burning API tokens again. 2. **Session History (MVP)**: Users can view their recent summaries tied to their browser session or API Key without recalculating them. *(Full persistent user accounts and login are planned for a subsequent version)*. ### F. The 10-Minute Recap Dashboard - A **"Timeline"** view in React. - Summary broken into: **Concepts Covered**, **Code Snippets Explained**, and **Action Items**. --- ## 4. System Instruction for Antigravity (The "Brain") Paste this into the Antigravity **"System Prompt"** field: > *"You are an expert Coding TA. Your task is to analyze transcriptions of technical lectures. > Focus on syntax, logic, and 'Aha!' moments. When you encounter phrases like 'Look here' or > 'Watch this,' mark the timestamp and describe the code logic being displayed. Output all > summaries in a structured JSON format compatible with a React frontend."* --- ## 5. User Stories - **Story 1** — *As a student with a slow internet connection,* I want the server to do the heavy lifting so I don't have to download 50 GB of classes to my 45 kg laptop's SSD. - **Story 2** — *As a coder,* I want to skip the 'setup' talk and jump straight to the parts where the mentor explains the logic for the 'agro-ecommerce' site. --- ## 6. Implementation Plan | Step | Task | |------|------| | **Step 1** | Set up the Express server with Google Drive API integration. | | **Step 2** | Create the "Stream-to-FFmpeg" pipeline logic. | | **Step 3** | Design the React Dashboard with a "Searchable Timeline." | | **Step 4** | Connect the Antigravity API for the final summarization. |