The Communication module connects every layer of the workforce — from quick direct messages between two colleagues to org-wide announcements from HR. All real-time events flow over WebSocket connections managed by the platform’sDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/Paramount-Intelligence/HR_Monitoring_System/llms.txt
Use this file to discover all available pages before exploring further.
RealtimeService, while push notifications reach users on mobile (Expo) and desktop browsers (Web Push VAPID) even when they are offline.
Messaging
Conversations
The messaging system is built around theConversation model. Every exchange — whether a 1-to-1 DM, a group chat, or a contextual thread — lives in a conversation.
Conversation types:
| Type | Description |
|---|---|
DIRECT | One-to-one private message between two users |
GROUP | Multi-member chat with configurable posting permissions |
CHANNEL | Broadcast channel; only owner/admin can post |
TASK_THREAD | Auto-created discussion thread attached to a task |
PROJECT_THREAD | Auto-created discussion thread attached to a project |
MEETING_THREAD | Thread attached to a specific meeting |
APPROVAL_THREAD | Thread for approval clarifications |
EOD_THREAD | Manager ↔ employee EOD feedback thread |
SUPPORT_THREAD | Support ticket thread |
Direct messages are deduplicated — if a DM conversation already exists between two users, creating it again returns the existing conversation instead of creating a duplicate.
Message Formatting
Message bodies support both a plain-textbody field and a body_html field for rich content. The frontend uses TipTap to author rich text; the backend sanitizes the HTML through prepare_message_content() before persisting it. Both fields are stored, and the frontend chooses which to render.
Message Receipts and Read Status
Each message tracks delivery and read state per recipient via aMessageReceipt row.
- Delivered: Automatically marked when the recipient fetches the message list (
GET /messages/conversations/{id}/messages) or by an explicit call toPOST /messages/conversations/{id}/delivered. - Seen: Marked when the user opens the conversation (
POST /messages/conversations/{id}/seenorPOST /messages/conversations/{id}/read). This also updates the participant’slast_read_attimestamp. - Info endpoint:
GET /messages/{message_id}/inforeturns the full per-recipient receipt breakdown, showing who has received and read the message.
RealtimeService.emit_seen_updates() and emit_delivered_updates().
Attachments and Voice Notes
Files are uploaded before being linked to a message. Permitted file types include images (png, jpg, webp, gif), documents (pdf, docx, xlsx, csv, ppt), and audio (mp4, webm, ogg, mp3). Limits:
| Type | Max Size | Notes |
|---|---|---|
| General attachment | 10 MB | Up to 5 files per message |
| Audio attachment | 2 MB | Audio MIME types only |
| Voice note | 5 MB | Max 60 seconds; sent as a VOICE message type |
Mentions
Users can be@mentioned inside messages by passing mentioned_user_ids in the message payload. The backend validates that each mentioned user is a legitimate participant in the conversation’s context before creating the MessageMention record. Mentions are reflected in the GET /messages/unread-count response as a separate mentions counter.
Group and Channel Permissions
Groups and channels support per-conversation posting policies:| Policy | Field | Values |
|---|---|---|
| Who can send messages | who_can_send_messages | all_members / admins_only |
| Who can add members | who_can_add_members | all_members / admins_only |
| Who can edit group info | who_can_edit_group_info | all_members / admins_only |
PATCH /messages/conversations/{id}/settings. Participant roles are OWNER, ADMIN, MEMBER, and VIEWER. Platform-level managers (ADMIN, HR_OPERATIONS, MANAGER roles) can always add members regardless of conversation-level policy.
Voice and Video Calls
WebRTC Architecture
Calls use WebRTC for direct peer-to-peer media exchange. The platform acts purely as a signaling layer — no media server is required for 1-to-1 calls. This keeps call quality high and infrastructure costs low.In the current release, calls are restricted to direct (1-to-1) conversations. Group calls require a media server and are not yet supported. Attempting to start a call in a group or channel returns HTTP 400.
Call Lifecycle
WebRTC Signaling
SDP offers/answers and ICE candidates are relayed through the backend’s signaling store:consumed_at) when polled, preventing duplicate delivery.
Call Recordings
Call participants can upload a browser-captured recording after a call ends. Recordings are stored either locally or in S3/Railway Bucket, depending on the environment’sSTORAGE_DRIVER configuration.
call_recordings.view permission):
Each admin access to a recording (view, stream, download, delete) writes an
AuditLog entry with entity_type="call_recording" for accountability.Meetings
Meetings are calendar-style invitations with RSVP tracking. Any authenticated user can create a meeting and invite colleagues.Endpoints
Meeting Model
Each meeting has atitle, description, start_at, end_at, optional meeting_link, and optional location. The organizer is automatically added as an accepted participant. All other invitees start as pending.
When a meeting is created, each invited participant receives an in-app Notification of type MEETING_INVITE, and a meeting_created WebSocket event is emitted to all participant IDs.
Admins and HR Operations users can view all meetings by passing ?scope=all to GET /meetings or GET /meetings/today.
Announcements
Announcements are one-to-many broadcasts created by Admins or HR Operations. They appear prominently on the dashboards of targeted users.Creating Announcements
all, employee, admin, hr_operations, manager, team_lead, intern, junior_employee
When an announcement is created with is_active: true, a announcement_created WebSocket event is emitted to all targeted users via RealtimeService.emit_announcement().
Viewing and Managing Announcements
draft → active → archived lifecycle managed through the is_active flag and end_date.
Notifications
In-App Notifications
All platform events — messages, meeting invites, missed calls, approvals — generateNotification records for the relevant users.
MEETING_INVITE, MEETING_UPDATED, MEETING_CANCELLED, CALL_INCOMING, CALL_MISSED, and SYSTEM.
Notification Preferences
Each user controls which notification categories they receive:NotificationPreferencesUpdate schema allows toggling individual notification channels per event type. Preferences are created on first access if they do not exist.
Web Push (Browser)
Desktop browsers subscribe using the VAPID Web Push standard:configured, subscriptions, attempted, sent, and failed counts, making it easy to diagnose push delivery issues.
Mobile Push (Expo)
The mobile app registers its Expo push token on login:Real-Time Presence
User online/away/offline status is maintained via WebSocket heartbeats. Thews_manager tracks active connection counts per user ID. The UserOnlineEnricher service attaches live presence_status values to participant user objects returned in ConversationRead responses, so the messaging UI can display accurate presence indicators without polling.
Presence state is in-memory and connection-count based. A user with at least one active WebSocket connection is considered
online. Disconnection triggers an offline state after the heartbeat window lapses.