How derek-aman/docchat works
DocChat is a document-question answering application: users upload a PDF, the backend queues it for indexing, and users ask questions through a chat UI that retrieves relevant document context for an AI-generated answer. The sampled runtime implements PDF ingestion; DOCX/TXT parsing is described in the README but not evidenced in the sampled code. The README also names Qdrant and Redis, while source excerpts show their use. Some queue handoff and deployment wiring is not fully evidenced, so uncertain links are omitted or dashed.
Main entry points: index.js Upload and chat API · Home.jsx Home page · worker.js Ingestion worker · ChatPage.jsx Chat interface
Components 22
User interface
- Route app
frontend/src/App.jsx - Home page
frontend/src/Pages/Home.jsx - Product intro
frontend/src/components/Hero.jsx - PDF upload UI
frontend/src/components/FileUploadCard.jsx - Chat interface
frontend/src/Pages/ChatPage.jsx - Navigation header
frontend/src/components/Header.jsx - Feature overview
frontend/src/components/About.jsx - Page footer
frontend/src/components/Footer.jsx
Backend API
- Upload and chat API
backend/index.js - Redis connection
backend/redis.js
Document indexing
- Upload job queue
backend/index.js - Ingestion worker
backend/worker.js - PDF extraction
backend/worker.js - Text chunking
backend/worker.js - Embedding generation
backend/worker.js
Answer retrieval
- Vector collection
backend/worker.js - Context retrieval
backend/index.js - Answer generation
backend/index.js
Other components
- Document user
- Redis service
- Qdrant
- Google AI
Connections 28
- Document user → Route app: opens
- Route app → Home page: routes to
frontend/src/App.jsx - Route app → Chat interface: routes to
frontend/src/App.jsx - Home page → Product intro: renders
frontend/src/Pages/Home.jsx - Home page → PDF upload UI: renders
frontend/src/Pages/Home.jsx - Home page → Navigation header: renders
frontend/src/Pages/Home.jsx - Home page → Feature overview: renders
frontend/src/Pages/Home.jsx - Home page → Page footer: renders
frontend/src/Pages/Home.jsx - Chat interface → Navigation header: renders
frontend/src/Pages/ChatPage.jsx - PDF upload UI → Upload and chat API: uploads PDF
frontend/src/components/FileUploadCard.jsx - Chat interface → Upload and chat API: sends question
frontend/src/Pages/ChatPage.jsx - Upload and chat API → Chat interface: returns answer
- Upload and chat API → Redis connection: uses connection
backend/index.js - Ingestion worker → Redis connection: uses connection
backend/worker.js - Upload and chat API → Upload job queue: enqueues upload
backend/index.js - Upload job queue → Ingestion worker: dispatches job
- Redis connection → Redis service: connects to
- Ingestion worker → PDF extraction: loads file
backend/worker.js - Ingestion worker → Text chunking: splits documents
backend/worker.js - Ingestion worker → Embedding generation: embeds chunks
backend/worker.js - Ingestion worker → Vector collection: stores documents
backend/worker.js - Embedding generation → Google AI: calls
- Vector collection → Qdrant: writes collection
- Upload and chat API → Context retrieval: searches context
backend/index.js - Context retrieval → Embedding generation: embeds query
- Context retrieval → Qdrant: reads vectors
- Upload and chat API → Answer generation: generates answer
backend/index.js - Answer generation → Google AI: calls model