Course-scoped 1:1 chat: students ↔ instructors for approved enrollments only. Plus class group chat: instructor + all students in a class group, shared thread. Open several browser profiles (one instructor + one or more students) to test all of it. Swagger
Serve this page from the same origin as the API so
/OneSignalSDKWorker.js works (e.g. http://localhost:3000/chat-push-test.html).
Student needs status: approved enrollment; instructor must be course.instructorId.
Seed: npm run seed:all — student student@academy.local / instructor from school admin.
Uses MongoDB user _id as external_id. Requires OneSignal env on API.
Connects automatically after login with the access token as auth.token. While
connected, polling is switched off: new messages, deletes, read receipts and typing arrive
live, and text messages are sent over the socket (attachments still use REST).
Instructor only. Create a group of students who share a course, then open it below to test the shared group chat. Renaming, adding/removing students, and delete are instructor-only too — use Swagger for those.