A scalable chat application designed to support a billion users, built with Java.
This application follows a microservices architecture to ensure scalability, reliability, and maintainability:
- API Gateway: Entry point for all client requests, handles authentication, rate limiting, and request routing
- User Service: Manages user accounts, profiles, and authentication
- Chat Service: Handles message processing and delivery
- Presence Service: Tracks online/offline status of users
- Notification Service: Manages push notifications
- Media Service: Handles file sharing and media processing
- Backend: Java, Spring Boot, Spring Cloud
- Messaging: Apache Kafka, WebSockets
- Databases: PostgreSQL (user data), Cassandra (messages), Redis (caching)
- Deployment: Docker, Kubernetes
- Monitoring: Prometheus, Grafana
- Horizontal scaling of stateless services
- Database sharding and partitioning
- Multi-level caching
- Asynchronous processing
- Load balancing
- Java 17+
- Maven 3.8+
- Docker and Docker Compose
- Clone the repository
- Run
mvn clean installto build all services - Use Docker Compose to start the development environment:
docker-compose up
├── api-gateway/ # API Gateway service
├── user-service/ # User management service
├── chat-service/ # Message handling service
├── presence-service/ # Online status tracking service
├── notification-service/ # Push notification service
├── media-service/ # File and media handling service
├── common/ # Shared libraries and utilities
└── docker/ # Docker configuration files
- Real-time messaging with WebSockets
- End-to-end encryption
- Group chats and channels
- Media sharing
- Message persistence
- Offline message delivery
- Read receipts
- Typing indicators
- Connection pooling
- Message batching
- Lazy loading of chat history
- Efficient data serialization
- Optimized database queries
- End-to-end encryption
- TLS for all communications
- Rate limiting to prevent abuse
- Input validation and sanitization
- Regular security audits
Saurabh Kushwaha
🔗 Portfolio
📧 Saurabh@wearl.co.in
🔗 LinkedIn
🔗 Instagram Dev Page
This project is licensed under the MIT License.