Back to Projects
Case Study

Mansa — منصة التعليم المصري الرقمية

A comprehensive digital education platform designed specifically for Egyptian secondary school students and teachers, providing a complete LMS with video lectures, timed exams, assignments, subscription management, and performance tracking.

Next.js React Supabase PostgreSQL Tailwind CSS Recharts

Project Overview

Mansa is a comprehensive digital education platform designed specifically for Egyptian secondary school students and their teachers. The platform provides a complete learning management system (LMS) that enables teachers to publish video lectures, create timed exams and assignments, manage student subscriptions, and track academic performance — all through a server-driven architecture optimized for the Egyptian educational system.

This single-teacher, single-subject (Physics) platform enables teachers to publish video lectures with attachments, allows students to watch lectures and ask questions via threaded comments, provides auto-grading of timed exams with instant reports, manages assignments with multiple attempts, tracks subscriptions and payments, and delivers performance reports with charts and trends.

Problem & Solution

Problems Addressed

Solutions Provided

Key Features

Core Features

Video Lectures

YouTube and Google Drive video embeds with thumbnail, description, and duration tracking. Lectures can be published or kept as drafts.

Lecture Attachments

Upload and serve PDF/image files up to 50MB per lecture via Supabase storage with signed URLs.

Threaded Comments

Nested discussion threads under lectures with reply support, delete functionality, and real-time notifications.

Timed Exams

Time-limited exams with MCQ, True/False, and Essay question types. Auto-grading for objective questions with instant reports.

Multi-Attempt Assignments

Untimed assignments with multiple attempts per student, unique constraint per attempt, and manual essay grading.

Subscription Management

Per-grade pricing plans, student payment tracking with monthly records, and content access gating based on subscription status.

Performance Reports

Recharts-powered dashboards with score trends, subject breakdowns, recent submissions, and period toggles for both students and teachers.

Role-Based Access

Separate teacher and student portals with tailored navigation, grade-level content filtering, and role-based permissions.

Push Notifications

Real-time alerts for new content, grading completion, comments, and replies with typed notification metadata.

Global Search

Full-text search across lectures, exams, assignments, and students with server-side filtering.

Student-Specific Features

Bookmarks

Client-side localStorage-based lecture saving for quick access to favorite content.

Grade-Level Filtering

Students automatically see only content matching their academic year (1st/2nd/3rd secondary).

Instant Reports

Immediate exam results with score breakdowns, correct answers, and performance summaries.

Teacher-Specific Features

Student Management

Add, edit, disable, delete students, and promote students to teacher role with full CRUD operations.

Content Builder

Intuitive interfaces for creating lectures, exams (with question bank), and assignments with drag-and-drop simplicity.

Analytics Dashboard

Overview stats, per-student performance analytics, and grade-level insights with exportable data.

Tech Stack

Frontend

Next.js 16 React 19 Tailwind CSS v4 Lucide React Recharts React Hot Toast

Backend & Infrastructure

Next.js API Routes Supabase PostgreSQL Supabase SSR Supabase Storage ESLint 9

Design & Typography

Tailwind CSS v4 Zain Font (Arabic) Lucide Icons

Architecture Highlights

System Architecture

📁 mansa-platform
📁 Client Layer
📂 Web Application (Next.js 16)
📂 Student Portal
📄 Lectures view, bookmark, comment
📄 Exams take timed tests, view reports
📄 Assignments submit, track attempts
📄 Reports performance charts
📂 Teacher Portal
📄 Dashboard stats overview
📄 Lectures CRUD, attachments
📄 Exams & Assignments builder, grader
📄 Students manage, promote
📄 Subscriptions pricing, payments
📄 Grades & Subjects academic config
📄 Reports per-student analytics
📄 Auth Pages login, register, choose grade
📁 Middleware Layer
proxy.js
📄 License check external Supabase, 5-min cache
📄 Session refresh via updateSession
📄 Role-based redirects teacher→/teacher, student→/student
📄 Auth guard unauthenticated→/login
📁 API Layer 42 endpoints
📂 /api/auth/*
📄 Login, signup, logout, me
📂 /api/teacher/*
📄 Lectures, exams, assignments, students, subscriptions, grades, subjects
📂 /api/student/*
📄 Lectures, exams, assignments (read-only)
📄 /api/search Global full-text search
📄 /api/grades/* Academic year management
📄 /api/subjects/* Subject management
📄 /api/notifications/* Read, mark-read, mark-all-read
📁 Data Layer
🗄 Supabase (PostgreSQL)
📄 Profiles users, roles, grades
📄 Lectures & Attachments
📄 Threaded Comments
📄 Exams & Submissions auto-graded MCQ/TF, manual essay
📄 Assignments & Submissions multi-attempt
📄 Subscription Plans & Payments
📄 Grades & Subjects
📄 Notifications per-user, typed
🗄 Supabase Storage (S3)
📄 lecture-thumbnails public, signed URLs
📄 lecture-attachments private, signed via API

Key Architectural Decisions

Challenges & Solutions

Screenshots

Mansa Dashboard Screenshot
Mansa Exams Screenshot
Mansa Lectures Screenshot
Mansa Reports Screenshot

Database Schema Overview

🗄 mansa_db
📁 Core Tables
📄 profiles Users (teacher/student) with grade_id
📄 grades Academic years (1st/2nd/3rd secondary)
📄 subjects Physics, Chemistry, Biology
📁 Content Tables
📄 lectures Video lectures with status (published/draft)
📄 lecture_attachments File attachments
📄 lecture_comments Threaded comments (parent_id for replies)
📁 Assessment Tables
📄 exams Timed exams with duration, open/end times
📄 exam_questions MCQ / True/False / Essay with scores
📄 exam_submissions Student attempts (unique per exam)
📄 exam_answers Individual question answers with grading
📄 assignments Untimed assignments with end dates
📄 assignment_questions Assignment questions
📄 assignment_submissions Multi-attempt student submissions
📄 assignment_answers Individual answer records
📁 Business Tables
📄 subscription_plans Per-grade pricing (teacher configurable)
📄 student_subscriptions Per-student subscription status + dates
📄 payment_records Monthly payment tracking (unique per month)
📁 System Tables
📄 notifications Typed notifications with JSONB metadata

Future Improvements

Short-term (Q3-Q4 2026)

Medium-term (Q1-Q2 2027)

Long-term (2027+)

Live Demo