Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

💬 Distributed Chat System with Vector Clock Ordering

A real-time distributed chat system built using Node.js, Express, and Socket.IO, featuring vector clocks and FIFO buffering for message ordering. It includes a modern chat interface with support for text, emojis, image uploads, typing indicators, and dark mode.


🚀 Features

  • ✅ Real-time bi-directional chat via Socket.IO
  • Vector Clock and FIFO buffering for logical message ordering
  • ✅ Fully responsive web UI (HTML, CSS, JavaScript)
  • ✅ Send text messages, emoji stickers, and images(file upload route exists but frontend upload not enabled)
  • Typing indicator
  • Clear Chat feature
  • Light/Dark theme toggle
  • ✅ Random delay to simulate message reordering
  • 📎 File upload API exists but UI doesn't yet support selecting or uploading files

🛠️ Tech Stack

Layer Technology
Frontend HTML, CSS, JavaScript
Backend Node.js, Express, Socket.IO
Uploads Multer for image upload
Ordering Vector Clock & FIFO buffer (custom)

📁 Project Structure

distributed-chat/
│
├── client/                  # Frontend files
│   ├── index.html
│   └── script.js
│
├── server/                  # Backend files
│   ├── index.js
│   └── vectorClock.js
│
├── uploads/                 # Image uploads folder (auto-created)
│
├── package.json             # Project dependencies
└── package-lock.json        # Dependency versions lock

⚙️ Setup & Run Locally

1. Clone the repository

git clone https://github.com/your-username/distributed-chat.git
cd distributed-chat

2. Install dependencies

npm install

3. Create uploads/ folder (for storing image messages)

mkdir uploads

4. Start the server

node server/index.js

The server will start on:

http://localhost:3000

🌐 Access the Chat Interface


👥 Test Multi-User Messaging

  • Open the same URL in two different browser windows or two devices.
  • Try sending messages, images, stickers, and watch message ordering with Vector Clock and FIFO buffer logic in action.

📤 Deployment (Future)

You can deploy this app using platforms like:


📌 Notes

  • Make sure uploads/ is included in .gitignore — don't commit user-uploaded images.
  • package-lock.json ensures consistent installs — keep it committed.
  • Fully compatible with future enhancements like Vector Clock Visualization, Message Logging, or Database Integration.

👨‍💻 Authors


📄 License

This project is open-source and available under the MIT License.

About

A distributed chat system implementing Vector Clocks and FIFO message ordering using Socket.io and Express.js. Includes a real-time web interface with sticker support, file uploads, chat clearing, and multi-user coordination.

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages