A lightweight peer-to-peer chat system built for local-first communication with optional signaling server support. Messages are stored locally, connections are direct, and no central server is required for communication.
P2PChat is a decentralized chat application designed for:
- direct user-to-user messaging over LAN or internet
- group communication without a central backend
- local message persistence and identity storage
It can work fully peer-to-peer, or optionally use a signaling server to help peers discover each other behind NAT/firewalls.
- Peer-to-peer direct messaging
- Group chat support
- Local message history (JSONL-based)
- Persistent identity storage (userId + username)
- Optional signaling server for NAT traversal assistance
- Decentralized architecture (no required central backend)
- CLI-based interface with commands
P2PChat is ideal for:
- Hackerspaces & developer clubs
- College or LAN group communication
- Friends-only private chats (fully local use)
- Privacy-focused experimental communities
- Chatting across NAT/firewalls (with signaling server enabled)
- No cloud storage
- No centralized message database
- Messages are stored locally per device
- Identity is generated and stored locally
- Network connections are direct peer connections
Note: End-to-end encryption is planned but not yet fully integrated.
- NetworkLayer → Handles peer connections and messaging
- SessionManager → Tracks peers and sessions
- GroupManager → Manages group state
- MessageHistory → Local JSONL storage
- SignalingClient → Optional peer discovery
- CLI (readline) → Command interface
- Local config system
- Local message history (JSONL)
- Local identity persistence
- Decentralized peer discovery
- Hybrid direct + signaling-based connectivity
/setname Gidor
/addpeer Kazi 127.0.0.1 5000
/connect Kazi
/list- End-to-end encryption (public/private key system already in progress)
- Improved CLI UX and command system
- Better message buffering + sync stability
- UPnP support for automatic port forwarding
This project is in active development and is intended for experimental / learning purposes.
Expect breaking changes.
P2PChat is built around a simple idea:
Communication should work without trusting a central server.