A real-time chat application that allows multiple users to communicate over a network using WebSockets. This project implements multithreading to efficiently handle multiple users while maintaining smooth communication.
- Send and receive messages between multiple users.
- Real-time communication using WebSockets.
- Implements multithreading to efficiently handle multiple users.
- Non-blocking architecture using Node.js and Worker Threads.
- Networking: WebSockets for real-time data transmission.
- Multithreading: Worker threads to manage multiple users concurrently.
- Event-driven Architecture: Asynchronous handling of connections.
Run the following command:
git clone https://github.com/Gayatrisin123/WebTalker
cd WebTalkerRun the necessary command to install project dependencies:
npm installExecute the command to start the server:
node server.jsVisit the following URL in multiple tabs to simulate multiple users:
http://localhost:3000
The server initializes WebSockets and creates a worker thread for each connected user. It listens for messages, processes them, and broadcasts them to other users while maintaining efficient performance through multithreading.
Each worker thread handles individual users to ensure efficient message processing. It manages user connections, processes messages, and ensures smooth real-time communication.
- Users connect to the server via WebSockets.
- The server listens for messages and assigns worker threads for handling them.
- Messages are processed and broadcasted to other connected users.
- Each user is assigned a worker thread, ensuring smooth handling of multiple connections.
- The main server only manages connections, while worker threads process messages.
- The application listens for events such as user messages and disconnections.
- Each event is processed asynchronously, preventing blocking operations.
- Implement private messaging between users.
- Add user authentication (Login & Register pages using React Router).
- Store chat history using a database (MongoDB, MySQL, etc.).
- Improve UI using React.js & Tailwind CSS.
This project is open-source and available under the MIT License.