Real-Time Chat Application
Horizontally scalable chat experience with Redis pub/sub fan-out, fine-grained channel permissions, and encrypted message storage. Includes presence indicators, file delivery, and long-term archival.
ReactSocket.ioExpressMongoDBRedisAWS S3

Real-Time Chat Application
A horizontally scalable messaging platform tuned for high concurrency and persistent messaging.
Key Features
- Group and direct channels, each with granular permission policies.
- Typing indicators, read receipts, and presence tracking backed by Redis.
- File and media sharing routed through signed AWS S3 URLs.
- Searchable history with message retention controls per workspace.
Architecture Overview
Messages are published through a gateway using WebSockets. Redis pub/sub fans updates out to workers that handle persistence in MongoDB. Background jobs archive older messages to S3 and keep the search index fresh.
Local Development
- terminal
pnpm install - Copy toterminal
.env.exampleand configure Redis, MongoDB, and S3 credentials.terminal.env - Run to start both the API and client using turborepo pipelines.terminal
pnpm dev
Deployment Tips
- Scale horizontally by increasing the number of API pods; sticky sessions are not required thanks to Redis.
- Enable autoscaling alerts to detect spikes in fan-out operations.
- Rotate encryption keys regularly; the key schedule is handled by AWS KMS.
Project Links
Highlights
- Group and direct channels with role permissions
- File and media sharing with signed URLs
- Typing indicators, read receipts, and presence
- Message search across archives
- Observability dashboards for ops
Key Challenge
Balanced horizontal scaling with consistent ordering by leveraging Redis streams for message fan-out.