Transcripta is a full-stack web app that extracts English transcripts from YouTube videos, makes the transcript searchable, generates an AI summary, and lets users ask questions about the video using the transcript as context.
The app has two parts:
client/: React + Vite + Tailwind frontend.server/: Express + TypeScript API that callsyt-dlpfor captions and Google Gemini for AI summary/Q&A.
- Extracts YouTube video metadata and English subtitles with
yt-dlp. - Displays video title, thumbnail, channel, duration, and timestamped transcript.
- Searches inside the transcript with highlighted matches.
- Generates a Gemini-powered summary from the transcript.
- Answers questions using only the extracted transcript.
- Supports configurable API URL and backend port through environment variables.
- Node.js 18 or newer.
- npm.
- A Google Gemini API key.
yt-dlpavailable in one of these ways:- keep
server/yt-dlp.exein place, - install
yt-dlpon your system PATH, - or set
YTDLP_PATHinserver/.env.
- keep
Install and configure the backend:
cd server
npm install
copy .env.example .envEdit server/.env and set:
PORT=3001
GEMINI_API_KEY=your_gemini_api_key_hereIf yt-dlp is not in server/yt-dlp.exe or on your PATH, also set:
YTDLP_PATH=C:\path\to\yt-dlp.exeInstall and configure the frontend:
cd ../client
npm install
copy .env.example .env.localclient/.env.local can usually stay as:
VITE_API_BASE_URL=http://localhost:3001Start the backend:
cd server
npm run devStart the frontend in another terminal:
cd client
npm run devOpen the Vite URL shown in the frontend terminal, usually:
http://localhost:5173
Build and run the backend:
cd server
npm run build
npm startBuild and preview the frontend:
cd client
npm run build
npm run previewFor deployment, serve client/dist with your static hosting provider and run the Express server separately. Set VITE_API_BASE_URL to the deployed backend URL before building the frontend.
Backend (server/.env):
| Variable | Required | Default | Description |
|---|---|---|---|
PORT |
No | 3001 |
Express server port. |
GEMINI_API_KEY |
Yes | none | Google Gemini API key used for summary and Q&A. |
CORS_ORIGIN |
No | local Vite origins | Comma-separated list of frontend origins allowed to call the API. |
JSON_BODY_LIMIT |
No | 1mb |
Maximum accepted JSON request body size. |
RATE_LIMIT_WINDOW_MS |
No | 900000 |
API rate-limit window in milliseconds. |
RATE_LIMIT_MAX_REQUESTS |
No | 60 |
Maximum API requests allowed per IP per window. |
MAX_SUMMARY_CHARS |
No | 120000 |
Maximum transcript length accepted by the summary endpoint. |
MAX_QNA_TRANSCRIPT_CHARS |
No | 120000 |
Maximum transcript length accepted by the Q&A endpoint. |
MAX_QNA_QUESTION_CHARS |
No | 1000 |
Maximum question length accepted by the Q&A endpoint. |
YTDLP_PATH |
No | auto-detected | Absolute path to yt-dlp or yt-dlp.exe. |
Frontend (client/.env.local):
| Variable | Required | Default | Description |
|---|---|---|---|
VITE_API_BASE_URL |
No | http://localhost:3001 |
Backend API base URL used by the React app. |
Backend base URL: http://localhost:3001
-
GET /health
Returns backend health status. -
POST /api/transcript
Body:{ "url": "https://www.youtube.com/watch?v=VIDEO_ID" }Returns video metadata, timestamped subtitles, and
fullText. -
POST /api/summarize
Body:{ "text": "Transcript text..." }Returns a Gemini-generated summary.
-
POST /api/qna
Body:{ "transcript": "Transcript text...", "question": "What is the main point?" }Returns an answer grounded in the transcript.
Transcripta/
client/
src/
App.tsx
main.tsx
package.json
server/
routes/
transcript.ts
summarize.ts
qna.ts
index.ts
yt-dlp.exe
package.json
README.md
-
GEMINI_API_KEY is not configured.
Createserver/.envand add a valid Gemini API key. -
Failed to extract transcriptoryt-dlpnot found
Confirmserver/yt-dlp.exeexists, installyt-dlpon PATH, or setYTDLP_PATH. -
No English subtitles found for this video
The video may not have English manual or auto-generated captions. -
Frontend cannot reach backend
Make sure the server is running onPORT=3001, or updateVITE_API_BASE_URLinclient/.env.local.
- Transcript extraction currently targets English subtitles only.
- The app does not store transcripts in a database.
- Q&A and summaries depend on the Gemini API and may fail if the key is missing, invalid, or rate-limited.
- Do not commit real
.envfiles or API keys.