A scalable real-time messaging system built using Socket.IO, Redis (Pub/Sub), Kafka, and PostgreSQL, designed to support distributed servers with reliable message delivery and persistent chat history. Managed with TurboRepo for monorepo orchestration and optimized development workflows. Hosted using Aiven's managed services.
This project follows a monorepo structure using TurboRepo to manage the different parts of the system efficiently. TurboRepo enables:
- 🌀 Fast builds and caching
- 📁 Clear workspace separation
- 🔁 Easier development across multiple packages (e.g., server, consumer, db)
- 🧱 Consistent dependency management
- 🔁 Real-time Messaging with WebSocket (Socket.IO)
- ⚡ Distributed Server Sync using Redis Pub/Sub
- 📨 Message Durability using Kafka
- 💾 Chat Persistence using PostgreSQL
- 📦 TurboRepo Monorepo structure
- ☁️ Managed Infra via Aiven (Redis, Kafka, Postgres)
| Tech | Purpose |
|---|---|
| TurboRepo | Monorepo management & task orchestration |
| Socket.IO | Real-time communication (WebSocket) |
| Redis (Aiven) | Pub/Sub for syncing distributed servers |
| Kafka (Aiven) | Reliable, fault-tolerant message streaming |
| PostgreSQL | Persistent chat storage |
| Node.js | Kafka consumer, socket server logic |

