A real-time messaging backend system built using Spring Boot, WebSocket, and MySQL.
Project: SerenChat Focus: Real-time messaging and user presence system.
Modern digital platforms rely heavily on instant communication systems.
Applications such as messaging platforms, collaboration tools, multiplayer applications, and live support systems require low latency message delivery.
Traditional HTTP communication follows a request–response model, which introduces delays and requires repeated polling.
Real-time systems solve this problem by establishing persistent connections, allowing servers to instantly push updates to connected clients.
This project explores how WebSocket-based architectures can enable efficient real-time messaging.
Building a real-time messaging system involves several challenges:
• maintaining persistent client-server connections • broadcasting messages to multiple users instantly • handling concurrent users efficiently • integrating persistent message storage
Designing a backend capable of supporting these features requires asynchronous communication mechanisms and efficient message routing.
User A (Browser)
↓
WebSocket Connection
↓
Spring Boot Messaging Endpoint
↓
Message Processing
↓
Broadcast Channel (/topic/messages)
↓
User B (Browser)
Messages are transmitted through persistent WebSocket connections, allowing instant updates across connected clients.
This architecture ensures low latency communication and seamless user experience.
| Technology | Purpose |
|---|---|
| Java | Backend programming language |
| Spring Boot | Backend framework |
| WebSocket | Real-time communication |
| Spring Data JPA | Database interaction |
| MySQL | Message storage |
| HTML / CSS | Chat interface |
| JavaScript | Client-side messaging |
real-time-chat-presence-backend-system
│
├── src
│ └── main
│ ├── java/com/khushi/realtime_messaging_backend
│ │
│ │ ├── config
│ │ │ └── WebSocketConfig.java
│ │ │
│ │ ├── controller
│ │ │ ├── ChatController.java
│ │ │ └── RealtimeChatController.java
│ │ │
│ │ ├── model
│ │ │ └── ChatMessage.java
│ │ │
│ │ ├── repository
│ │ │ └── ChatRepository.java
│ │ │
│ │ └── service
│ │ └── ChatService.java
│
├── resources
│ ├── static
│ │ └── index.html
│ └── application.properties
│
├── pom.xml
├── README.md
└── LICENSE
| Step | Action |
|---|---|
| 1 | User opens chat interface |
| 2 | WebSocket connection established |
| 3 | User sends message |
| 4 | Backend processes message |
| 5 | Message broadcast to all connected users |
Messages appear instantly in the chat interface without refreshing the page.
Initial implementation demonstrates how Spring Boot WebSocket architecture can efficiently support real-time communication.
However, several improvements can further enhance the system:
• improved user presence detection • optimized message routing • scalable WebSocket infrastructure
These observations highlight the importance of efficient backend design for real-time systems.
Possible extensions include:
• online user presence detection • typing indicators • private chat rooms • message timestamps • chat history retrieval • authentication system • deployment with cloud infrastructure
These additions would transform the project into a production-ready messaging platform.
git clone https://github.com/Khushisawalkar/Real-Time-Chat-Presence-Backend-System.git
CREATE DATABASE realtime_chat_db;
mvn spring-boot:run
The application will start at:
http://localhost:8080
Khushi Sawalkar
B.Tech — Electronics & Telecommunications Engineering Minor in Information Technology
Technical interests:
• Backend Systems • Real-Time Communication Architectures • Signal Processing • Embedded Systems
Projects:
• Arduino MP3 Player • Occupancy-Dependent Domestic Power Conservation System
This project is released under the MIT License.