Skip to content

eediallo/live-chat-app

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

456 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Live Chat Application

This project is a comprehensive implementation of a live chat application, showcasing three different approaches to real-time communication. Each approach is organized into its own folder, as described below:

Project Structure

1. long-polling

This folder contains the implementation of a live chat application using the long-polling technique. Long-polling is a method where the client repeatedly polls the server for updates, creating a near real-time experience. While functional, this approach is less efficient compared to WebSocket-based solutions.

2. webSocket-without-auth

This folder demonstrates a live chat application using WebSocket technology, but without any authentication mechanism. WebSockets provide a full-duplex communication channel over a single TCP connection, enabling real-time communication between the client and server. However, the lack of authentication in this implementation makes it unsuitable for secure or sensitive applications.

3. webSocket

This is the most advanced and secure implementation of the live chat application. It uses WebSocket technology along with authentication to ensure secure communication. This folder includes both backend and frontend components, with features such as:

  • Authentication: Users must log in or register to access the chat functionality.
  • Error Handling: Comprehensive error handling for a robust user experience.
  • Real-Time Messaging: Leveraging WebSocket for instant message delivery.
  • Frontend Design: A user-friendly interface with responsive design for various screen sizes.

The webSocket folder is the recommended implementation for production use, as it combines the efficiency of WebSocket with the security of authentication.

How to Run

  1. Navigate to the desired folder (long-polling, webSocket-without-auth, or webSocket).
  2. Install dependencies by running npm install in the backend directory.
  3. Start the backend server using node app.js.
  4. Open the corresponding frontend HTML files in a browser to interact with the application.

Key Features

  • Long-Polling: Basic real-time communication.
  • WebSocket Without Authentication: Efficient real-time communication without security.
  • WebSocket With Authentication: Secure and efficient real-time communication.

Recommended Usage

For secure and scalable applications, use the webSocket implementation. It provides the best balance of performance and security, making it suitable for real-world deployment.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published