Realtime Scalable Chat App screenshot 1

Realtime Scalable Chat App

About

Realtime Scalable Chat App is a full-stack chat application for one-to-one and group conversations. It uses a unified room model so both conversation types can share the same core messaging workflows.

Unified Room Model

Direct messages are represented as rooms containing two members. Group conversations use the same underlying room model, allowing direct messages and group chats to follow a consistent structure instead of requiring separate branching logic for each chat type.

Dual-Room Socket.IO Architecture

The Socket.IO architecture separates user-scoped events from chat-scoped events.

User-scoped events handle:

  • Presence
  • Unread counts
  • Inbox synchronization

Chat-scoped events handle chat communication.

This separation keeps user-level synchronization distinct from conversation-level communication and avoids branching between direct messages and group chats.

Full-Stack Implementation

The application was built with Next.js, Node.js, and Express.js. The implemented workflows include:

  • One-to-one chat
  • Group chat
  • Group administration controls
  • Unread message tracking

PostgreSQL, Redis, and Docker are part of the project technology stack.

Real-Time Presence

Real-time presence indicators use Redis-backed online and offline status updates. Redis handles these high-frequency presence updates so they do not require database lookups for each status change.

Load-Testing Results

The application was load tested with Artillery. These measurements describe the load-testing run and do not represent production traffic:

  • 1,200 concurrent WebSocket connections
  • 0 failures
  • 600 active users
  • More than 110 Socket.IO events per second
  • p99 server-side event-processing latency below 0.3 ms

Built by Rahul S