Feature guide

Teacher classroom

Classes, learners, assignments, submissions, recordings, teacher roles, and feedback/review.

← Technical overview

What this domain owns

Teacher-only classroom operations and learner submissions.

Feature flow diagram

Teacher role
        │
        v
Classroom workspace ──> teacher/class APIs
        │                           │
        v                           v
Class + assignment ──> learner submission / recording
                                   │
                                   v
                         teacher review ──> learner feedback

This diagram shows the normal direction of control and data. Follow it before changing a boundary or adding a dependency.

Class and relationship diagram

┌───────────────┐ calls ┌─────────────────────┐ owns ┌─────────────┐
│ Teacher UI    │──────▶│ Classroom service   │──────▶│ Class       │
└───────────────┘       ├─────────────────────┤       └─────┬───────┘
                        │ + createAssignment()│             ▼
                        │ + reviewSubmission()│       ┌─────────────┐
                        └──────────┬──────────┘       │ Assignment  │
                                   │                  └─────┬───────┘
                                   ▼                        ▼
                           ┌─────────────┐          ┌─────────────┐
                           │ Teacher role│          │ Submission  │
                           └─────────────┘          └─────────────┘

Boxes show the important data types or services. Their fields and main methods are listed inside; arrows show the primary dependency or data relationship.

Sequence diagram

Teacher
Classroom UI
Teacher API
Classroom service
Database
Learner
Learner UI
Submission API
Review API
create assignment
submit assignment command
verify teacher owns class
ownership confirmed
save assignment
assignment saved
submit work/recording
save submission
add feedback
expose feedback

Read this from top to bottom: each arrow is the next interaction in the normal successful path.

Start here in the code

Choose any filename to open it directly in VS Code.

How it works

  1. Teacher role grants classroom navigation.
  2. Teacher creates class/assignment.
  3. Learner submits work or recording.
  4. Teacher reviews submission; learner sees feedback.

Read this code

src/contexts/teacher-classroom/server.tsOpen in VS Code — Authorize classroom work against the class

await requireTeacher(actor);
const assignment = assignmentSchema.parse(payload);
await classroom.assertTeacherOwnsClass(actor.id, assignment.classId);

return classroom.createAssignment(assignment);

What each part is doing

  1. A teacher role alone is not enough; the teacher must own the selected class.
  2. The schema validates IDs and assignment fields before a write.
  3. The classroom service performs the write so API routes remain small.

This is a deliberately short excerpt of the real pattern, with unrelated details omitted. Read the named file for the complete implementation.

Related API and server boundaries

  • /api/classes/*
  • /api/teacher/*
  • /api/assignments/*

Tests to read and run

Implementation notes

This is the home for detailed explanations, decision records, request examples, and diagrams for this feature. Add new feature-specific documentation here instead of expanding the platform overview.