This folder is the current room runtime for the Smart Classroom demo. It owns the classroom bus, timeline, project contracts, mock events, OAK-D bridge, and readiness report.
It is the layer that lets us run the class demo even when hardware or student projects are incomplete:
- timeline/run-of-show cues
- student project roster and contract packets
- project heartbeats and mock events
- OAK-D / detector state pushes
- SSE event streams for listeners
- readiness report and event evidence for critique
cd classroom-api
npm startOpen:
http://localhost:4177
From another laptop or Raspberry Pi, replace localhost with the room computer IP:
http://ROOM_PC_IP:4177
| Page | Use |
|---|---|
/ |
Main dashboard: live status, projects, recent events |
/timeline.html |
Run-of-show. Scrub, play, and manually emit class/project cues |
/projects.html |
All project packets and featured mock scenarios |
/project.html?id=smart-stage |
One project contract, controls, live mock, and prompt |
/heartbeat |
No-code student check-in page |
/report.html |
Readiness / critique evidence |
/events.html |
Live event stream and replay inspection |
/cameras.html |
OAK-D state, camera commands, and camera request events |
/projector.html |
Projector output |
/board.html |
Board state, notes, tags, and manual inputs |
Each project only needs to prove one loop:
- Send a heartbeat.
- Listen for events it cares about.
- Emit one event back.
- Verify it appears in
/report.htmlor/events.html.
The no-code fallback is:
http://localhost:4177/heartbeat
Python fallback:
cd classroom-api
$env:CLASSROOM_API="http://localhost:4177"
$env:PROJECT_ID="smart-stage"
$env:CAPABILITIES="board.scene.requested,session.timer.offered"
$env:CONSUMES="board.zone.activated,board.tag.detected,session.mode.changed"
$env:EMITS="board.scene.requested,session.timer.offered"
python student_heartbeat.pyOpen each student's exact contract prompt:
http://localhost:4177/api/projects/PROJECT_ID/contract.md
The roster and contract source lives in:
public/project-packets.json
data/project-tags.json
To adapt this for a new class, update those two files first.
| Project ID | Project | Student(s) |
|---|---|---|
smart-stage |
Smart Stage | Gordon Cheng |
focus-beam |
Focus Beam | Feifey Wang |
forest-classroom |
Forest in the Classroom | Sophie Lee |
imprint |
Imprint | Darren Chia |
nodcheck |
NodCheck | Kathy Choi |
tony-ramon |
Tony the Bot | Ramon Naula |
tony-shuyang |
Tony the Bot (Emotion Layer) | Shuyang Tian |
grammar-coach |
English Communication Coach (Lumi) | Yuxuan Chen |
gesture-timer |
Timer | Phil Cote |
gus-mode |
Gus Mode / Virtual Gus | Juju Kim, Kathy Choi, Seren Kim |
seren-room |
A Room (Context-Aware Classroom) | Seren Kim |
Old detector workers can keep posting to the classroom API shape:
POST http://localhost:4177/push/state
Example payload:
{
"camera_id": "orbit",
"person_detected": true,
"person_count": 12,
"predicted_class": "presentation",
"prediction_confidence": 0.88,
"whiteboard_text_detected": true,
"whiteboard_text": ["contracts", "room state"]
}The server maps that into room events such as:
class.presence.changedclassifier.probe.changedsession.mode.changedwhiteboard.changedattention.direction.changed
Run the no-hardware OAK rehearsal:
npm run simulate:oaksKeep all submitted student projects live with mock heartbeats and scenario events:
npm run mock:projectsUse /timeline.html when you want the demo to follow the class schedule. Turn on Emit while playing to fire cues automatically, or press Emit on individual cues when something needs to be forced manually.
Compatibility endpoints kept for old scripts:
GET /health
GET /state
GET /mode
GET /room/context
GET /projects
GET /projects/readiness
GET /projects/{id}/packet.md
GET /subscribe/events?subscriber_id=PROJECT_ID
POST /push/state
POST /projects/{id}/heartbeat
POST /projects/{id}/events
POST /phase
Current endpoints:
GET /api/state
GET /api/projects
GET /api/projects/readiness
GET /api/projects/{id}/contract.md
GET /api/events/recent
GET /api/cameras
POST /api/projects/{id}/heartbeat
POST /api/projects/{id}/events
POST /api/cameras/{id}/command
POST /api/action
Syntax and local data checks:
npm run check
npm run test:projects
npm run test:readiness
npm run test:classroom-api-compatSmoke checks need the server running:
npm start
npm run test:smokePort 4177 is the new classroom API port. The old 8766 FastAPI service has been retired in this folder.