Mentrex — Learning Management System
End-to-end LMS powering a coding institute with real-time dashboards, student tracking, and course management.
The Challenge
Building a comprehensive LMS from the ground up that handles student lifecycle management, real-time attendance tracking, course content delivery, and performance analytics — all while maintaining a clean, intuitive interface for both administrators and students.
Architectural Decisions
Role-Based Access Control
Implemented granular RBAC with admin, instructor, and student roles — each with scoped permissions across the entire platform.
Real-Time Dashboards
Server-side rendered dashboards with incremental data fetching for instant insights on student performance and attendance trends.
Modular Course Engine
Designed a flexible course creation system supporting multiple content types, scheduling, and progress tracking per student.
Scalable Data Layer
MongoDB with indexed queries and aggregation pipelines for fast analytics across thousands of student records.
Implementation
export async function getStudentPerformance(studentId: string) {
const pipeline = [
{ $match: { studentId: new ObjectId(studentId) } },
{ $lookup: { from: "courses", localField: "courseId", foreignField: "_id", as: "course" }},
{ $unwind: "$course" },
{ $group: { _id: "$studentId", avgScore: { $avg: "$score" }, totalAssignments: { $sum: 1 }, completedCourses: { $sum: { $cond: ["$completed", 1, 0] } }}}
];
return StudentProgress.aggregate(pipeline);
}