Messaging System
The Kin Conecta messaging system enables direct, real-time communication between tourists and local guides. Built on a thread-based architecture, it facilitates tour planning, coordination, and relationship building between users.The messaging system supports text-based communication with read receipts and is designed for both pre-booking inquiries and post-booking coordination.
System Overview
The messaging infrastructure uses a thread-based model where conversations are organized into chat threads containing multiple messages.Chat Threads
Conversations between two users are organized into persistent threads that maintain message history.
Message Types
Support for different message types including text messages with extensibility for future media support.
Read Receipts
Track when messages have been read with timestamp tracking.
Real-time Delivery
Messages are delivered and stored immediately for instant communication.
Message Structure
Each message in the system contains the following information:Field Descriptions
messageId
messageId
Unique identifier for the message. Auto-generated by the system.
threadId
threadId
Identifier linking the message to a specific conversation thread between two users.
senderUserId
senderUserId
The ID of the user who sent the message (tourist or guide).
body
body
The text content of the message. Stored as TEXT type for long messages.
messageType
messageType
Type of message content. Currently supports:
TEXT: Standard text message- Future:
IMAGE,LOCATION,BOOKING_REQUEST
sentAt
sentAt
Timestamp when the message was sent. Automatically recorded on creation.
readAt
readAt
Timestamp when the message was read by the recipient.
null if unread.API Endpoints
The messaging system provides RESTful endpoints for chat operations:Send a Message
messageId and sentAt timestamp.
Get Messages by Thread
How to Use the Messaging System
Initiate Conversation
When a tourist finds a guide they’re interested in (via matching or search), they can initiate a conversation. The system creates a new thread linking the two users.
Send Messages
Users send messages through the API or UI, providing the thread ID, their user ID, and message content.
Receive & Read
Recipients retrieve messages from the thread. When a message is displayed to the recipient, the
readAt timestamp is updated.Implementation Details
The messaging system is implemented with the following components:Controller
Model
Database Table
Messages are stored in thechat_messages table with the following schema:
Message Types
The system uses an enum to define message types:TEXT messages are fully implemented, but the architecture supports future extensions.
Use Cases
Pre-Booking Inquiries
Tourists ask questions about tour details, availability, customization options, and pricing before making a booking.
Tour Coordination
After booking, users coordinate meeting times, locations, and any special requests or changes.
Relationship Building
Ongoing communication helps build trust and rapport between tourists and guides.
Post-Tour Follow-up
Users can thank each other, share photos, or discuss future tour opportunities.
User Experience Flow
For Tourists
- Discover a Guide: Find a compatible guide through matching or search
- Start Conversation: Click “Message” to open a chat thread
- Ask Questions: Inquire about tours, availability, customization
- Coordinate Details: Finalize meeting points, times, and special requests
- Stay Connected: Continue communication before, during, and after the tour
For Guides
- Receive Inquiry: Get notified when a tourist sends a message
- Respond Promptly: Answer questions about tours and availability
- Provide Details: Share additional information, photos, or recommendations
- Confirm Bookings: Coordinate logistics and confirm tour details
- Build Relationships: Maintain communication for potential repeat business
Best Practices
Response Time
Quick responses improve user experience. Guides should aim to respond within 24 hours.
Professional Tone
Maintain professional, friendly communication to build trust and credibility.
Clear Information
Provide specific details about tours, pricing, and logistics to avoid confusion.
Safety & Privacy
Avoid sharing sensitive personal information until booking is confirmed.
Future Enhancements
Planned improvements to the messaging system:- Real-time Notifications: Push notifications for new messages
- Media Support: Share images, videos, and location pins
- Typing Indicators: Show when the other user is typing
- Message Reactions: Quick emoji reactions to messages
- Voice Messages: Audio message support
- Translation: Automatic translation for cross-language communication
- Booking Integration: Create booking requests directly from chat
- Archive & Search: Search message history and archive old conversations