ProjectsFolder Turns a Complaint Portal Into a Security-First Bureaucracy Machine

Under the hood of a student admin system that treats refresh tokens, role gates, and audit logs like enterprise infrastructure, while keeping the frontend brutally simple.

8 min read • View on GitHub • More from ShubhankarRaj9

A wide editorial scene of a locked filing cabinet with complaint folders, three desks labeled by role, and routing lines linking student, faculty, and admin. It explains the project as a controlled institutional workflow, not just a form app.
The project’s real shape is bureaucratic. Security sits inside the workflow, not on top of it.
Key Takeaways

The most revealing part of ProjectsFolder is not the complaints feature. It is the way the app treats session security like a first-class system, not an afterthought. A student admin portal rarely earns that kind of discipline.

The Part Most Projects Get Wrong

The backend stores refresh tokens hashed, then rotates them on use. That is a strong pattern for a small repo, because it means a stolen token does not stay useful forever. The app also leans on httpOnly cookies and strict same-site behavior, which keeps the browser from exposing the session token in the places attackers usually hope to find it.

The refresh loop is the project’s best proof of maturity. It turns authentication into a controlled lifecycle, not a one-time handshake.

A close editorial mechanism showing a raw token entering a validator, a database record storing a hashed token, and an old token being struck through as a new one exits in a cookie envelope. It explains how rotation and revocation work together.
Token rotation is the sharpest technical idea in the repo. The old token stops being a permanent passport.

A Complaint Portal That Behaves Like Infrastructure

Once you step back, the app looks less like a help desk and more like a digital bureaucracy. Students file complaints, faculty can intervene where needed, and admins close the loop. That three-role shape matters because it turns the system into a managed process with accountable handoffs.

That structure shows up everywhere in the codebase. The backend uses Node.js, Express, Mongoose, bcryptjs, Multer, and middleware-heavy route protection. The frontend stays framework-free, which keeps the workflow simple enough to deploy without a build chain or a packaging ritual.

LayerProjectsFolderTypical student CRUD app
Session securityHashed refresh tokens, rotation, httpOnly cookiesPlain-text tokens or local storage
AuthorizationGranular role middleware for admin, faculty, and hybridsAd hoc checks scattered across routes
Error handlingCentralized middleware with normalized responsesMixed try-catch blocks and inconsistent payloads
AuditabilityAdministrative actions are loggedLogs are optional or absent
FrontendVanilla JS with direct DOM controlFramework-heavy UI even when the app is simple

The Complaint Model Is the Real Product

The central schema is not just a form record. The Complaint model ties a complaint to a student, tracks who resolved it, indexes the fields people will query most, and leaves room for attachments and status changes. In practice, that makes the schema the system’s memory.

That matters because institutional software lives or dies on state. A complaint is not only text. It has ownership, history, resolution, and traceability. The repo’s data model understands that, which is why the rest of the app feels coherent.

RBAC as a Gatekeeper, Not a Suggestion

Role-based access control is not treated as a single yes-or-no check. The project uses granular middleware such as adminOnly, facultyOnly, and mixed-role variants to protect routes at the boundary. That is the right move, because a valid JWT does not automatically mean a user should be allowed to resolve complaints or change roles.

This is the difference between authentication and authorization, and the repo keeps them separate. Login proves identity. Middleware decides what that identity can do. That layered approach is what makes the backend feel durable instead of improvised.

Audit Logs Make the App Feel Institutional

The repo also logs sensitive administrative actions like role changes and user deletion. That is a small detail with a big implication. Once an app can affect people, accountability becomes part of the product, not a separate compliance layer.

A complaint portal without audit trails is just a message box. A complaint portal with audit trails becomes part of an institution’s record-keeping. That is the line this project crosses.

Why Vanilla JS Is the Right Kind of Old School Here

The frontend choice is easy to misread. No build step does not mean no discipline. It means the UI is direct, portable, and easy to inspect. In a project like this, that is a feature, because the complexity belongs in the workflow and security model, not in a heavyweight client stack.

ChoiceWhat it buysWhat it avoids
Vanilla JS frontendLow deployment friction, clear control flow, simple portabilityBuild-tool overhead and framework churn
Express and Mongoose backendStructured routing, schema discipline, queryable modelsLoose server code that grows messy fast
Middleware-based authReadable boundaries and reusable policyPermission checks duplicated across handlers
Centralized loggingTraceability for administrative actionsInvisible state changes

What This Project Would Need Next

The repo already shows strong instincts, but the next step would be consistency tooling. Tests would harden the security claims. Better asset management would make the frontend easier to extend. More automation around validation and deployment would finish the move from a solid student system to a dependable institutional one.

That is the useful takeaway here. ProjectsFolder is not impressive because it has a complaint form. It is impressive because it understands that real internal systems are built from trust boundaries, traceable actions, and state that can be revoked.