Inspiration

Most online learning platforms are crowded. Dashboards are packed with banners, badges, notifications and upsells, and the actual courses get lost. For our MERN Stack final project at Hunarmand Punjab, we wanted to build the opposite: a learning management system that stays calm, readable and easy to use, while still covering everything a real platform needs: courses, enrollment, progress, and role-based access.

We named it LearnHub.

What it does

LearnHub is a full-stack web application with three roles:

  • Students browse courses, enroll, open lessons and track their progress on a personal dashboard.
  • Instructors create, edit and delete their own courses and upload lesson files.
  • Admins manage users and courses, view platform analytics, and review an audit log of admin actions.

The public site has a landing page (hero, live platform stats, featured courses, how it works, FAQ), a course listing, course detail pages, and login and register pages.

How we built it

  • Frontend: React (Vite), React Router, Axios, and React Bootstrap, styled with a custom warm coffee palette, Poppins for headings and Manrope for body text.
  • Backend: Node.js, Express and Mongoose, with MongoDB Atlas as the database.
  • Authentication: JWT, bcrypt password hashing, and secrets kept in .env.
  • Authorization: auth middleware on every protected route, role middleware for admin and instructor routes, and role-guarded pages on the frontend.
  • File uploads: Multer, restricted by file type and size, with lesson files available only to enrolled students, the owning instructor and admins.
  • Security hardening: express-validator for server-side validation, express-mongo-sanitize against NoSQL injection, helmet for security headers, express-rate-limit (strict on login), CORS locked to our frontend URL, and no stack traces in production responses.
  • Deployment: the backend on Render, the frontend on Vercel.

We kept to the concepts taught in the course on purpose, so we can explain every part of the code.

Design approach

We followed a strict set of design rules: spacing on a 4px grid, 16px minimum body text, a 1.5 line height, 4.5:1 contrast, a visible focus ring on every interactive element, 44px tap targets, soft shadows and hairline borders. Each section gets at most one filled button. Error messages sit beside the field and say how to fix the problem, and empty states say what to do next. We also deliberately avoided common AI-design clichés like gradient hero text, glassmorphism cards and three-icon feature rows.

Challenges we ran into

  • Staying minimal. Our reference designs were packed with inboxes, calendars, badges and carts. Deciding what to cut per role, and sticking to it, was harder than adding features.
  • Translating security practices to MongoDB. Many checklists are written for SQL. We mapped ideas like row-level security and IDOR protection to ownership checks in controllers, and parameterized queries to input validation and sanitization.
  • Protecting lesson files. Uploads needed type checks, size limits and access control so only the right people can open them.
  • Keeping the colors accessible. Several of the lighter browns in our palette fail contrast on light backgrounds, so we had to choose pairings carefully.
  • Deployment details. Locking CORS to the production frontend, handling environment variables across Render and Vercel, and sorting out commit authorship for Vercel deployments.

What we learned

  • How to design a role-based authorization model and enforce it in both the API and the UI.
  • Why "never trust the frontend" matters: every rule is validated on the server.
  • How much a consistent spacing scale and a small, disciplined palette improve a UI.
  • How to plan a project in phases (backend foundation, auth, features, frontend, polish) so each step can be tested before the next.

What's next

  • Lesson completion tracking with per-lesson progress
  • Course reviews from enrolled students
  • Optional dark mode, lifting surfaces rather than inverting them
  • Automated API tests

Built With

Share this project:

Updates

Submission history