Loading…
Loading…
Class Ops is a production-focused software project built by Sadam Hussain using Next.js, TypeScript, Node.js, and related technologies.
Classroom management platform with a rigorously modeled relational core and role-based portals for admins, teachers, and students. Outcome: domain-modeling rigor for multi-role systems.
Tech Stack










Status
Production Ready
Type
Enterprise platform
Architected a production-grade full-stack classroom management system with a Next.js 14 App Router frontend and NestJS backend, demonstrating enterprise-level frontend + backend + database integration patterns using a modern TypeScript-first stack with end-to-end type safety.
Designed a normalized Neon PostgreSQL schema with Drizzle ORM modeling complex academic relationships (Departments, Subjects, Faculty, Students, Classes, Enrollments), implementing type-safe queries with auto-generated TypeScript types, schema migrations, and referential integrity constraints across 500+ simulated student records and 50+ course definitions.
Built a scalable NestJS REST API with dependency injection, middleware pipelines for authentication and request validation, role-based guards (Admin/Teacher/Student), and standardized error handling patterns - structured to support multi-tenant expansion without architectural refactoring.
Implemented Next.js server-side rendering (SSR) for SEO-critical pages (course catalog, faculty directory) and incremental static regeneration (ISR) for dashboards, keeping initial page loads fast while maintaining real-time data accuracy through on-demand revalidation strategies.
Optimized PostgreSQL query performance for dashboard aggregations (Total Users, Teachers, Subjects, Departments, Classes) with indexed joins, aggregate functions, and Drizzle's query builder patterns, keeping dashboard responses fast as enrollment data grows.
Developed role-based portals with distinct navigation hierarchies, feature access boundaries, and dashboard views tailored to each role's operational needs, implementing Zustand for client-side state management and React Server Components for zero-JavaScript-by-default pages where interactivity isn't required.
Built subject management workflows supporting CRUD operations for course creation, section capacity tracking, faculty assignment, and active/inactive status management with audit trails - demonstrating complex multi-entity transaction handling and data consistency guarantees through Drizzle's transaction API.
Established a comprehensive automated testing strategy including Jest unit tests for NestJS service layer logic, API contract validation tests for REST endpoints, and Next.js integration tests for server component data fetching and client-side form validation workflows.
Built a production-ready CI/CD pipeline with GitHub Actions automating ESLint, TypeScript strict mode checks, unit tests, and Docker image builds on every commit, with containerized deployment configurations for both the Next.js frontend and NestJS backend supporting one-command deployment to cloud environments.
Implemented a responsive design system using Tailwind CSS with dark mode support, mobile-first layouts that adapt from phone (student mobile access) to desktop (admin dashboards), and accessibility best practices (ARIA labels, keyboard navigation, semantic HTML) ensuring WCAG 2.1 AA compliance.
Class Ops is a classroom management platform for a multi-department institution: subjects, sections, faculty, and enrollments modeled as one consistent relational core. Role-based portals serve admins, teachers, and students from a single system, with enrollment capacity and schedule conflicts enforced at the data layer.
By digitizing course subjects, faculty assignments, and student tracking into one cohesive, mobile-first interface, Class Ops replaces fragmented spreadsheet-based tracking with a centralized system that provides real-time operational visibility. The mobile-first approach is deliberate: educators operate in classrooms, hallways, and faculty offices - not at desks - and their management tools need to work wherever they are.
Traditional academic management relies on fragmented systems - faculty assignments tracked in spreadsheets, enrollment counts tallied manually, department reports compiled by hand from disconnected data sources. This fragmentation creates operational delays (information is always stale by the time it's compiled), data inconsistency (different spreadsheets show different numbers), and a lack of real-time insight for administrators making decisions about resource allocation.
The core problem: Academic institutions manage deeply interconnected data - a single faculty reassignment affects department headcounts, subject coverage, section availability, and student enrollment options. When this data lives in disconnected spreadsheets, changes don't propagate, and administrators make decisions based on incomplete or outdated information.
Stakeholder perspective:
Constraints that shaped the architecture:
The PostgreSQL schema is the backbone of the system's integrity. Academic data has deep relational dependencies:
These relationships are enforced at the database level with foreign keys, check constraints, and triggers - not just at the application level. This means the system cannot enter an inconsistent state even if the API has a bug, because PostgreSQL will reject the invalid operation.
The Next.js application is designed for the operational rhythm of educators:
The application manages complex interdependencies between academic entities. Zustand provides a lightweight client store where:
The most architecturally significant challenge in Class Ops was designing a data model that accurately represents the complex, hierarchical relationships in academic institutions while supporting the query patterns the application needs.
The Problem: Academic data isn't a simple parent-child hierarchy. It's a web of many-to-many relationships with constraints. A faculty member belongs to a department but can teach subjects in other departments. A student enrolls in sections of subjects across multiple departments. Sections have capacity limits that must be enforced atomically (two students can't take the last spot simultaneously). Schedule conflicts must be detected across a faculty member's full assignment set, not just within a single subject.
The Schema Design Approach:
Entity Identification: Mapped the core entities (Department, Subject, Section, Faculty, Student, Enrollment, Class) and their relationships. Each entity has a clear primary key and lifecycle (created, active, archived/soft-deleted).
Relationship Mapping:
Constraint Enforcement:
Index Strategy: Composite indexes are designed for the application's actual query patterns:
(department_id, status) for listing active subjects within a department.(section_id, enrollment_status) for counting active enrollments in a section.(faculty_id, assignment_status) for listing a teacher's current assignments.(student_id, enrollment_status) for listing a student's active enrollments.Soft Delete for Historical Integrity: Faculty assignments and enrollments use soft-delete (a deleted_at timestamp) rather than hard delete. This preserves historical records for reporting (which faculty taught which subject in which term) while keeping active queries clean through a WHERE deleted_at IS NULL convention.
Why this matters: The data model is the foundation that everything else builds on. If the schema doesn't enforce academic entity relationships correctly, the application must compensate with complex validation logic that's fragile and error-prone. By investing in a rigorous relational design upfront, the API layer becomes simpler - it can trust that the database won't allow inconsistent state.
Challenge: Academic entities have deep relational dependencies - deleting a department affects all its subjects, sections, enrollments, and faculty assignments. Cascading these changes safely is complex. Approach: Used PostgreSQL foreign key constraints with carefully configured cascade rules. Department deletion cascades through subjects and sections. Faculty assignments and enrollments use soft-delete to preserve historical records while removing them from active views. Why: Handling cascading deletes in application code is error-prone - if the API server crashes mid-cascade, the data is left in an inconsistent state. Database-level cascades are atomic and guaranteed to complete fully or not at all.
Challenge: Two students enrolling in a section with one remaining spot simultaneously could both succeed, exceeding capacity. Approach: Implemented enrollment capacity checks within a PostgreSQL transaction with a row-level lock on the section record. The transaction reads the current enrollment count, checks against capacity, and inserts the enrollment atomically. Concurrent requests are serialized by the lock. Why: Application-level capacity checks (check count, then insert) have a race condition window between the check and the insert. Database-level locking eliminates this race condition entirely.
Challenge: Faculty schedule conflict detection requires comparing time ranges across all of a teacher's subject assignments, which is computationally complex and doesn't map cleanly to simple SQL constraints. Approach: Implemented schedule conflict detection at the application level using time-range overlap algorithms before committing faculty assignments. The API validates that the new assignment's time slots don't overlap with any existing assignments for the same faculty member. Why: Time-range overlap detection involves comparing start/end times across multiple records, which is more naturally expressed as application logic than database constraints. The trade-off is that the constraint isn't enforced if someone bypasses the API, but since all writes go through the API, this is acceptable.
Challenge: The institutional dashboard needs aggregate metrics (total students, enrollment counts per department, faculty load distribution) that would be expensive to compute on every page load with COUNT queries across large tables. Approach: Used PostgreSQL indexed COUNT operations with pre-computed covering indexes for the most frequent aggregate queries. For computationally expensive aggregations (enrollment trends over time), implemented background calculation with cached results that refresh on a schedule. Why: Real-time aggregate queries are acceptable for small-to-medium institutions where the data volume keeps COUNT operations fast. The indexed approach avoids the complexity of materialized views while maintaining acceptable query times.
Class Ops demonstrated the technical complexity of building multi-role, multi-entity platforms for the education sector. The key insight is that in domain-heavy applications like academic management, the data model is the architecture - get the schema right and the application layer becomes straightforward; get it wrong and you're fighting data inconsistency bugs forever.
Patterns I'd reuse:
What I'd reconsider:
Trade-offs acknowledged: