Academics & Classrooms

Last updated August 2, 2026

Classgrid's Academics module manages the core educational structure: classrooms, membership, timetables, and the relationship between teachers, students, and subjects. The classroom system uses MongoDB for identity and membership and Supabase for classroom content (materials, announcements, quizzes).


Classroom System

Core Model: Classroom (MongoDB)

Each classroom represents a single class-subject pairing (e.g., "FY BSc Div A — Physics"):

FieldTypeDescription
nameStringDisplay name
subjectStringSubject taught
subjectSlugStringURL-friendly subject identifier
descriptionStringClass description
yearStringAcademic year (e.g., "FY", "SY")
branchStringDepartment/branch
semesterStringCurrent semester
divisionStringDivision (e.g., "A", "B")
teacherObjectId → UserClassroom owner (faculty)
organization_idObjectId → OrganizationParent institution
classCodeString10-digit unique code for joining

Classroom Membership: ClassroomMembership (MongoDB)

Students join classrooms using the 10-digit classCode. Each membership record tracks:

FieldTypeDescription
classroomObjectId → ClassroomThe classroom
studentObjectId → UserThe student
statusStringpending

Auto-linking: When a student joins their first classroom, they are automatically linked to the classroom's organization via organization_id.

Classroom Content (Supabase)

All classroom content is stored in the Supabase classroom_content table with a content_type discriminator:

Content TypeDescription
materialsLecture notes, PDFs, videos, files
announcementsTeacher announcements to students
quizzesQuiz configurations

Content fields: title, type, description, message, file_url, duration, classroom_id, created_at


Timetable Management

Model: Timetable (MongoDB)

Each timetable entry represents a single lecture slot:

FieldTypeDescription
classroomObjectId → ClassroomLinked classroom
userObjectId → UserTeacher assigned
organizationObjectId → OrganizationParent org
dayStringDay of week (e.g., "Monday")
startTimeStringStart time in HH:MM format
endTimeStringEnd time in HH:MM format
subjectStringSubject name
typeStringlecture
roomStringRoom/hall number
teacherStringTeacher name (display)

Timetable Usage Across the Platform

The timetable data is used by multiple modules:

  1. AI Chat RAG Engine — Fetches today's schedule and full weekly timetable for classroom context
  2. Teacher Availability — Calculates real-time BUSY/AVAILABLE status by checking if current time falls within any scheduled slot
  3. Student Dashboard — Displays daily schedule

Teacher Planning

Model: TeacherPlan (MongoDB)

Faculty members can create lesson plans linked to their classroom and subject:

  • Teaching plan content
  • Topic-wise breakdown
  • Scheduled dates
  • Progress tracking

Organization Subjects

Model: OrgSubject (MongoDB)

Centralized subject catalog for the organization:

FieldTypeDescription
organization_idObjectIdParent org
subjectNameStringDisplay name
maxMarksNumberDefault max marks (for result system)
classroomIdObjectIdOptional classroom link
isActiveBooleanSoft delete flag

Used by:

  • Marks system — Subject configuration for multi-subject exams
  • Classroom creation — Subject selection
  • Report cards — Subject-wise result display

Academic Hierarchy

Model: AcademicHierarchy (MongoDB)

Defines the organizational structure for academic programs:

JS
University
  └── Faculty/School
       └── Department
            └── Program (e.g., B.Sc. Computer Science)
                 └── Year (FY, SY, TY)
                      └── Division (A, B, C)

Used by:

  • Admissions — Mapping students to programs and divisions
  • Fee structures — Applying fees to specific programs
  • Reports — Aggregating data by hierarchy level

Meetings

Model: Meeting (MongoDB)

Online meeting integration for classrooms:

FieldTypeDescription
classroomObjectIdLinked classroom
topicStringMeeting topic
start_timeDateScheduled start
durationNumberDuration in minutes
providerStringMeeting platform (e.g., "zoom", "meet")

Used by the AI chat to show upcoming meetings in the classroom context.


How Students Join a Classroom

  1. Teacher creates a classroom → system generates a 10-digit classCode
  2. Teacher shares the code with students
  3. Student enters the code → ClassroomMembership is created with status: pending
  4. Teacher approves → status changes to approved
  5. Student's organization_id is auto-set to match the classroom's organization

This joining flow is referenced across every module:

  • Assignments — checks ClassroomMembership before allowing submission
  • Attendance — checks membership before allowing mark
  • Marks — checks membership before showing results
  • Chat — fetches enrolled classrooms for AI context

Key Relationships

JS
Organization
  ├── AcademicHierarchy (program structure)
  ├── OrgSubject[] (subject catalog)
  ├── Classroom[]
  │     ├── teacher → User (faculty)
  │     ├── ClassroomMembership[] → User (students)
  │     ├── Timetable[] (lecture schedule)
  │     ├── TeacherPlan[] (lesson plans)
  │     ├── Meeting[] (online meetings)
  │     └── classroom_content (Supabase)
  │           ├── materials
  │           ├── announcements
  │           └── quizzes
  └── OrganizationAnnouncement[] (org-wide notices)

Role Permissions

RoleCreate ClassroomJoin ClassroomManage TimetableManage ContentView Content
Org Admin
Faculty✅ (own)✅ (own)✅ (own)✅ (own)
Student✅ (via code)✅ (enrolled)
Was this helpful?
M↓Markdown supportedMessage is optional