-
Notifications
You must be signed in to change notification settings - Fork 18
Description
Create a comprehensive real-time chat system that allows users to connect and discuss eco-topics, share gardening tips, and build sustainable communities. This feature should include direct messaging, group chats, and eco-topic-based chat rooms.
Acceptance Criteria:
Create chat page with message interface
Implement real-time messaging using Socket.io
Add direct messaging between users
Create eco-topic-based chat rooms (e.g., Urban Gardening, Zero Waste, Renewable Energy)
Add message search and filtering functionality
Implement typing indicators and read receipts
Add file/image sharing in chats
Create notification system for new messages
Implement message encryption for privacy
Add emoji reactions and GIF support
Create admin moderation tools for chat rooms
Add mobile-responsive chat interface
Technical Implementation:
// Backend: Chat routes and Socket.io integration
// Frontend: Chat components with real-time updates
// Database: Message schema with proper indexing
Database Schema:
interface Message {
_id: ObjectId;
senderId: ObjectId;
recipientId?: ObjectId; // For direct messages
chatRoomId?: ObjectId; // For group chats
content: string;
messageType: 'text' | 'image' | 'file';
mediaUrl?: string;
reactions: Array<{userId: ObjectId, emoji: string}>;
readBy: Array<{userId: ObjectId, readAt: Date}>;
createdAt: Date;
updatedAt: Date;
}
Pages to create:
/chat - Main chat interface
/chat/rooms - Eco-topic chat rooms
/chat/direct/:userId - Direct messages