Skip to content

MrGidor/P2PChat

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Peer 2 Peer Chat (P2PChat)

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.

image

🚀 What is this?

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.


✨ Features

  • 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

🧭 Best Use Cases

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)

🔒 Privacy Model

  • 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.


🧱 Architecture

  • 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

📦 Features

  • Local config system
  • Local message history (JSONL)
  • Local identity persistence
  • Decentralized peer discovery
  • Hybrid direct + signaling-based connectivity

🧪 Example Commands

/setname Gidor
/addpeer Kazi 127.0.0.1 5000
/connect Kazi
/list

🧭 Future Plans

  • 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

⚠️ Status

This project is in active development and is intended for experimental / learning purposes.

Expect breaking changes.


💡 Philosophy

P2PChat is built around a simple idea:

Communication should work without trusting a central server.

About

A Lightweight peer-to-peer terminal-based chat application with optional signaling server support for easier discovery and connection handling. Supports direct messaging, whisper mode, and basic group chat functionality.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Contributors