This is a Spring Boot based real-time chat messenger that utilizes WebSocket for instant messaging and RESTful APIs for user, session, and message management. The project follows a clean-code approach with structured exception handling, authentication, and API documentation.
- Real-time Communication: Uses WebSocket for real-time messaging.
- Message Broker: Currently uses Spring WebSocket default broker (planned upgrade to RabbitMQ).
- RESTful APIs: Provides structured endpoints for user, session, and message management.
- JWT Authentication: Secures APIs with JSON Web Tokens (JWT).
- Structured Response Format: Ensures a consistent API response structure.
- Exception Handling: Custom exception handling for better debugging.
- API Documentation: Integrated with SpringDoc Swagger for API documentation with examples.
- Clean Code & Simple Design: Well-commented and easy-to-understand code.
- User Management: Properly structured user handling.
- Session-based Communication: Each chat (between two users) operates using a session ID.
- Efficient Message Storage: Messages are stored as JSON objects instead of individual database records.
- Database Design:
MessageEntity
has a one-to-one relation withSessionEntity
.
- Frontend UI: Currently, this is a REST application with no UI; a front-end will be added.
- Database Security: Messages stored in JSON will be encrypted.
- Security Enhancements: Authentication and authorization mechanisms need further strengthening.
- Java 17
- Maven
- PostgreSQL/MySQL (Configured in
application.properties
) - Spring Boot 3.x
- Clone the repository:
git clone https://github.com/your-username/chat-messenger.git cd chat-messenger
- Configure database settings in
src/main/resources/application.properties
. - Build and run the application:
mvn clean install mvn spring-boot:run
- Access API documentation at:
http://localhost:9090/messenger-swagger
- Enable GitHub Codespaces on your repository.
- Open Codespaces and run the application using:
mvn spring-boot:run
- Expose ports if necessary to access APIs externally.
💬 Discussion Forum: GitHub Discussions
📧 Email: [email protected]
📱 Telegram: Morteze Mahdi zadeh's Telegram
📱 LinkedIn: Morteze Mahdi zadeh's LinkedIn
Feel free to fork, star, and contribute to this project! Follow best practices and submit PRs with clear documentation.
Happy Coding! 🚀