Every MongoDB collection in your system โ what it stores and why it exists.
User
Central identity store. One document per person regardless of role โ admin, teacher, or student.
role
email
password
uid
Student
Maps a physical RFID card UID to a student's identity. The bridge between hardware and people.
uid
rollNo
name
Subject
A course or class like "Mathematics" with a short code. Referenced by lecture sessions.
name
code
LectureSession
A live class window. While isOpen is true, RFID scans are recorded. Closed by teacher to end attendance.
subjectId
startTime
isOpen
Attendance
The core record. One per student per lecture. Status is Present, Late, or Absent โ determined by scan time.
โ User
โ LectureSession
status
LeaveRequest
Student submits a request to excuse absences for a date range. Admin/teacher approves or rejects it.
โ User
startDate
status
LatestScan
A single-document collection that holds the most recent RFID scan. The RFID reader writes here; the server reads it.
uid
timestamp
SystemState
Global on/off switch. Controls whether the system is in ATTENDANCE mode or MANAGEMENT mode.
mode
key