Real-time chat application




This is a full-stack real-time messaging application built with a modern, scalable architecture. The system supports one-to-one personal chats, group messaging with channels, and real-time features like typing indicators, read receipts, and online/offline status.
Messages go through a "temporary" state before being persisted to the database. This dual-state approach optimizes user experience by showing messages immediately while ensuring data consistency.
The system uses RabbitMQ to distribute real-time events across multiple Socket.IO servers, enabling horizontal scaling.
A distributed presence system using Memcached stores active user sessions across all servers, allowing accurate status updates.
Three-stage receipt system:
Navigate through these sections to understand different aspects of the system:
To understand the system:
For implementation details, each section includes code examples and diagrams.
This documentation represents an evolving project. The implementations are based on pragmatic decisions as of 2025. Different approaches exist, and constructive criticism is welcome. The goal is to create a maintainable, scalable, and understandable codebase that demonstrates best practices in real-time application design.