A real-time chat application built using Java Spring Boot, WebSockets, and Thymeleaf.
This project demonstrates bi-directional communication between the client and server, enabling instant message exchange without page reloads.
1️. Before Connection The user sees “Not Connected” indicator and disabled message input.
2️. After Connection Established Status changes to “Connected”, message box enabled.
3️. Real-Time Messaging Messages sent and received in real-time.
4. Spring Application The spring backend runs and launches frontend with the socket connection via stomp client
- Uses WebSocket protocol with STOMP (Simple Text Oriented Messaging Protocol).
- Allows users to send and receive messages instantly once connected to the server.
- Shows "Not Connected" before establishing the WebSocket connection.
- Dynamically changes to "Connected" once the connection is successfully established.
- Messages appear in real-time across all connected users’ browsers.
- Each user can send and receive messages instantly.
- Frontend uses Thymeleaf templates for dynamic rendering.
- Backend built with Spring Boot WebSocket support for message broadcasting.
| Layer | Technology | Description |
|---|---|---|
| Backend | Java, Spring Boot | REST + WebSocket-based backend for connection and message handling |
| Messaging | STOMP over WebSocket | Handles real-time message transmission |
| Frontend | HTML, CSS, JavaScript, Thymeleaf | Interactive UI with live message updates |
| Build Tool | Maven | Dependency management and build |
| Server | Embedded Tomcat (Spring Boot default) | Runs the WebSocket endpoint |
| Optional | Bootstrap (if used) | For styling and responsiveness |
- The client loads
chat.html. - On page load, a WebSocket connection is made to
/chat. - The user can then send messages, which are:
- Sent to the backend via STOMP.
- Broadcast to all connected clients.
- The status indicator and messages update dynamically on the page.





