DIT-PYQ-hub Turns Old Exam Papers Into a Secure Campus Product

A student-built repository that does more than host files. It watermarks documents on delivery, supports offline access, and uses a modern frontend-backend split to make a campus resource feel like software.

8 min read • View on GitHub • More from Aditgm

A wide editorial scene of a campus file counter where a student receives a paper through a narrow slot after it passes through a mechanical watermarking device. Stacks of PDFs and a DOCX icon feed into the machine, showing that access is transformed at delivery time rather than handled as a simple download.
The striking idea in DIT-PYQ-hub is not storage. It is that the file changes shape on the way out, with user-specific watermarking built into the download path.
Key Takeaways

Most repositories that collect previous-year questions stop at organization. DIT-PYQ-hub goes further. It tries to solve the ugly part of campus file sharing: how to centralize documents, keep them usable on unreliable networks, and still add enough control that a download is not just a leak waiting to happen.

The download button is the product

The most interesting thing in this repo happens after a student clicks download. The server does not simply hand back a static file. It checks access, fetches the source from Cloudinary, rewrites the document in memory, and streams a protected version back to the browser.

That changes the meaning of the interface. Search, filters, and upload matter, but the real product decision is that every download becomes a controlled event. The paper is not only retrieved. It is personalized.

The important path is not upload. It is the transformation that happens between access control and the final stream back to the browser.

A close technical illustration of two file formats side by side. On the left, a PDF page receives footer text page by page. On the right, a DOCX file is shown as a layered mechanical book with XML sheets beneath the cover, and a footer relationship being inserted before the file is zipped back up.
The repo’s most unusual technical choice is that it treats PDFs and DOCX files differently, instead of pretending they are the same problem.

Why a campus PYQ hub needs more than storage

A generic file host can store papers. An official library can authenticate users. Neither one is automatically good at the actual student problem, which is getting to the right paper fast, on bad Wi-Fi, without losing trust in what was downloaded.

SystemWhat it does wellWhat it misses
Generic document hostLarge volume and simple sharingWeak structure, weak trust, weak control
Official university libraryAccess control and official sourcesUsually slower, less searchable, less student-friendly
Plain PDF repositoryEasy to publishNo delivery logic, no personalization, no offline polish
DIT-PYQ-hubSearch-first access with protected deliveryMore engineering than a bare archive, which is the point

That comparison is the real frame. DIT-PYQ-hub is not trying to win on raw file count. It is trying to make campus documents feel organized, resilient, and accountable.

How the watermarking pipeline works

The backend route does the heavy lifting. A request arrives, passes through rate limiting, pulls the source file from Cloudinary, then applies a format-specific transformation before streaming the result back. The server never treats the file as a dumb blob.

For PDFs, the process is straightforward in concept and expensive in intent. Each page gets a footer watermark, so the user identity travels with the document. For DOCX, the repository does something rarer: it unzips the package, edits the internal XML and relationship structure, then reassembles the file. That is a real product choice, not a cosmetic stamp.

// Simplified flow from the download route
const file = await fetchFromCloudinary(fileId);
const isPdf = file.mimeType === 'application/pdf';

if (isPdf) {
  const protectedFile = await addPdfFooterWatermark(file.buffer, userMeta);
  return streamToClient(protectedFile, 'pdf');
}

if (isDocx) {
  const protectedFile = await addDocxFooterWatermark(file.buffer, userMeta);
  return streamToClient(protectedFile, 'docx');
}

throw new Error('Unsupported format');

That split matters because it keeps the implementation honest. A PDF and a DOCX are not the same artifact, so they should not share the same fake abstraction.

The app behaves like a real product, not a folder of PDFs

The repo’s front end is not just a gallery with a search box. It layers authentication, protected routes, role separation, caching around profile fetches, and PWA support into the same user journey. That is what makes it feel like software instead of storage.

The role model is especially important. Students and admins do not need the same surfaces, and the code reflects that. A small project often gets messy here. DIT-PYQ-hub seems to have made the separation explicit early.

The PWA layer pushes the same idea further. If the campus connection is flaky, the app still has to behave gracefully. Offline support is not a nice-to-have in this context. It is part of the product promise.

The architecture choice that makes the stack practical

The deployment story is pragmatic. The frontend can live close to users, while the heavy file work runs in a separate backend environment. That avoids asking serverless infrastructure to do long-lived document processing it was never meant to own.

LayerWhy it existsWhy it is practical
Vercel frontendFast UI delivery and routingKeeps the app snappy for students
Separate backendPDF and DOCX processingAvoids file-size and execution limits
Cloudinary storageFile retrieval and managementReduces the burden on the app server
Supabase auth and dataIdentity and access controlKeeps the product coherent without custom auth plumbing

This is the kind of stack choice that signals maturity. The team is not forcing every responsibility into one deployment target. It is matching the job to the platform.

What it says about modern campus software

DIT-PYQ-hub is a small repo with a bigger lesson. A student-built internal tool can now borrow the same primitives that power polished SaaS products: authenticated access, analytics, offline support, controlled document delivery, and a UI tuned for real usage rather than demo value.

That matters because campus tools are often treated as disposable. This project takes the opposite position. It says a university utility deserves product thinking, and that exam papers deserve more than a public folder full of downloads.