Overview
PyqDeck’s core value is its collection of university question papers. This page explains how papers flow into the system and how questions and solutions are managed.Implementation Map
1. Upload Pipeline (backend/src/utils/uploadthing.js)
Users upload question paper PDFs through UploadThing.
- File:
backend/src/utils/uploadthing.js - Model:
backend/src/models/Upload.js
Upload collection.
2. Paper Management (backend/src/controllers/paperController.js)
Paper metadata (title, year, etc.) is managed via the paperController.
- Service:
backend/src/services/paperService.js - Repository:
backend/src/repositories/paperRepository.js - Model:
backend/src/models/Paper.js
draft → pending → approved. Public users can only see approved papers.
3. Question & Syllabus Mapping
Questions are linked to papers via a join table pattern.- Model:
backend/src/models/Question.js - Mapping:
backend/src/models/QuestionPaperMap.js(links Question to Paper) - Syllabus:
backend/src/models/QuestionSyllabusMap.js(links Question to Syllabus Topic)
4. Solutions
Solutions are stored separately and linked to questions.- Model:
backend/src/models/Solution.js - Types:
teacher,student,ai
Academic Hierarchy
The system follows a strict hierarchy defined in themodels/ directory:
- University (
University.js) - Branch (
Branch.js) - Semester (
Semester.js) - Subject (
Subject.js) - SubjectOffering (
SubjectOffering.js) - The link between a subject and a specific semester. - Paper (
Paper.js)
Future: AI-Powered Parsing
The architecture is designed to support automated PDF parsing. TheSolution.type: 'ai' enum is already reserved for AI-generated answers, and the Question model includes fields for normalized text to aid in AI extraction.
