Overview
The Chat Service is a real-time messaging backend enabling communication between Customers and Dentists. It provides WebSocket-based real-time messaging via Socket.IO, REST APIs for chat management, push notifications for offline users, and image sharing with secure S3 storage. The service supports horizontal scaling through Redis adapter for multi-instance deployments.
Quick Facts
- Tech Stack: Node.js 18+, TypeScript, Express.js, Socket.IO, PostgreSQL, MySQL (read-only), Redis, AWS S3
- Auth: AWS Cognito (customers), Django JWT (dentists)
- Push Notifications: OneSignal
- Repo:
Chat-Service
Key Capabilities
- Real-time messaging via Socket.IO with Redis adapter for scaling
- REST APIs for chat session management
- Image sharing with S3 presigned URLs
- Push notifications for offline users via OneSignal
- Horizontal scaling support with stateless design
- Dual database architecture (PostgreSQL for chat, MySQL for legacy user data)
Related Notes
Architecture
Purpose
The technical architecture of the Chat Service. Covers the system diagram, request flows, authentication model, WebSocket architecture, and deployment setup. Use this to understand how the system is structured and where components live.
Data Model
Purpose
The database schema and entity relationships for the Chat Service. Covers PostgreSQL tables (chat_sessions, chat_messages) and MySQL read-only tables (customers, dentists). Use this to understand the data structure before querying or extending the schema.
API Reference
Purpose
Complete API endpoint documentation and Socket.IO events for the Chat Service. Covers all REST routes, WebSocket events, request/response formats, and authentication requirements. Use this as a quick reference when integrating with the API.
Business Logic
Purpose
The core business rules and workflows of the Chat Service. Covers message sending flow, real-time broadcasting, push notification logic, and horizontal scaling patterns. Use this to understand the “why” behind the code before diving into implementation details.