ChatApp is a real-time group chat application built using Spring Boot for the backend and React for the frontend. It leverages WebSocket, STOMP, and SockJS for real-time messaging and MongoDB for data storage.
- Backend: Spring Boot, WebSocket , MongoDB
- Frontend: React.js
- Database: MongoDB
- Protocol: WebSocket
- Build Tools: Maven
- Version Control: Git & GitHub
✔️ Create and join chat rooms
✔️ Real-time messaging with WebSockets
✔️ Store chat history in MongoDB
✔️ User-friendly React UI
✔️ Scalable and efficient architecture
git clone https://github.com/yourusername/ChatApp.git
cd ChatApp- Navigate to the backend folder:
cd ChatAppBackend - Configure MongoDB in
application.properties:spring.data.mongodb.uri=mongodb://localhost:27017/chatapp - Run the Spring Boot application:
mvn spring-boot:run
- Navigate to the frontend folder:
cd ChatFrontend - Install dependencies:
npm install
- Start the React app:
npm start
- STOMP (Simple Text Oriented Messaging Protocol) is used for message communication.
- SockJS provides WebSocket fallback support.
- Spring Boot handles WebSocket connections through
@EnableWebSocketMessageBroker.
| Method | Endpoint | Description |
|---|---|---|
| POST | /chat/createRoom |
Create a new chat room |
| GET | /chat/rooms |
Get all chat rooms |
| POST | /chat/sendMessage |
Send a message in a room |
| GET | /chat/messages |
Retrieve chat history |
Feel free to fork this repo and submit PRs! Contributions are welcome. 🚀
MIT License.