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.
- ✅ 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
| Layer | Technology |
|---|---|
| Frontend | HTML, CSS, JavaScript |
| Backend | Node.js, Express, Socket.IO |
| Uploads | Multer for image upload |
| Ordering | Vector Clock & FIFO buffer (custom) |
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
git clone https://github.com/your-username/distributed-chat.git
cd distributed-chatnpm installmkdir uploadsnode server/index.jsThe server will start on:
http://localhost:3000
-
Open your browser and go to:
http://localhost:3000 -
Enter a username to join the chat.
- 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.
You can deploy this app using platforms like:
- Render
- Railway
- Vercel + API proxy setup
- Or use dev tunnels / ngrok for sharing your localhost.
- Make sure
uploads/is included in.gitignore— don't commit user-uploaded images. package-lock.jsonensures consistent installs — keep it committed.- Fully compatible with future enhancements like Vector Clock Visualization, Message Logging, or Database Integration.
- Kasinadhan S
GitHub Profile - Pranav P
GitHub Profile - Adithya Krishna
GitHub Profile - Bharadwaj Kesav
GitHub Profile
This project is open-source and available under the MIT License.