IChat is a peer-to-peer chat app built entirely with HTML, CSS, and JavaScript, allowing users to connect and chat directly using unique 6-digit IDs β no servers, accounts, or installations required.
- π Peer-to-Peer Messaging powered by PeerJS
- π 6-Digit Unique IDs (auto-generated or saved via cookies)
- πΎ Local Chat History with save and load support
- π ID Book to store known peers, nicknames, and last contact time
- π Mute Peer option to silence incoming messages
- π¬ Incoming Connection Alerts (accept or reject)
- πͺ Cookie Consent System to control ID persistence
- π Copy & Regenerate ID buttons
- π Fully Client-Side β no backend required
- π± Mobile-Friendly Responsive UI
IChat uses PeerJS and WebRTC to establish direct browser-to-browser connections.
Each user gets a 6-digit random ID, which can be shared to start chatting.
When a connection is made:
- Both peers establish a WebRTC data channel using PeerJS.
- Messages are sent directly between browsers (no central server).
- Chat history and IDs are stored locally in the browserβs
localStorageand cookies.
| File | Description |
|---|---|
IChat.html |
The complete single-file app containing HTML, CSS, and JavaScript. |
- Open
IChat.htmlin your web browser. - Accept cookies (optional, for persistent ID).
- Share your 6-digit ID with another user.
- Enter their ID in the βEnter peerβs 6-digit IDβ field.
- Click Connect to start chatting instantly.
| Key | Purpose |
|---|---|
peerjs_chat_id |
Saves your generated ID for reuse |
peerjs-chat-history |
Stores all saved chat sessions |
peerjs-current-chat |
Keeps your ongoing chat in progress |
peerjs_id_book |
Stores known peers and nicknames |
- 100% peer-to-peer β data is never uploaded to a server.
- Cookies are used only for ID persistence and preferences.
- You can decline cookies to use a temporary session-only ID.
- All data (messages, peers, history) remains on your local device.
- HTML5
- CSS3
- JavaScript (ES6)
- PeerJS (CDN)
- WebRTC (built-in browser technology)
- ποΈ Add voice and video chat via PeerJS media streams
- π Implement file transfer between peers
- π Add end-to-end message encryption
- π¬ Support multiple simultaneous chats
- βοΈ Optional cloud sync for chat logs
- Project Name: IChat
- Author: IdeiGeniale
- Version: 1.0
- License: MIT
- Type: Vanilla Web App
- Built with β€οΈ using PeerJS and pure web technologies
- Created by IdeiGeniale