Welcome to the Real-Time Chat Application! This project is a Spring Boot-based real-time chat application that enables users to send and receive messages in real-time using WebSockets. The application is designed to be scalable, secure, and easy to use.
The application consists of a Spring Boot web application that uses WebSockets to establish a bi-directional communication channel between the client and the server. The server-side uses Spring Boot's WebSocket support to handle incoming and outgoing messages. The client-side uses HTML, CSS, and JavaScript to create a user-friendly interface for users to send and receive messages.
- Real-time messaging: Users can send and receive messages in real-time using WebSockets.
- Multi-user support: The application supports multiple users, allowing for group chats and private conversations.
- User authentication: Users must authenticate before joining a chat room.
- Chat rooms: Users can join and leave chat rooms as needed.
- Message persistence: All messages are stored in a database, allowing for persistence and retrieval.
- WebSockets: The application uses WebSockets to establish a bi-directional communication channel between the client and server.
- HTML5 and CSS3: The client-side uses HTML5 and CSS3 to create a user-friendly interface.
- JavaScript and WebSocket API: The client-side uses JavaScript and the WebSocket API to handle incoming and outgoing messages.
Technology | Version |
---|---|
Spring Boot | 3.5.4 |
Java | 17 |
Maven | 3.8.6 |
HTML5 | 5.3.7 |
CSS3 | 5.3.7 |
JavaScript | ES6 |
WebSocket | 1.1 |
src/main/java
: Contains the Java source code for the application.com.chat.app
: The main package for the application.AppApplication.java
: The main application class.WebSocketConfig.java
: The WebSocket configuration class.ChatMessage.java
: The message class.ChatController.java
: The chat controller class.
src/main/resources
: Contains the application resources.static
: Contains the static HTML and CSS files.templates
: Contains the Thymeleaf templates.
pom.xml
: The Maven build file.
- Prerequisites: Java 17 and Maven 3.8.6 must be installed on your system.
- Build the application: Run the command
mvn clean package
in the terminal to build the application. - Run the application: Run the command
mvn spring-boot:run
in the terminal to start the application. - Access the application: Open a web browser and navigate to
http://localhost:8080
to access the application.
- Testing: The application includes JUnit tests to ensure the functionality of the application.
- Testing environment: The testing environment is set up using the
test
profile in thepom.xml
file. - Run the tests: Run the command
mvn test
in the terminal to run the tests.
[Insert screenshots of the application]
- API Endpoints: The application includes the following API endpoints:
/chat
: The chat endpoint for sending and receiving messages./join
: The join endpoint for joining a chat room./leave
: The leave endpoint for leaving a chat room.
- API Methods: The application includes the following API methods:
POST /chat
: Sends a message to a chat room.GET /join
: Joins a chat room.GET /leave
: Leaves a chat room.
- Name: [Your Name]
- Email: [Your Email]
- License: The application is licensed under the MIT License.
- Copyright: Copyright [Your Name] 2023.
I hope this README helps you understand the Real-Time Chat Application with Spring Boot and WebSocket. If you have any questions or need further assistance, please don't hesitate to reach out! 🤝