Overview
upLegal’s messaging system enables direct, real-time communication between clients and lawyers. Built on Supabase real-time subscriptions, the platform ensures instant message delivery with status tracking and contact fee management.Core Features
Real-Time Message Delivery
Messages are delivered instantly using Supabase real-time subscriptions:- Instant Updates: No page refresh required
- Status Tracking: Sending → Delivered → Read
- Optimistic UI: Messages appear immediately while sending
- Automatic Retry: Failed messages can be retried
Message Status Lifecycle
- Sending: Message is being transmitted to server
- Sent: Server has received the message
- Delivered: Message has been stored and sent to recipient
- Read: Recipient has viewed the message
Conversation Types
One-on-One Conversations
Direct messaging between a client and a lawyer:Group Conversations
Multi-participant conversations (e.g., legal team):Group conversations allow collaboration with multiple lawyers from the same firm or legal team.
Contact Fee System
Lawyers can set a contact fee for initial consultations:First Message Flow
- First Message: Client sends initial message to lawyer (free)
- Lawyer Response: Lawyer can respond freely
- Subsequent Messages: Client must pay contact fee (if set by lawyer)
Payment Check
Before sending a second message, the system:Contact fees are one-time payments per conversation. Once paid, clients can message the lawyer unlimited times in that conversation.
Message Features
Message Structure
File Attachments
Messages support file attachments:- Documents (PDF, DOC, DOCX)
- Images (JPG, PNG, GIF)
- Legal documents
- Size limit: Defined by Supabase storage configuration
Unread Count
Each conversation tracks unread messages:Real-Time Subscriptions
The messaging system uses Supabase real-time features:Message Subscription
Automatic Updates
- New Messages: Instantly appear in active conversations
- Status Changes: Real-time updates when messages are read
- Typing Indicators: Show when other participant is typing (future feature)
- Online Status: Display participant’s online/offline status
User Interface
Conversation List
Displays all conversations with:- Participant names and avatars
- Last message preview
- Unread count badge
- Timestamp of last activity
- Online status indicator
Message Thread
Active conversation view shows:- All messages in chronological order
- Sender avatar and name
- Message timestamp
- Read/delivered status
- Attachment previews
Message Composer
Input area includes:- Text input field
- Attachment button
- Send button
- Character limit (if applicable)
- File upload progress
Participant Information
Online Status
Participants show real-time availability:- Green dot: Currently online
- Gray dot: Offline
- Last seen: Timestamp of last activity (when offline)
Creating Conversations
From Lawyer Profile
Clients can initiate conversations from:- Lawyer profile page
- “Contactar” button on lawyer card
- After booking a consultation
Initial Message
The initial message is sent automatically when the conversation is created, streamlining the first contact experience.
Message Management
Mark as Read
Messages are marked as read when:Conversation Sorting
Conversations are sorted by:- Unread first: Conversations with unread messages appear at top
- Most recent: Then sorted by last message timestamp
- Active status: Online participants prioritized
Error Handling
Failed Message Delivery
If a message fails to send:- Status changes to “failed”
- Error message is displayed
- Retry button appears
- Message is removed from optimistic UI if retry is cancelled
Network Interruption
- Offline Detection: System detects network loss
- Queue Management: Messages queued for sending when connection restored
- User Notification: Clear indication of connectivity status
Security & Privacy
Access Control
Users can only:- View conversations they are participants in
- Send messages to conversations they belong to
- Access messages within their conversations
Data Storage
All messages are:- Stored in Supabase database
- Protected by Row Level Security (RLS)
- Accessible only to conversation participants
- Encrypted in transit and at rest
FAQ
How do I know if my message was delivered?
How do I know if my message was delivered?
Message status indicators show the delivery state:
- Single check: Sent
- Double check: Delivered
- Blue checks: Read by recipient
What is a contact fee?
What is a contact fee?
A contact fee is a one-time payment that some lawyers require before clients can continue messaging beyond the initial contact. Once paid, you can message that lawyer unlimited times in that conversation. The fee amount is set by each lawyer individually.
Can I send files through messages?
Can I send files through messages?
Yes! You can attach documents, images, and other files to your messages. Simply click the attachment button in the message composer and select your file.
Are my messages private?
Are my messages private?
Absolutely. All messages are encrypted and only visible to the participants in the conversation. upLegal uses Row Level Security to ensure your conversations remain completely private.
Can I delete messages?
Can I delete messages?
Currently, messages cannot be deleted once sent. We recommend carefully reviewing messages before sending. Message deletion features may be added in future updates.