| Route | Purpose |
|---|
/connect | Chat inbox with sidebar |
/connect/[id] | Individual chat thread |
| Type | Description |
|---|
DIRECT | One-on-one conversation |
GROUP | Multi-user chat |
ONE_TO_ONE | Alternative direct chat |
ORDER | Order-related communication |
SYSTEM | System-generated messages |
- Sorted by
updatedAt (newest first)
- Max height 420px with scroll
- Tabs: All, Requests, Archive, Spammed, Blocked
- Unread count badges on tabs
- Multi-line textarea (40-200px auto-height)
- Enter to submit, Alt+Enter for newline
- File attachment (drag-drop or click)
- Emoji picker
- Voice recording (browser microphone API, stored as MP3)
text, image, file, voice, video, mix, link-dispute, system
- Type
@ to trigger autocomplete dropdown
- Searches chat members by displayName and email (case-insensitive)
- Stored as
@{userId} in message, displayed as @{displayName}
- Creates notification in
users/{uid}/mentions/{messageId}
- Full emoji picker on hover
- Stored as
reactions: { emoji: [userId1, userId2, ...] }
- Show count per emoji, highlight user’s own reactions
- Single check (gray): sent
- Double check (purple): read
- Auto-marked read when chat is viewed (
readBy array)
- Available for sender only
- Sets
isEdited: true flag
- Updates
updatedAt timestamp
- Delete for me: Adds userId to
deletedFor array (others still see it)
- Delete for all: Removes message entirely (sender only)
- Confirmation dialog required
- Replies stored in subcollection:
chats/{chatId}/messages/{messageId}/replies
- Original message shows reply count
- Thread panel opens on right side
- Same features: reactions, edits, mentions, quotes
| File Type | Icon | Color |
|---|
| Images | File_3d | Green |
| Videos | Video | Primary |
| Audio | Music | Orange |
| PDFs | FileText | Red |
| Word docs | FileText | Blue |
| Excel | FileSpreadsheet | Dark Green |
| Archives | Archive | Yellow |
Storage paths:
- Files:
files/{chatId}/{fileId}
- Voice:
audios/{chatId}/{fileId}
- Group avatars:
groups/{chatId}/avatar
All files tracked in StorageUserService with metadata.
- User sends connection request → chat created with
status: Requested
- Recipient sees in “Requests” tab
- Accept: Sets
status: Accepted, moves to main tab, adds system message
- Decline: Sets
status: Declined, stays in requests tab, adds system message
| Action | Direct | Group |
|---|
| Archive/Unarchive | Yes | Yes |
| Delete | Yes | No |
| Leave Group | No | Yes |
| Block User | Yes | No |
| Unblock User | Yes | No |
| Mark as Spam | Yes | No |
| Unmark as Spam | Yes | No |
- Stored at:
users/{uid}/blockedUsers/{userId}
- Data:
{ isBlocked: true, timestamp, userId }
- Hides chat from main list
- Shown in “Blocked” tab with unblock option
- Stored at:
users/{uid}/spammedChats/{userId}
- User selects criteria: Repetitive Content, Unsolicited Links, High Volume, Suspicious Keywords, Sender Reputation, Inconsistent Metadata, Other
- Custom reason text field
- Moves chat to “Spammed” tab
- Create with name + select multiple members
- Optional group avatar (5MB max, JPEG/PNG/GIF)
- Avatar stored at:
groups/{chatId}/avatar
admins array for admin privileges
- Leave group removes member + adds system message
- Real-time via Firebase Realtime Database at
presence/{userId}
- Session objects with
status (‘online’|‘away’|‘offline’) and lastSeen
- Displayed in chat header
| Data | Description |
|---|
| Message text | Exact content |
| Sender UID, name, photo | Sender identification |
| Timestamp | Seconds + nanoseconds precision |
| Read receipts | List of UIDs who read |
| Reactions | Emoji to user mapping |
| Mentions | Referenced user UIDs |
| Quoted message | Reference to replied message |
| Files | Name, size, type, URL, storage path |
| Edit/delete status | Tracked with timestamps |
| Deleted-for list | Per-user deletion tracking |