{"id":27282722,"url":"https://github.com/dwivedikirtiman/real-time-chatapplication","last_synced_at":"2025-04-11T18:16:13.011Z","repository":{"id":284224401,"uuid":"954225639","full_name":"dwivedikirtiman/Real-Time-ChatApplication","owner":"dwivedikirtiman","description":"This is a powerful Real-Time Chat Application built with Spring Boot and WebSockets. It enables seamless communication between multiple users using STOMP (Simple Text Oriented Messaging Protocol) and SockJS for enhanced compatibility with various browsers. The app is designed to deliver fast, responsive, and interactive messaging.","archived":false,"fork":false,"pushed_at":"2025-03-24T19:24:55.000Z","size":18,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-11T18:16:08.095Z","etag":null,"topics":["bootstrap","css","html5","spring-boot","stomp","websocket"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dwivedikirtiman.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-03-24T18:49:08.000Z","updated_at":"2025-03-26T15:29:56.000Z","dependencies_parsed_at":"2025-03-24T20:39:31.222Z","dependency_job_id":null,"html_url":"https://github.com/dwivedikirtiman/Real-Time-ChatApplication","commit_stats":null,"previous_names":["dwivedikirtiman/real-time-chatapplication"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dwivedikirtiman%2FReal-Time-ChatApplication","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dwivedikirtiman%2FReal-Time-ChatApplication/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dwivedikirtiman%2FReal-Time-ChatApplication/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dwivedikirtiman%2FReal-Time-ChatApplication/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dwivedikirtiman","download_url":"https://codeload.github.com/dwivedikirtiman/Real-Time-ChatApplication/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248456368,"owners_count":21106604,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bootstrap","css","html5","spring-boot","stomp","websocket"],"created_at":"2025-04-11T18:16:12.038Z","updated_at":"2025-04-11T18:16:12.896Z","avatar_url":"https://github.com/dwivedikirtiman.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"## 📱 Real-Time Spring Boot Chat Application\n\n🚀 Overview\n\nThis is a powerful Real-Time Chat Application built with Spring Boot and WebSockets. It enables seamless communication between multiple users using STOMP (Simple Text Oriented Messaging Protocol) and SockJS for enhanced compatibility with various browsers. The app is designed to deliver fast, responsive, and interactive messaging.\n\n## 🧩 Key Technologies Used\n\n- Java 21 with Spring Boot\n\n- WebSocket \u0026 STOMP for real-time communication\n\n- SockJS for fallback compatibility\n\n- HTML5, CSS3, and Bootstrap for UI design\n\n# 📂 Project Structure\n\n![image](https://github.com/user-attachments/assets/911aac36-037d-4976-85db-c807e15e3f50)\n\n## ⚙️ Setup Instructions\n\nFollow these steps to run the application on your local machine:\n\n1 - Clone the Repository:\n```\n   git clone https://github.com/dwivedikirtiman/Real-Time-ChatApplication.git\n```\n2 - Navigate to Project Directory:\n```\n   cd app\n```\n\n3- Configure Dependencies\n\nEnsure your pom.xml has these necessary following dependencies:\n\n ```\n    \u003cdependency\u003e\n      \u003cgroupId\u003eorg.springframework.boot\u003c/groupId\u003e\n      \u003cartifactId\u003espring-boot-starter-websocket\u003c/artifactId\u003e\n    \u003c/dependency\u003e\n    \u003cdependency\u003e\n      \u003cgroupId\u003eorg.webjars\u003c/groupId\u003e\n      \u003cartifactId\u003esockjs-client\u003c/artifactId\u003e\n      \u003cversion\u003e1.5.1\u003c/version\u003e\n    \u003c/dependency\u003e\n    \u003cdependency\u003e\n      \u003cgroupId\u003eorg.webjars\u003c/groupId\u003e\n      \u003cartifactId\u003estomp-websocket\u003c/artifactId\u003e\n      \u003cversion\u003e2.3.3\u003c/version\u003e\n    \u003c/dependency\u003e\n```\n\n4 - Build the Project:\n```\n./mvnw clean install\n```\n\n5 - Run the Application:\n```\n./mvnw spring-boot:run\n```\n\n6 - Access the Application:\n\nOpen ```http://localhost:8080/chat``` in your browser.\n\n## 🔥 Features\n\n✅ Real-time messaging using WebSocket and STOMP.\n\n✅ Lightweight UI with Bootstrap for responsive design.\n\n✅ Automatic message updates with smooth auto-scrolling.\n\n✅ Error handling with meaningful alerts for user guidance.\n\n✅ Fallback support for browsers that do not support WebSocket using SockJS.\n\n## 🔍 Technical Breakdown\n\n- ```WebSocketConfig.java``` — Configures WebSocket endpoints and message broker settings.\n\n- ```WebSocketController.java``` — Manages incoming and outgoing messages via WebSocket channels.\n\n- ```ChatMessage.java``` — Data model for handling chat messages.\n\n- ```chat.html``` — The front-end interface for real-time chat functionality.\n\n- SockJS \u0026 STOMP — Ensures compatibility with older browsers and reliable messaging protocols.\n\n\n## 🧑‍💻 Code Highlights/Code Snippets\n\n- WebSocketConfig.java (Core WebSocket Configuration)\n\n```\n@Configuration\n@EnableWebSocketMessageBroker\npublic class WebSocketConfig implements WebSocketMessageBrokerConfigurer {\n\n    @Override\n    public void registerStompEndpoints(StompEndpointRegistry registry) {\n        registry.addEndpoint(\"/chat\")\n                .setAllowedOrigins(\"http://localhost:8080\")\n                .withSockJS();\n    }\n\n    @Override\n    public void configureMessageBroker(MessageBrokerRegistry registry) {\n        registry.enableSimpleBroker(\"/topic\");\n        registry.setApplicationDestinationPrefixes(\"/app\");\n    }\n}\n\n```\n\n- WebSocketController.java (Handles Real-time Messaging)\n\n```\n@Controller\npublic class WebSocketController {\n\n    @MessageMapping(\"/sendMessage\")\n    @SendTo(\"/topic/messages\")\n    public ChatMessage sendMessage(ChatMessage message) {\n        System.out.println(\"Received from Client: \" + message.getSender() + \": \" + message.getContent());\n        return message;\n    }\n}\n\n```\n\n- chat.html (User Interface)\n\n```\n\u003cdiv class=\"input-group mb-3\"\u003e\n    \u003cinput id=\"messageInput\" type=\"text\" class=\"form-control\" placeholder=\"Type your message...\" /\u003e\n    \u003cdiv id=\"input-group-append\"\u003e\n        \u003cbutton id=\"sendMessage\" class=\"btn btn-primary\"\u003eSend\u003c/button\u003e\n    \u003c/div\u003e\n\u003c/div\u003e\n\n```\n\n## Screenshots/Output \n\n- Some of the screenshots of the projects is as follows-\n\nUser1\n![image](https://github.com/user-attachments/assets/2ec99d61-2250-4b52-867b-2b9195fe1d77)\n\nUser2\n![image](https://github.com/user-attachments/assets/6360ccc7-0f88-4bfd-b78c-e93becb50283)\n\nUser3\n![image](https://github.com/user-attachments/assets/fd935a86-455b-4328-93bb-8ab19b4e747c)\n\nReal-Time Concurrent Screens of all the involved users in the communication\n![image](https://github.com/user-attachments/assets/eb8a0120-6f52-4050-b7a9-d990095c6de1)\n\n\n## 📈 Future Improvements (Optional/Suggestions)\n\n🔹 Add user authentication for enhanced security.\n\n🔹 Implement chat room functionality for group conversations.\n\n🔹 Improve UI with animations and enhanced styling.\n\n\n## 🤝 Contribution\n\nContributions are welcome! If you'd like to improve this project, please follow these steps:\n\n- Fork the repository.\n\n- Create a new branch: ```git checkout -b feature/your-feature-name```\n\n- Commit your changes: ```git commit -m 'Add new feature'```\n\n- Push to your branch: ```git push origin feature/your-feature-name```\n\n- Submit a pull request.\n\n## 📜 License\n\nThis project is licensed under the MIT License.\n\n## 👨‍💻 Author\n\n**[Kirtiman Dwivedi]**\n\nGitHub: https://github.com/dwivedikirtiman\n\nEmail: [dwivedikirtiman000@gmail.com]\n\nLet’s connect—I’d love to hear your feedback! 🚀\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdwivedikirtiman%2Freal-time-chatapplication","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdwivedikirtiman%2Freal-time-chatapplication","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdwivedikirtiman%2Freal-time-chatapplication/lists"}