A production-ready, fast, and secure messaging API similar to WhatsApp with advanced features including group chats, communities, channels, and status updates.
- User registration with unique IDs
- Secure message sending (text, image, video, document, link)
- Fast chat history retrieval
- Message delivery status tracking
- Typing indicators
- Create and manage groups
- Group messaging with E2E encryption
- Admin controls and member management
- Message reactions and replies
- Create communities with multiple channels
- Public and private channels
- Channel moderation
- Pinned messages
- WhatsApp-style status updates with text, images, and videos
- Control visibility (all, contacts, specific users)
- View status viewers
- Auto-expiry after 24 hours (configurable)
- Secure file uploads with validation
- Media serving with thumbnails
- Security scanning for malicious content
- End-to-end encryption (AES-256 + RSA)
- Message hashing for tamper detection
- Rate limiting and spam protection
- Message timestamps (sent, delivered, seen)
- Message replies, reactions, and deletion
- Redis caching for performance
- File scanning & sanitization
- Message statistics
- User blocking and muting
- Activity tracking
- Node.js & Express
- MongoDB for persistent storage
- Redis for caching and real-time features
- Socket.io for real-time communication
- Crypto for end-to-end encryption
POST /api/users/register- Register a new userPOST /api/users/block- Block a userPOST /api/users/unblock- Unblock a userPOST /api/users/mute- Mute a user
POST /api/messages/send- Send a messageGET /api/messages/:userId/:recipientId- Get chat historyPOST /api/messages/typing- Send typing indicatorPOST /api/messages/reply- Reply to a messagePOST /api/messages/react- React to a messagePOST /api/messages/delete- Delete a messagePOST /api/messages/schedule- Schedule a message
POST /api/groups/create- Create a new groupGET /api/groups/:groupId- Get group detailsPOST /api/groups/members/add- Add members to a groupPOST /api/groups/members/remove- Remove a member from a groupPOST /api/groups/settings- Update group settingsPOST /api/groups/members/role- Change a member's roleGET /api/groups/user/:userId- Get user's groupsPOST /api/groups/delete- Delete a group
POST /api/group-messages/send- Send a message to a groupGET /api/group-messages/:groupId- Get group messagesPOST /api/group-messages/react- React to a group messagePOST /api/group-messages/delete- Delete a group messagePOST /api/group-messages/status- Update message status
POST /api/communities/create- Create a new communityGET /api/communities/:communityId- Get community detailsPOST /api/communities/join- Join a communityPOST /api/communities/leave- Leave a communityPOST /api/communities/channel/create- Create a channelGET /api/communities/:communityId/channels- Get community channelsGET /api/communities/user/:userId- Get user's communities
POST /api/channel-messages/send- Send a message to a channelGET /api/channel-messages/:channelId- Get channel messagesPOST /api/channel-messages/pin- Pin a channel messageGET /api/channel-messages/:channelId/pinned- Get pinned messages
POST /api/statuses/create- Create a status updateGET /api/statuses/user/:userId- Get user's statusesGET /api/statuses/:statusId- Get status detailsPOST /api/statuses/delete- Delete a statusGET /api/statuses/:statusId/viewers- Get status viewers
POST /api/media/upload- Upload media fileGET /api/media/:fileId- Get media file
POST /api/status- Update message statusGET /api/status/:messageId- Get message status
GET /api/analytics/user/:userId- Get user statisticsGET /api/analytics/active-chats/:userId- Get active chatsGET /api/analytics/message-count/:userId- Get message count
- Clone the repository
- Copy
.env.exampleto.envand configure environment variables - Install dependencies:
npm install - Start MongoDB and Redis
- Run the server:
npm start
- All messages are end-to-end encrypted
- Files are scanned for malware
- Rate limiting prevents abuse
- Message integrity is verified with hashing
- Redis caching for fast message retrieval
- Efficient database indexing
- Scheduled cleanup jobs for expired content
- Optimized file storage and delivery
MIT