Connect Instantly, Communicate Securely, Empower Collaboration
Watch the full walkthrough and technical explanation of WhatsChat on YouTube:
WhatsChat is a web app platform, for peer-to-peer communication built with Node.js, Express, and Socket.io. It supports:
- 🔄 Instant messaging (WebSocket)
- 🔐 Peer authentication
- 🧩 File sharing (with previews, version control, and sync)
- 💬 Chat with text message or voice, emojis, attachment
- 🛠️ Hybrid P2P + Central Server architecture
Ideal for learning real-time systems, secure communication, and collaborative applications.
- Node.js
- Express.js
- Socket.io
- JavaScript / HTML / CSS
- JSON
- Markdown
- Overview
- Features
- Getting Started
- Prerequisites
- Installation
- Usage
- Testing
- Project Structure
- Future Enhancements
- License
- ✅ Communication via WebSockets
- ✅ Encrypted Message transfers
- ✅ File version control & preview before download
- ✅ Chat with text, emojis, and file support
- ✅ Peer authentication using password or key
- ✅ Auto messages file sync and file history
- ✅ Peer can act as both client and server
Ensure the following are installed:
Follow the steps to install and run WhatsChat Locally:
- Clone the repository
git clone https://github.com/Usama-Codez/WhatsChat
- Navigate to the project directory
cd WhatsChat
- Install dependencies
npm install
Start the server:
npm start
Peers can join using default address:
http://localhost:3000
WhatsChat uses Mocha and Chai for testing.
Run tests using:
npm test
WhatsChat ensures secure communication by encrypting:
-
Chat messages
-
User authentication tokens
Encryption Features:
-
End-to-end encryption between peers. For encryption I have used AES and RSA algorithms combination.
-
Decryption is automatically done on the receiving side
Unauthorized access is denied without proper key exchange
🔎 You can find the encryption logic in:
utils/
├── encryption.js # Core encryption/decryption logic
├── auth.js # Key exchange and peer validation
🧠 More detailed explanation is available in the video demo: 🔗 Watch encryption explained ->
-
🔐 End-to-End Encryption for text messages
-
🔑 Peer Authentication before each connection
-
🛡️ Multi-Factor Authentication (future enhancement)
-
🕵️♂️ Intrusion Detection System for file flooding (planned)
- Load Balancing via central server
- Failover backup server
- Peer metrics dashboard
- File integrity verification with hashes
This project is licensed under the MIT License - see the LICENSE file for details.
Pull requests are welcome! For major changes, please open an issue first to discuss what you would like to change.