Real-time Chat Architecture
WebSocket-based chat system with presence tracking, message persistence, and file upload support.
Services
- WebSocket Gateway (api_gateway) — Manages WebSocket connections and routing — Node.js, ws
- Chat Service (service) — Handles message delivery and channel management — Node.js, TypeScript
- Presence Service (service) — Tracks online/offline user status — Go
- Redis PubSub (queue) — Distributes messages across server instances — Redis
- PostgreSQL (database) — Stores message history and user data — PostgreSQL
- S3 (external) — Stores uploaded files and media — AWS S3
Connections
- WebSocket Gateway → Chat Service (sync_http)
- WebSocket Gateway → Presence Service (sync_http)
- Chat Service → Redis PubSub (async_event)
- Presence Service → Redis PubSub (async_event)
- Chat Service → PostgreSQL (db_access)
- Chat Service → S3 (sync_http)