Skip to content

codedbyshashi/realtimechatapplication

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🚀 Real-Time Chat Application with Spring Boot and WebSocket

📖 Description

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.

✨ Features

  1. Real-time messaging: Users can send and receive messages in real-time using WebSockets.
  2. Multi-user support: The application supports multiple users, allowing for group chats and private conversations.
  3. User authentication: Users must authenticate before joining a chat room.
  4. Chat rooms: Users can join and leave chat rooms as needed.
  5. Message persistence: All messages are stored in a database, allowing for persistence and retrieval.
  6. WebSockets: The application uses WebSockets to establish a bi-directional communication channel between the client and server.
  7. HTML5 and CSS3: The client-side uses HTML5 and CSS3 to create a user-friendly interface.
  8. JavaScript and WebSocket API: The client-side uses JavaScript and the WebSocket API to handle incoming and outgoing messages.

🧰 Tech Stack

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

📁 Project Structure

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

⚙️ How to Run

  1. Prerequisites: Java 17 and Maven 3.8.6 must be installed on your system.
  2. Build the application: Run the command mvn clean package in the terminal to build the application.
  3. Run the application: Run the command mvn spring-boot:run in the terminal to start the application.
  4. Access the application: Open a web browser and navigate to http://localhost:8080 to access the application.

🧪 Testing Instructions

  1. Testing: The application includes JUnit tests to ensure the functionality of the application.
  2. Testing environment: The testing environment is set up using the test profile in the pom.xml file.
  3. Run the tests: Run the command mvn test in the terminal to run the tests.

📸 Screenshots

[Insert screenshots of the application]

📦 API Reference

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

👤 Author

  • Name: [Your Name]
  • Email: [Your Email]

📝 License

  • 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! 🤝

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published