Document QA — Frontend
Next.js (App Router) frontend for document-qa-api, a hybrid-retrieval RAG backend. Ask questions about uploaded documents and watch the answer stream in token-by-token over Server-Sent Events.
Features
- JWT auth against the backend’s demo login (
demo@example.com / demo123)
- Document upload (PDF/TXT/DOCX) or drag/drop the bundled Led Zeppelin sample PDF, streamed via
POST /api/v1/documents/stream (received → split → embed → store → done)
- Live model selection across the backend’s configured LLM providers (Gemini, DeepSeek, OpenAI, Modal)
- Backend/LLM health badges with cold-start (“warming up”) polling
- Streamed answers via
POST /api/v1/ask/stream, with retrieval scores (vector/BM25/fused/rerank) shown per source
- Pipeline view — a collapsible panel where the ingest lane (upload → split → embed → store) and the query lane (expand → vector search → BM25 → fuse → rerank → answer) light up live as the backend actually processes each step. Hovering a step shows what it produced that run (expanded query variants, retrieved chunks and scores, latency, token counts) and which backend resource handled it (MongoDB, Gemini, Voyage AI, or in-process).
Getting Started
cp .env.local.example .env.local # set NEXT_PUBLIC_API_URL to your backend
npm install
npm run dev
Open http://localhost:3000.
Environment Variables
| Variable |
Description |
NEXT_PUBLIC_API_URL |
Base URL of the document-qa-api backend (e.g. http://localhost:8000) |