Skip to content

About

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.

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

32 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 

Repository files navigation

Chat System

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.

Features

  • 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.

Technologies Used

  • Java 21
  • Spring Boot (WebSockets, Messaging)
  • STOMP Protocol (via SockJS)
  • Java Swing (Client UI)
  • Maven (Build Tool)

Getting Started

Prerequisites

  • Java Development Kit (JDK) 21 or higher installed.
  • Maven (optional, as the project includes the Maven Wrapper).

Installation

  1. Clone the repository:

    git clone <repository-url>
    cd chat-system/chat_system
  2. Build the project:

    ./mvnw clean install

Running the Application

1. Start the Server

Run the Spring Boot application to start the WebSocket server:

./mvnw spring-boot:run

The server will start on port 8080.

2. Start the Client

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.

Usage

  1. Start the server.
  2. Launch the client application.
  3. Enter a username when prompted.
  4. Start chatting! You can open multiple client windows to simulate a conversation between different users.

Project Structure

  • 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).

Screenshots

Screenshot 1

Screenshot 2

About

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.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages