feat(notifications): persistent student notifications with per-student clear & email targeting - #68
Open
shaikzahoorahmed77-svg wants to merge 3 commits into
Conversation
added 2 commits
August 1, 2026 22:08
…port per-student clear and teacher can now announce code to join the room based on mails in csv file
shaikzahoorahmed77-svg
force-pushed
the
feat/student-notifications
branch
from
August 1, 2026 17:54
41d320b to
3c67e5a
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR introduces persistent student notifications in MongoDB, real-time WebSocket distribution, per-student notification management (clearing), CSV target email filtering, and reliable notification bell ringing indicators across page navigation and reconnects.
Key Changes
Backend
backend/src/models/Notification.js): Created Mongoose model storingroomCode,announcement, targetemailslist,fileName,clearedBy(array of student User ObjectIds), andcreatedAt.backend/src/routes/notifications.js):GET /api/notifications: Fetches active, uncleared notifications matching the student's email or targeted to all.POST /api/notifications/clear: Marks notifications as cleared strictly for the requesting student by appending their User ID toclearedBy.backend/src/index.js): Updatednew_announcementhandler to save the announcement to MongoDB (Notification.create) upon emission while keeping real-time socket broadcasting.Frontend
frontend/src/pages/StudentDashboard.jsx):✕dismiss actions to update backend state so clearing is individual to each student.frontend/src/stores/socketStore.js): Added a globalnew_announcementlistener so students receive and record incoming notifications regardless of which page/route they are currently on.Verification & Behavior
clearedBywithout removing the notification for Student B.