CH 26Basic

Classroom AI, Platform Services & Public Site

Everything that sits beside the main modules: the classroom hardware and engagement-scoring pipeline, recorded live-class sessions, the child pickup register, hall tickets and teacher diaries in technical detail, privacy and consent routes, the support, tutorial and app-update services, and the public website. Chapter 15 covers Live Broadcast and Video Meet.

Modules & Services

Classroom Devices (Edge Hardware)

Basic
  • ClassroomDevice model: name, classroom, floor, building, studentCapacity (default 30), cameras[] (role student_facing or room_facing, deviceIndex, label), microphones[], studentDeviceMap[] (student → cameraIndex, micIndex), status (active, inactive, maintenance), lastHeartbeat, agentVersion, ipAddress, registeredBy
  • Registering a device returns an 8-character deviceCode and a UUID deviceToken once: the token is stored only as a bcrypt hash (cost 12) and cannot be shown again
  • Edge devices call the API with the Authorization token plus an X-Device-Code header, with no user JWT. POST /api/classroom-devices/:id/heartbeat updates lastHeartbeat, agentVersion and ipAddress
  • Devices can also connect to the separate Socket.IO namespace /device and send device-register { deviceCode, deviceToken }. A valid pair joins the room classroom:<classroom> and the device is marked connected; a wrong code or token gets device-auth-error. This namespace does not use the per-event rate limiter of the normal user sockets
  • Admin and facilities_admin register, edit, activate, deactivate and delete devices; teachers can read device status
  • Device management and signal ingest are exempt from the subscription check so admin operations and ingest keep working
  • Web: /dashboard/admin/classroom-ai · Mobile: (admin)/devices.tsx

AI Signals & Engagement Scoring

Basic
  • AISessionSignal (one per student per interval, default 5 s): camera { gazeDirection, eyeOpenness, expression, deskActivity, handRaised, confidence }, audio { isSpeaking }, isAttentive. A TTL index deletes signals after 90 days
  • POST /api/ai-signals accepts one signal; POST /api/ai-signals/batch is the preferred path (max 200 per batch, sent about every 30 seconds, ordered:false so one bad record does not fail the batch; partial failures return 207)
  • Batch ingest auto-marks attendance for the unique students seen in the batch without blocking the response
  • services/engagementScoringService turns a session's signals into one StudentEngagementScore per (session, student): attention = isAttentive 60 + eye openness (open 20, half-open 10) + gaze (center 20, board 18 ...); engagement = expression (happy 60, neutral 45 ...) + desk activity (writing 20, phone 0 ...) + confidence × 20
  • Participation is built from speaking, hand-raise and positive-expression rates. overallScore = attention × 0.5 + engagement × 0.3 + participation × 0.2
  • performanceTier: excellent ≥ 75, good ≥ 55, average ≥ 35, otherwise at_risk. isAtRisk is also set when overall is below ENGAGEMENT_AT_RISK_THRESHOLD (default 35) or attention is below ATTENTION_AT_RISK_THRESHOLD (default 25)
  • Also stored: a per-minute attention timeline, confusion spikes (two or more consecutive low-attention minutes) and participation events
  • Scores endpoints are subscription-gated; student scores follow the student/parent/school-staff access guard
  • Admin can purge a session's signals with DELETE /api/ai-signals/session/:sessionId

Hardware Consent (Camera & Microphone)

Basic
  • HardwareConsent per student: consentType (camera, microphone, both), status (pending, granted, denied, revoked), consentedAt, revokedAt, revocationReason, consentMethod (online_form, paper, app), a hashed consent token
  • The parent answers through a tokenised link (GET/POST /api/hardware-consent/:id/respond; web page /consent/respond)
  • Admin lists pending consents, reads a student's consent and revokes it
  • services/hardwareConsentCron runs daily at 9am and revokes granted consents that have passed expiresAt

Live Class Sessions, Recording & Summaries

Basic
  • Session model: course, lessonPlan, week/day number, teacher, section, date, start/end time, status (scheduled, in_progress, completed, cancelled), attendance[] (present, absent, late, excused), materials[], recording, audioRecording and summary
  • Teacher, admin and super_admin create, start and end sessions and mark session attendance
  • Recording runs through Firefly.AI: a bot joins the meeting URL when FIREFLY_API_KEY is configured. Without it the session is recorded locally with a warning and no bot joins
  • Recording status: not_started, recording, processing, completed, failed. The transcript is fetched into transcriptText and the Firefly webhook (POST /api/sessions/firefly/webhook, public, HMAC-verified, declared in app.js) completes it. GET /api/sessions/firefly/callback handles the OAuth return
  • Summary: homework, additional notes and a Firefly notes link, generated manually or with AI (aiLimiter applies), edited by the teacher, then published to students
  • Audio-only recording can be started, uploaded and deleted per session
  • Web: students open published summaries from Session Summaries · Mobile: (teacher)/sessions.tsx, (student)/sessions.tsx, (admin)/live-sessions.tsx

Child Register (Pickup Log)

Basic
  • ChildRegisterEntry records who collected a child: student, personName, relation (father, mother, guardian, relative, driver, family_friend, other), phone, reason (default Early pickup), notes, pickupAt, recordedBy and a required photo of the person
  • POST /api/child-register is a multipart upload: the photo goes to object storage under child-register/ and the student must belong to the active school
  • GET /api/child-register lists entries with search, date range, student, class and section filters, newest first, paginated (max 100)
  • Admin only. Web: /dashboard/admin/child-register · Mobile: (admin)/child-register.tsx

Hall Tickets (Technical Detail)

Basic
  • HallTicket per student and exam: hallTicketNumber, rollNo, examCenter, class, section, academicYear, examTitle, term, papers[] (subjectName, paperCode, examDate, startTime, endTime, room, maxMarks), instructions[], verificationCode, issuedBy, isPublished
  • POST /api/hall-tickets/generate builds tickets for a whole class or section in bulk (a handful of database calls using bulkWrite). GET /generate-status reports progress
  • Each PDF carries a QR code and verification code. PDFs are cached (services/pdfCache) and pre-built after generation and publish (services/pdfPrebuild)
  • PDF downloads are rate-limited; builds past the server's limit wait in a short queue and answer 503 with Retry-After when it is full
  • Admin publishes or unpublishes a ticket and can delete one or many. Teachers can list tickets
  • Web: /dashboard/admin/hall-tickets · Mobile: (admin)/hall-tickets.tsx

Teacher Diaries

Basic
  • TeacherDiary: one entry per teacher per date (unique on school, teacher, date) with classes, content (what was taught) and homework
  • Teacher saves with POST /api/teacher-diaries/save, reads today's log with /my-log and earlier ones with /my-saved-logs
  • Admin reads every teacher's entries from /admin-feed and leaves a note with PUT /:id/admin-note (stores adminNote, adminNoteBy, adminNoteAt)
  • Web: /dashboard/teacher/diary, /dashboard/admin/teacher-diaries · Mobile: (teacher)/diary.tsx, (admin)/teacher-diaries.tsx

Privacy, Data Rights & Parental Consent

Basic
  • Any signed-in user can export their data (GET /api/gdpr/export-data), correct it (PUT /update-data), restrict processing and request account deletion (DELETE /delete-account)
  • Deletion requests are listed, approved or cancelled by an admin (or the parent for a child) and handled with data-retention scheduling (services/dataRetentionService)
  • Parental consent for minors: admin sends consent requests to one student or in bulk; parents answer in-app (/parent/respond/:studentId) or from an emailed token link (GET /api/parental-consent/consent-form/:token, POST /submit-consent/:token)
  • Admin views per-student and bulk consent status, a compliance status summary and retention status. Setting retention for a user and manual cleanup (super_admin only) are available
  • Mobile: My Data Rights (every role), (admin)/gdpr-compliance.tsx, (admin)/deletion-requests.tsx, (super-admin)/deletion-requests.tsx

Admin Overview Dashboard

Basic
  • GET /api/admin-overview (admin) returns one payload for the home dashboard: counts (students, teachers, staff, parents, courses, quizzes), counts by role, attendance per day (present, late, absent, leave) for students and teachers, and fee totals (total due, paid, outstanding)
  • Everything is scoped to the caller's school taken from the session, never from the request
  • Students are shown as present or absent only: late and half day count as present, every kind of leave counts as absent

Video Guides & Tutorials

Basic
  • TutorialVideo: category, featureGroup, title, language, description, youtubeId (validated as 11 characters), youtubeUrl, duration, order, isActive. Videos are hosted on YouTube
  • GET /api/tutorials returns active videos to any signed-in user with optional category and search filters, and seeds defaults the first time it is called
  • platform_admin curates them: list all, create, update, delete, rename a category or feature group, seed defaults, and clear demo or all videos
  • Web: /dashboard/tutorials (viewer), /dashboard/admin/tutorials/manage (curation) · Mobile: Video Guides & Tutorials in every role's menu (components/TutorialsScreen)

Support Requests & Report an Issue

Basic
  • POST /api/support is public and rate-limited (contactFormLimiter). It validates name, email and message, escapes all input and emails the NexusOne team
  • Recipients come from SUPPORT_EMAILS (comma-separated). If unset, the default team addresses are used, not the sender address
  • Mobile apps carry a Report an Issue entry (opens a Google Form) and a floating report button (components/ReportIssueFloatingButton)

Push Tokens & App Update Check

Basic
  • POST /api/mobile/token registers a device push token (MobileDeviceToken: user, token (unique), platform android or ios, deviceId, experienceId, isActive, lastUsedAt). Registering on the same deviceId deactivates that user's older tokens. DELETE /api/mobile/token removes it
  • GET /api/app-version is public and cached for 5 minutes. It returns android and ios { latestVersionCode, latestVersion, storeUrl } and an optional message
  • Configure with MOBILE_ANDROID_LATEST_VERSION_CODE, MOBILE_ANDROID_LATEST_VERSION, MOBILE_ANDROID_STORE_URL, MOBILE_IOS_LATEST_BUILD, MOBILE_IOS_LATEST_VERSION, MOBILE_IOS_STORE_URL and MOBILE_UPDATE_MESSAGE. The Android store URL defaults to https://play.google.com/store/apps/details?id=com.nexusone.lms
  • When no Android version is configured, the server reads the live version from the Play Store listing (cached 3 hours) and the app compares version names. An explicit version code takes priority
  • The app checks on launch and when it returns to the foreground after 6 hours. An older install sees a skippable Update popup; closing it silences that release for 24 hours. Update opens market://details?id=com.nexusone.lms and falls back to the https link

Public Website & Blog

Basic
  • Navbar (components/common/SiteNavbar, shared by every public page): Product ▾ (Feature Tour, Mobile App), Docs, Pricing, Login, Contact Us and a Book Demo button. The logo is the way home. The Blog link was removed
  • Book Demo opens the booking page set once in src/lib/demo.js (DEMO_URL). The contact page has a ?demo=1 variant with the same button and emails that open with a demo subject
  • /feature-tour lists every module (31, in Core and More groups, data in src/data/featureTour.js) with a page per module at /feature-tour/<slug>, an FAQ (src/data/faqs.js, also published as FAQPage structured data) and a demo card
  • /mobile-app shows the Google Play button and a QR code (public/play-store-qr.jpg) with what each role can do. /pricing shows Lite, Standard and Elite with monthly and yearly prices
  • Other public pages: /docs, /documentation, /contact, /courses, /demo-videos, /admission-inquiry/[schoolId] (a school's own enquiry form), /register-school, /register-platform-admin, /subscription/* (upgrade, success, cancel, trial-success), /verify/[code] (credential verification), /documents/shared/[token] (shared document package), /portfolio/share/[token] (shared Growth Passport) and /legal/* (privacy policy, terms, cookies, compliance)
  • Blog: BlogPost content served by /api/blog (public list, tags and /:slug); platform_admin sees all posts and publishes, unpublishes or deletes them. The pages at /blog and the sitemap entries remain even though the navbar no longer links to it
  • app/sitemap.js lists the home, pricing, documentation, blog, feature tour, mobile app and every feature-tour page

API Reference — Chapter 26

Classroom Devices

GET/api/classroom-devices

List devices (admin, teacher, facilities_admin)

POST/api/classroom-devices

Register a device; returns deviceCode and deviceToken once (admin, facilities_admin)

GET/api/classroom-devices/:id

Get one device

PATCH/api/classroom-devices/:id

Update a device

DELETE/api/classroom-devices/:id

Delete a device

GET/api/classroom-devices/:id/status

Heartbeat age and status

POST/api/classroom-devices/:id/activate

Activate a device

POST/api/classroom-devices/:id/deactivate

Deactivate a device

POST/api/classroom-devices/:id/heartbeat

Device heartbeat; device-token auth, no user login

AI Signals & Engagement Scores

POST/api/ai-signals

Ingest a single signal from an edge device

POST/api/ai-signals/batch

Ingest up to 200 signals; auto-marks attendance for the students in the batch

GET/api/ai-signals/session/:sessionId

Signals for a session (admin, teacher)

GET/api/ai-signals/student/:studentId/session/:sessionId

One student's signals for a session

DELETE/api/ai-signals/session/:sessionId

Purge a session's signals (admin)

GET/api/engagement-scores/school-overview

School-wide engagement summary (admin, super_admin)

GET/api/engagement-scores/at-risk

Students flagged at risk (admin, teacher, super_admin)

GET/api/engagement-scores/session/:sessionId

All scores for a session

GET/api/engagement-scores/session/:sessionId/student/:studentId

One student's score for a session

GET/api/engagement-scores/live/:sessionId

Live scores while a session is running

POST/api/engagement-scores/compute/:sessionId

Compute or refresh scores for a session

GET/api/engagement-scores/student/:studentId

A student's scores over time (student, parent, staff)

Hardware Consent

GET/api/hardware-consent/pending

Pending consents (admin)

GET/api/hardware-consent/student/:studentId

A student's consent record

GET/api/hardware-consent/:id/respond

Open the tokenised consent link

POST/api/hardware-consent/:id/respond

Parent grants or denies consent

POST/api/hardware-consent/:id/revoke

Revoke a consent (admin)

Live Class Sessions

POST/api/sessions

Create a session (teacher, admin, super_admin)

GET/api/sessions

List sessions

GET/api/sessions/active

The session running now

GET/api/sessions/:id

Get a session

PUT/api/sessions/:id

Update a session

DELETE/api/sessions/:id

Delete a session

POST/api/sessions/:id/start

Start the session

POST/api/sessions/:id/end

End the session

POST/api/sessions/:id/attendance

Mark session attendance

POST/api/sessions/:id/recording/start

Start a Firefly.AI recording (or record locally if not configured)

POST/api/sessions/:id/recording/stop

Stop the recording

POST/api/sessions/:id/recording/fetch-transcript

Fetch the transcript

POST/api/sessions/:id/recording/complete

Mark the recording complete

POST/api/sessions/:id/summary/generate

Generate a summary

POST/api/sessions/:id/summary/ai-generate

Generate a summary with AI (rate-limited)

POST/api/sessions/:id/summary/publish

Publish the summary to students

POST/api/sessions/:id/audio-recording/start

Start an audio-only recording

GET/api/sessions/firefly/callback

Firefly.AI OAuth return

POST/api/sessions/firefly/webhook

Firefly.AI webhook; public, HMAC-verified, declared in app.js

Child Register

GET/api/child-register

List pickup entries with search, date, student, class and section filters (admin)

POST/api/child-register

Record a pickup with the collector's photo (multipart, admin)

Hall Tickets

POST/api/hall-tickets/generate

Generate tickets for a class or section (admin, super_admin)

GET/api/hall-tickets/generate-status

Generation progress

GET/api/hall-tickets

List tickets (admin, super_admin, teacher)

GET/api/hall-tickets/class-subjects/:classId

Subjects of a class for the paper schedule

GET/api/hall-tickets/:id

One ticket

PATCH/api/hall-tickets/:id/publish

Publish or unpublish a ticket

GET/api/hall-tickets/:id/pdf

Download the ticket as a PDF with QR code (rate-limited, cached)

DELETE/api/hall-tickets/:id

Delete a ticket

DELETE/api/hall-tickets/batch

Delete many tickets

Teacher Diaries

GET/api/teacher-diaries/my-log

The teacher's log for today

GET/api/teacher-diaries/my-saved-logs

The teacher's earlier entries

POST/api/teacher-diaries/save

Save a day's entry (one per teacher per date)

GET/api/teacher-diaries/admin-feed

Admin: every teacher's entries

PUT/api/teacher-diaries/:id/admin-note

Admin leaves a note on an entry

Privacy & Consent

GET/api/gdpr/export-data

Export the signed-in user's data

PUT/api/gdpr/update-data

Correct personal data

POST/api/gdpr/restrict-processing

Restrict processing of one's data

DELETE/api/gdpr/delete-account

Request deletion of one's own account

GET/api/gdpr/deletion-requests

List deletion requests (admin, parent)

POST/api/gdpr/deletion-requests/:userId/approve

Approve a deletion request

POST/api/gdpr/deletion-requests/:userId/cancel

Cancel a deletion request

GET/api/gdpr/parent/consent-status

Parent: consent status for their children

POST/api/gdpr/parent/respond/:studentId

Parent answers a consent request

POST/api/gdpr/parental-consent/bulk-send

Send consent requests to many students (admin)

POST/api/gdpr/parental-consent/:studentId

Send a consent request for one student

GET/api/gdpr/bulk-consent-status

Consent status across students (admin)

GET/api/gdpr/compliance-status

Compliance summary (admin)

GET/api/gdpr/retention-status

Retention schedule status (admin)

POST/api/gdpr/set-retention/:userId

Set retention for a user (admin)

POST/api/gdpr/manual-cleanup/:userId

Manual cleanup (super_admin only)

GET/api/parental-consent/consent-form/:token

Public: open a parent's emailed consent form

POST/api/parental-consent/submit-consent/:token

Public: submit the consent form

AI Insights (Elite)

POST/api/ai-insight/student

AI insight report for a student (student, parent, admin)

POST/api/ai-insight/parent

AI summary for a parent (parent, admin)

POST/api/ai-insight/teacher

AI insight for a teacher (teacher, admin)

POST/api/ai-insight/admin

AI insight for school management (admin)

POST/api/ai-insight/roadmap

Learning roadmap (student)

POST/api/ai-insight/lesson

AI-generated lesson (student)

POST/api/ai-insight/essay-grader

Essay auto-grading (student)

Learning Outcomes & Programming Lab

GET/api/learning-outcomes

List learning outcomes

POST/api/learning-outcomes

Create (admin, super_admin, teacher)

PUT/api/learning-outcomes/:id

Update (admin, super_admin, teacher)

DELETE/api/learning-outcomes/:id

Delete (admin, super_admin)

GET/api/judge0/languages

Languages available in the programming lab

GET/api/judge0/status

Code-execution service status (admin)

Admin Overview, Tutorials, Support & Mobile

GET/api/admin-overview

Home dashboard payload for the admin

GET/api/tutorials

Active tutorial videos (filter by category or search)

GET/api/tutorials/all

Every tutorial including inactive (platform_admin)

POST/api/tutorials

Add a tutorial (platform_admin)

PUT/api/tutorials/:id

Update a tutorial (platform_admin)

DELETE/api/tutorials/:id

Delete a tutorial (platform_admin)

PUT/api/tutorials/categories/rename

Rename a category (platform_admin)

PUT/api/tutorials/features/rename

Rename a feature group (platform_admin)

POST/api/support

Public: send a support request email (rate-limited)

POST/api/mobile/token

Register this device's push token

DELETE/api/mobile/token

Remove this device's push token

GET/api/app-version

Public: latest app version and store link for the update popup

Blog

GET/api/blog

Public list of published posts

GET/api/blog/tags

Public list of tags

GET/api/blog/:slug

Public: one post

GET/api/blog/admin/all

All posts including drafts (platform_admin)

PATCH/api/blog/:id/publish

Publish a post (platform_admin)

PATCH/api/blog/:id/unpublish

Unpublish a post (platform_admin)

DELETE/api/blog/:id

Delete a post (platform_admin)

Frontend Pages

PathRoleDescriptionTier
/dashboard/admin/classroom-aiAdminClassroom devices, consent and engagement scoresBasic
/dashboard/admin/child-registerAdminRecord and search child pickups with photoBasic
/dashboard/admin/hall-ticketsAdminGenerate, publish and download hall ticketsBasic
/dashboard/admin/teacher-diariesAdminRead teacher diaries and leave notesBasic
/dashboard/teacher/diaryTeacherWrite the daily diaryBasic
/dashboard/tutorialsSigned-in usersVideo guides and tutorialsBasic
/dashboard/admin/tutorials/managePlatform adminCurate tutorial videosBasic
/consent/respondParent (link)Answer a camera and microphone consent requestBasic
/feature-tourPublicModule overview, FAQ and demo cardBasic
/feature-tour/[slug]PublicOne page per moduleBasic
/mobile-appPublicGoogle Play button, QR code and role overviewBasic
/pricingPublicLite, Standard and Elite plansBasic
/contactPublicContact emails; ?demo=1 shows the demo booking buttonBasic
/verify/[code]PublicCredential verificationBasic
/documents/shared/[token]Public (link)Shared document packageBasic
/portfolio/share/[token]Public (link)Shared Growth PassportBasic
/admission-inquiry/[schoolId]PublicA school's admission enquiry formBasic

Mobile Screens

(admin)/devices.tsx
Classroom devices
Basic
(admin)/live-sessions.tsx
Live class sessions
Basic
(teacher|student)/sessions.tsx
Class sessions and published summaries
Basic
(admin)/child-register.tsx
Child pickup register with photo
Basic
(admin)/hall-tickets.tsx
Hall tickets
Basic
(admin)/teacher-diaries.tsx
Teacher diaries and admin notes
Basic
(teacher)/diary.tsx
Write the daily diary
Basic
(admin)/gdpr-compliance.tsx
Compliance and consent overview
Basic
(admin|super-admin)/deletion-requests.tsx
Review account-deletion requests
Basic
(role)/data-rights.tsx
My Data Rights: export, correct and delete my data
Basic
(role)/tutorials.tsx
Video Guides & Tutorials
Basic
(role)/report-issue.tsx
Report an Issue
Basic
components/AppUpdatePrompt.tsx
Update available popup (mounted in the root layout)
Basic