You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Members and admins have no direct communication channel within the platform. Members can only contact the hub via the public contact form which has no thread history. In-app messaging enables member-to-admin and member-to-member communication with full history.
Context
NotificationsModule: backend/src/notifications/ — emit real-time event on new message
Overview
Members and admins have no direct communication channel within the platform. Members can only contact the hub via the public contact form which has no thread history. In-app messaging enables member-to-admin and member-to-member communication with full history.
Context
NotificationsModule:backend/src/notifications/— emit real-time event on new messagebackend/src/notifications/gateway/notifications.gateway.tsUserentity:backend/src/users/entities/user.entity.tsTasks
MessageThreadentity:id,participantIds(JSON array of User IDs),lastMessageAt(timestamptz),createdAtMessageentity:id,threadId(FK),senderUserId(FK),body(text),isRead(bool, default false),sentAt(timestamptz)POST /messages/threads— start a thread by specifying one or more participant user IDs (authenticated member or admin)GET /messages/threads— list the current user's threads, sorted bylastMessageAtdesc, each including the last message previewGET /messages/threads/:id/messages— paginated message history for a thread (participants only)POST /messages/threads/:id/messages— send a message; updateslastMessageAton the thread; emits anew-messageWebSocket event to all participantsPATCH /messages/threads/:id/read— mark all unread messages in the thread as read (for current user)GET /messages/unread-count— returns total unread message count for the current user (for badge display)Files to Modify / Create
backend/src/messaging/(module, entities, controller, service, providers)backend/src/app.module.ts