How subhamsahu-25/course-companion works
Course Companion supports role-based course administration and a student Q&A workflow: course material is uploaded and ingested, questions are checked against course-scoped and TA-verified knowledge, new drafts enter TA review, and approved answers return to students. The backend owns authentication, course access, persistence, uploads, and the authenticated RAG boundary; the separate RAG service owns retrieval, generation, and its review queue. The README documents service-level integrations and capabilities; several subsystem details below rely on that documentation because their implementation was not sampled.
Main entry points: App.jsx Role-based UI · app.js HTTP API · review.js Question and review routes · models Course and user data
Components 27
Frontend
- Role-based UI
frontend/src/App.jsx - Ask and history
frontend/src/pages/student/Ask.jsx - Review queue UI
frontend/src/pages/ta/ReviewQueue.jsx - Course management UI
frontend/src/pages/admin/Modules.jsx - API client
frontend/src/api/client.js
Backend
- HTTP API
backend/src/app.js - Authentication
backend/src/controllers/auth.controller.js - Course and access
backend/src/controllers/course.controller.js - Document uploads
backend/src/controllers/document.controller.js - Q&A orchestration
backend/src/controllers/qa.controller.js - Course and user data
backend/src/models - File storage
backend/src/utils/cloudinary.js - Email notifications
backend/src/utils/mail.js - RAG service client
backend/src/services/rag.service.js
RAG service
- PDF ingestion
rag/ingest-logic.js - Vector search store
rag/qdrant.js - Question and review routes
rag/routes/review.js - Scoped retrieval
rag/services/retrieval.js - Answer drafting
rag/services/answers.js - Review queue
rag/models/ReviewQueueItem.js
Other components
- Student
- TA
- Instructor
- Admin
- Gemini API
- MongoDB
- Qdrant
Connections 36
- Student → Role-based UI: uses
- TA → Role-based UI: uses
- Instructor → Role-based UI: uses
- Admin → Role-based UI: uses
- Role-based UI → Ask and history: renders
frontend/src/App.jsx - Role-based UI → Review queue UI: renders
frontend/src/App.jsx - Role-based UI → Course management UI: renders
frontend/src/App.jsx - Ask and history → API client: requests
frontend/src/pages/student/Ask.jsx - Review queue UI → API client: requests
frontend/src/pages/ta/ReviewQueue.jsx - Course management UI → API client: requests
frontend/src/pages/admin/Modules.jsx - API client → HTTP API: calls
- HTTP API → Authentication: routes
backend/src/app.js - HTTP API → Course and access: routes
backend/src/app.js - HTTP API → Document uploads: routes
backend/src/app.js - HTTP API → Q&A orchestration: routes
backend/src/app.js - Authentication → Course and user data: reads and writes
backend/src/controllers/auth.controller.js - Course and access → Course and user data: reads and writes
backend/src/controllers/course.controller.js - Document uploads → Course and user data: reads and writes
backend/src/controllers/document.controller.js - Document uploads → File storage: stores files
backend/src/controllers/document.controller.js - Document uploads → RAG service client: requests ingestion
backend/src/controllers/document.controller.js - Q&A orchestration → RAG service client: submits and reviews
backend/src/controllers/qa.controller.js - Q&A orchestration → Course and user data: checks access
backend/src/controllers/qa.controller.js - Q&A orchestration → Email notifications: notifies
backend/src/controllers/qa.controller.js - RAG service client → Question and review routes: calls
- Question and review routes → Scoped retrieval: checks verified matches
rag/routes/review.js - Question and review routes → Answer drafting: generates drafts
rag/routes/review.js - Question and review routes → Review queue: persists queue
rag/routes/review.js - Answer drafting → Scoped retrieval: uses context
rag/services/answers.js - Scoped retrieval → Vector search store: searches vectors
rag/services/retrieval.js - PDF ingestion → Vector search store: writes chunks
rag/ingest-logic.js - PDF ingestion → Gemini API: embeds and captions
- Answer drafting → Gemini API: generates text
- Vector search store → Qdrant: stores vectors
- Review queue → MongoDB: persists queue
- Course and user data → MongoDB: persists records
- PDF ingestion → Question and review routes: adds approved goldens
rag/routes/review.js