OPEN FOR NEW OPPORTUNITIESAVAILABLE FOR FREELANCEFRONTEND DEVELOPERREACT & NEXT.JS SPECIALISTOPEN FOR NEW OPPORTUNITIESAVAILABLE FOR FREELANCEFRONTEND DEVELOPERREACT & NEXT.JS SPECIALIST• 
OPEN FOR NEW OPPORTUNITIESAVAILABLE FOR FREELANCEFRONTEND DEVELOPERREACT & NEXT.JS SPECIALISTOPEN FOR NEW OPPORTUNITIESAVAILABLE FOR FREELANCEFRONTEND DEVELOPERREACT & NEXT.JS SPECIALIST• 
Case Study • 01 / CM COLLEGE
Back to All Work

CM College

A full-featured web platform and administrative portal for CM College, powering digital admissions, academic resources, department hubs, and dynamic institutional content management.

Next.jsTypeScriptTailwind CSSMongoDBClerkFramer MotionImageKit
Key Metric Achieved
100%

Digitized institutional workflows & dynamic portal administration.

RoleFull Stack Developer
Timeline2024
Client / CompanyCM College
DeliverablesWeb Application, Admin Dashboard, Resource Hub
CM College
01 • The Challenge

Architecting a secure, dynamic web portal for institutional workflows.

Developing a unified portal for an educational institution requires serving high-traffic public access to academic resources, news, and calendars while maintaining strict, role-based access control for administrative content management.

02 • The Solution

Next.js App Router, Clerk RBAC & MongoDB.

Leveraged Next.js App Router with MongoDB & Mongoose for scalable dynamic content delivery, coupled with Clerk authentication and custom JWT metadata validation to secure administrative routes and server actions.

03 • Implementation & Architecture

Interactive Implementation

middleware.ts
import { clerkMiddleware, createRouteMatcher } from "@clerk/nextjs/server";
import { NextResponse } from "next/server";

const isAdminRoute = createRouteMatcher(["/admin(.*)"]);

export default clerkMiddleware(async (auth, req) => {
  if (isAdminRoute(req)) {
    const { userId, sessionClaims, redirectToSignIn } = await auth();
    if (!userId) return redirectToSignIn();

    let role = (sessionClaims as any)?.metadata?.role;
    if (role !== "admin") {
      return NextResponse.redirect(new URL("/", req.url));
    }
  }
});
04 • Key Features

Core Highlights

Role-Based Admin Portal

Protected administration area for dynamic management of announcements, admissions, news, and faculty records.

Question Bank & Resource Hub

Searchable digital archive for past question papers and study resources stored via optimized ImageKit CDN.

Admissions & Department Portals

Dynamic admission status management and comprehensive department pages with enquiry workflows.

Fluid Micro-Interactions

Smooth page transitions and responsive user experience powered by Lenis smooth scroll and Framer Motion.