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 feedbackThis 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
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
- Teacher role grants classroom navigation.
- Teacher creates class/assignment.
- Learner submits work or recording.
- 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
- A teacher role alone is not enough; the teacher must own the selected class.
- The schema validates IDs and assignment fields before a write.
- 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.