A real-time chat application built with Spring Boot for the backend and Java Swing for the desktop client. This project demonstrates the use of WebSockets with STOMP protocol for bidirectional communication.
- Real-time Messaging: Send and receive messages instantly.
- Active Users List: See who is currently connected to the chat.
- User Notifications: Get notified when users join or leave the chat.
- Graphical User Interface: A clean and responsive desktop client built with Java Swing.
- Java 21
- Spring Boot (WebSockets, Messaging)
- STOMP Protocol (via SockJS)
- Java Swing (Client UI)
- Maven (Build Tool)
- Java Development Kit (JDK) 21 or higher installed.
- Maven (optional, as the project includes the Maven Wrapper).
-
Clone the repository:
git clone <repository-url> cd chat-system/chat_system
-
Build the project:
./mvnw clean install
Run the Spring Boot application to start the WebSocket server:
./mvnw spring-boot:runThe server will start on port 8080.
The client is a Java Swing application. You can run it from your IDE (run com.example.chat_system.client.App) or by executing the compiled class.
If you want to run multiple clients to test the chat features, simply run the client application multiple times. Each instance will ask for a username.
- Start the server.
- Launch the client application.
- Enter a username when prompted.
- Start chatting! You can open multiple client windows to simulate a conversation between different users.
src/main/java/com/example/chat_system: Contains the Spring Boot server code (WebSocketConfig,WebSocketController).src/main/java/com/example/chat_system/client: Contains the Swing client code (ClientGUI,MyStompClient).

