ChatUp is a modern, real-time chat application built with Spring Boot and WebSocket technology. It provides a seamless messaging experience with a clean, responsive user interface. This application demonstrates the implementation of real-time communication using WebSockets in a Java Spring Boot environment.
- Real-time Messaging: Instant message delivery using WebSocket technology
- User Presence: Automatic join/leave notifications when users enter or exit the chat
- Message History: View all messages exchanged in the current session
- Colorful User Avatars: Automatically generated colorful avatars based on usernames
- User-friendly Notifications: System messages for user activity
- Responsive Design: Fully responsive layout that works on desktops, tablets, and mobile devices
- Modern UI Components: Clean and intuitive user interface with well-designed components
- Visual Message Distinction: Self messages appear on the right (blue), and others' messages on the left (gray)
- Message Styling: Bubble-style chat messages with avatar icons
- Empty State Handling: Helpful message when no messages are present
- Connection Status: Visual feedback during WebSocket connection
- WebSocket Implementation: Uses STOMP protocol over WebSocket for reliable messaging
- Spring MVC Architecture: Well-structured application using Spring MVC design patterns
- Event-driven Communication: Backend event listeners for WebSocket connections/disconnections
- CSS Variables: Theme-based styling with CSS custom properties for easy customization
- Cross-browser Compatibility: Works on all modern browsers
- Java 17: Modern Java language features
- Spring Boot: Rapid application development framework
- Spring WebSocket: WebSocket integration with Spring
- STOMP Protocol: Simple Text Oriented Messaging Protocol
- SLF4J: Simple Logging Facade for Java
- HTML5: Semantic markup
- CSS3: Modern styling with custom properties and flexbox/grid
- JavaScript (ES6+): Modern JavaScript with ES6+ features
- SockJS: WebSocket emulation for browsers without WebSocket support
- STOMP.js: STOMP client for JavaScript
- Docker: Containerization for consistent deployment
- Render: Cloud platform for hosting the application
- Java JDK 17 or higher
- Maven 3.6.0 or higher
- Git
- Docker (optional for containerized deployment)
-
Clone the repository:
git clone https://github.com/HassanYosuf/chatup.git cd chatup -
Build the application:
./mvnw clean install
-
Run the application:
./mvnw spring-boot:run
-
Access the application: Open your browser and navigate to
http://localhost:8080
-
Create a new Web Service on Render:
- Connect your GitHub repository
- Select "Docker" as the environment
- Choose the appropriate instance type (at least 512MB RAM recommended)
- Set the "Port" environment variable to match the port in your application (default: 8080)
-
Configure environment variables (if needed):
- Add any custom environment variables required by your application
-
Deploy:
- Click "Create Web Service" and Render will automatically build and deploy your application
- Access your application at the URL provided by Render
- WebSocket Configuration: The application configures WebSocket endpoints and message brokers.
- User Connection: Users enter their names to join the chat room.
- WebSocket Connection: Upon joining, a WebSocket connection is established.
- Message Exchange: Messages are exchanged via the STOMP protocol over WebSocket.
- Event Handling: The application handles user join/leave events and broadcasts them to all users.
- Real-time Updates: Messages appear instantly for all connected users.
Dockerfile: Configuration for containerizing the applicationsrc/main/java/com/chatup/chatup/Config/WebSocketConfig.java: WebSocket configurationsrc/main/java/com/chatup/chatup/Controller/: Contains controllers for handling WebSocket communicationssrc/main/resources/static/: Frontend resources including HTML, CSS, and JavaScriptsrc/main/resources/application.properties: Application configuration
Contributions are welcome! Please feel free to submit a Pull Request.





