MasteryBook Platform Status

Test results, bug inventory & fix roadmap — Generated 2026-02-22 — NotebookLM Reimagined

66
API Endpoints
12
Files Fixed Today
17
Open Bugs
3
Critical Issues

Architecture

Frontend (Next.js) Backend (FastAPI) Database ┌──────────────────────────┐ ┌──────────────────────────┐ ┌──────────────────────────┐ │ Vercel (Next.js 14+) │ │ Vercel (Python runtime) │ │ Supabase PostgreSQL │ │ └─ /api/* routes (Gemini) │ │ └─ /api/v1/* (66 endpoints)│ │ └─ 11 tables + RLS │ │ └─ React SPA + shadcn/ui │ │ └─ Gemini 2.5 Flash │ │ └─ Storage (sources/audio)│ └──────────────────────────┘ └──────────────────────────┘ └──────────────────────────┘ │ │ Currently ACTIVE READ works, WRITE fails (500) (all features route here) (env vars likely stale)

Deployment Status

Frontend

Partial
Projectnotebooklm-frontend
StatusNext.js builds succeed, but production domain serves old Vite SPA
API RoutesWorking (chat, sources, study, audio, video, studio)
Issuenotebooklm-frontend.vercel.app still shows "NotebookLM Clone" (legacy)

Backend

Partial
URLnotebooklm-api.vercel.app
Health200 OK — healthy
READ opsWorking (list notebooks, list keys)
WRITE opsAll return 500 (stale env vars)

Live Test Results

Tested against production Vercel deployments on 2026-02-22.

Backend API (notebooklm-api.vercel.app)

TestEndpointResultStatus
Health checkGET /health200 — {"status":"healthy"}Pass
Root infoGET /200 — name, version, docs linkPass
OpenAPI specGET /openapi.json200 — 66 operations across 45 pathsPass
Swagger docsGET /docs200 — Interactive Swagger UIPass
Auth requiredGET /api/v1/notebooks (no auth)401 — proper error messagePass
List notebooksGET /api/v1/notebooks (auth)200 — empty array (correct)Pass
List API keysGET /api/v1/api-keys (auth)200 — empty array (correct)Pass
Create notebookPOST /api/v1/notebooks (auth)500 — Internal server errorFail
Get profileGET /api/v1/profile (auth)500 — Internal server errorFail
Invalid methodDELETE /health405 — Method Not AllowedPass
Invalid routeGET /api/v1/nonexistent404 — Not FoundPass

Frontend (Next.js API Routes)

TestResultStatus
Homepage loads200 — But production domain shows old Vite SPA, not Next.jsWarn
Preview deploysBuild succeeds, but 401 (Vercel SSO protection)Warn
API routes exist14 route files found (chat, sources, study, studio, audio, video, etc.)Pass
Supabase reachablekdupqjswwohqslmczgra.supabase.co respondingPass

API Endpoint Inventory (66 total)

CategoryCountDescriptionStatus
API Keys7CRUD + rotate + usage trackingRead only
Sources7Upload, text, URL (with fetching), YouTube + CRUDFrontend OK
Studio7Reports, slide decks, infographics, data tablesFrontend OK
Audio6TTS audio generation + CRUD + downloadFrontend OK
Video6Video generation via AtlasCloud + CRUDFrontend OK
Notes6User notes + save-from-responseFrontend OK
Notebooks5CRUD for notebooksRead only
Chat5RAG chat with citations + sessionsFrontend OK
Research5Deep research tasksFrontend OK
Study4Flashcards, quiz, study guide, FAQ, mind mapFrontend OK
Global Chat2Cross-notebook queriesRead only
Export2JSON + ZIP exportFrontend OK
Profile2Get + update user profile500 error

Bug Inventory (17 issues)

Ordered by severity. Issues marked Fixed were resolved in today's session.

Critical (3)

#BugImpactStatus
1 Backend WRITE operations fail with 500
All INSERT/UPDATE operations on deployed backend return 500. SELECTs work. Likely stale Supabase env vars on Vercel.
Backend API unusable for creating notebooks, sources, chats Open
2 Production domain serves old Vite SPA
notebooklm-frontend.vercel.app shows "NotebookLM Clone" with <div id="root">. Current Next.js app only on preview deploys.
Users visiting production URL see non-functional legacy app Open
3 JWT signature verification disabled
Backend auth.py has verify_signature: False. Any crafted JWT with valid sub claim is accepted.
Authentication bypass — anyone can impersonate any user Open

High (5)

#BugImpactStatus
4 URL source content ignored by all endpoints
12 files checked type === 'text' for metadata.content, excluding URL sources. Chat only saw "URL: https://...".
URL sources were useless — fetched content never used Fixed
5 CORS allows all origins
allow_origins=["*"] in main.py. Confirmed: evil-site.com gets Access-Control-Allow-Origin.
Cross-origin attacks possible against authenticated users Open
6 Backend 500 errors return null details
Error handler returns "details": null instead of exception info. Makes debugging impossible.
Cannot diagnose backend failures without server logs Open
7 Frontend NEXT_PUBLIC_API_URL points to localhost
.env.local has http://localhost:8000. Frontend API routes work directly but backend API is unreachable from frontend code that uses API_BASE.
Frontend-to-backend API proxy broken in production Open
8 "now()" string stored as timestamps
Backend uses Python string "now()" in insert payloads instead of actual timestamps or SQL now().
Timestamp fields contain literal string "now()" instead of dates Open

Medium (5)

#BugImpactStatus
9 YouTube sources have no transcript extraction
YouTube sources are created with status: 'ready' but only store the URL and video_id. No transcript fetching.
YouTube sources provide zero content to chat/study Open
10 PDF sources not text-extracted
PDFs uploaded to storage but not parsed for text. Chat route downloads and sends as base64 to Gemini (works for chat only, not study/audio/etc).
PDF content only available in chat, not study/studio/audio/video Open
11 No rate limiting on any endpoint
No middleware or decorator for rate limiting. Gemini API calls are unbounded per user.
Cost exposure — single user could run up API bill Open
12 Video download from AtlasCloud may fail silently
Falls back to AtlasCloud URL if Supabase upload fails. CORS issues may prevent playback.
Videos may not play in browser due to CORS Open
13 Source count increment/decrement RPCs may not exist
Backend calls increment_source_count and decrement_source_count RPCs that may not be defined in Supabase.
Notebook source counts may be wrong Open

Low (4)

#BugImpactStatus
14 Hardcoded Supabase URL in sources router
Backend sources.py had a hardcoded Supabase URL for storage.
Would break if Supabase project changes Open
15 No input validation on content size
Text sources truncate to 100K chars but no enforcement on request size.
Large payloads could cause OOM or slow responses Open
16 Audio TTS limited to 3000 chars
Script truncated to 3000 chars for TTS. Long scripts lose most content.
Audio overviews miss most of the generated script Open
17 Cache-Control headers overridden by Vercel
Backend middleware sets cache headers but Vercel replaces them.
Cache policy not applied as intended Open

Fixes Deployed Today (2026-02-22)

1
URL source content now used by all 12 endpoints
Changed type === 'text'type in ('text', 'url') across chat, studio, study, audio, video, export, and global_chat routes in both frontend and backend. Commit 7ee6ba1.
2
URL content fetching implemented
Added server-side HTML fetching with tag stripping for URL sources. Content stored in metadata.content. Both Next.js API route and FastAPI backend. Commit fc7f100.
3
Text source textarea now scrollable
Changed textarea from resize-none to max-h-[200px] overflow-y-auto with [field-sizing:fixed]. Commit fc7f100.
4
Gemini model upgraded to 2.5-flash
All model references updated from gemini-2.0-flash to gemini-2.5-flash. Commit 72fe0fa.

Fix Roadmap

Phase 1: Make It Work (Critical Path)

Goal: Get both frontend and backend fully operational on Vercel.

TaskBug #Effort
Update Vercel backend env vars (SUPABASE_SERVICE_ROLE_KEY, etc.)15 min
Fix production domain to serve Next.js app (redeploy or reconfigure root directory)210 min
Set NEXT_PUBLIC_API_URL on Vercel frontend to https://notebooklm-api.vercel.app75 min
Fix "now()" string timestamps — remove or use datetime.utcnow().isoformat()815 min
Fix 500 error details returning null610 min

Phase 2: Make It Secure

Goal: Close security gaps before any real users.

TaskBug #Effort
Enable JWT signature verification in backend auth330 min
Restrict CORS to specific allowed origins510 min
Add rate limiting middleware (per-user, per-endpoint)111 hr
Add request size limits for source content1515 min

Phase 3: Make It Complete

Goal: Fill content gaps so all source types are fully functional.

TaskBug #Effort
Add YouTube transcript extraction (youtube-transcript-api or similar)92 hr
Add PDF text extraction (PyPDF2 or pdfplumber) for study/audio/video routes102 hr
Implement audio TTS chunking for long scripts161 hr
Fix video download CORS fallback1230 min
Verify/create source count RPCs in Supabase1315 min
Remove hardcoded Supabase URL145 min

Agentic Integration Notes

For Forge or other agents consuming the MasteryBook API:

PatternEndpointUse Case
Create notebook + add sourcesPOST /api/v1/notebooksPOST .../sources/textAgent builds knowledge base from research
RAG query across notebooksPOST /api/v1/chat/globalAgent searches all knowledge for answers
Generate study materialsPOST .../studyAgent creates flashcards/quizzes for training
Generate reportsPOST .../studioAgent produces briefing docs from sources
Export knowledgeGET .../exportAgent extracts structured data from notebooks

Auth: Use X-API-Key: nb_live_... header. Create keys via POST /api/v1/api-keys. Backend currently needs env var fix before write operations work.