The Live Chat App is a real-time messaging application that allows users to communicate with each other instantly over the internet. It provides a seamless chat experience with features such as text messaging, emoji support, and user joining and leaving indicator.
- Live Project: Chat Now!
- Real-time Messaging: Messages are delivered instantly, providing a responsive chat experience.
- Emoji Support: Users can express themselves using a variety of emojis.
- User Status: Users can see a user joining or leaving.
- Frontend: HTML, CSS, JavaScript
- Backend: Spring Boot, Websocket
- Deployment: GitHub Actions, Azure
Here's a section you can add to your live chat documentation to explain WebSocket:
The live chat application utilizes the WebSocket API to enable real-time, bi-directional communication between the client's web browser and the server. This allows for instant messaging and updates without the need for continuous polling.
-
Connection Establishment: The client initiates a WebSocket connection by sending an initial HTTP request, which is then upgraded to a WebSocket connection if the server supports it.
-
Bi-Directional Communication: Once the WebSocket connection is established, both the client and server can send messages to each other at any time, enabling real-time updates and notifications.
-
Event-Driven Model: WebSocket uses an event-driven model, where messages are sent and received asynchronously, allowing for efficient communication without the overhead of traditional HTTP requests.
-
Persistent Connection: Unlike traditional HTTP, which is stateless and requires a new connection for each request, WebSocket maintains a persistent connection, reducing latency and overhead.
-
Protocol Support: WebSocket is standardized by the IETF as RFC 6455, ensuring compatibility between different WebSocket implementations and providing a reliable communication channel.
- Real-Time Updates: Enables instant messaging and updates without polling.
- Efficient Communication: Maintains a persistent connection for efficient, low-latency communication.
- Scalability: Supports large numbers of concurrent connections, making it suitable for scalable applications.
- Reliability: Built-in mechanisms for ensuring message delivery and connection integrity.
The live chat application uses the WebSocket API provided by the Spring Boot framework for server-side communication. On the client side, WebSocket is implemented using JavaScript and the WebSocket API supported by modern web browsers.
- Read more: WebSocket Documentation
- Clone the repository.
- Install dependencies using Maven:
mvn install. - Start the Spring Boot application:
mvn spring-boot:run. - Access the app in your web browser at
http://localhost:8080.
The app is automatically deployed using GitHub Actions to Azure. The deployment process is triggered on every push to the main branch.
- log in to the app using your name.
- Send messages and emojis to communicate with other users in real-time.
- File Sharing: Allow users to share files with each other.
- Message History: Provide a history of past messages for users to view.
- Onine Status: View the online status of other users.
- Fork the repository.
- Create a new branch (
git checkout -b feature/my-feature). - Commit your changes (
git commit -am 'Add new feature'). - Push to the branch (
git push origin feature/my-feature). - Create a new Pull Request.