Skip to content

thesumedh/TerminalTalk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

5 Commits
ย 
ย 

Repository files navigation

# ๐Ÿ›ฐ๏ธ P2PChat โ€” A Peer-to-Peer Encrypted Terminal Chat App

P2PChat is a **fully peer-to-peer, end-to-end encrypted terminal-based chat app** with no servers, no accounts, and no data collection โ€” just raw sockets, passwords, and secure communication.

---

## ๐Ÿ”ง Key Features

- ๐Ÿง‘โ€๐Ÿ’ป **Host-based Rooms**: One user creates a room and shares an invite code in the format: `IP:PORT#password`
- ๐Ÿ”‘ **Join with Invite Code**: Others join the chat room using that invite code
- โ˜๏ธ **No Central Server**: No cloud or server dependency โ€” 100% peer-to-peer
- ๐Ÿ“ฎ **Manual IP & Port Entry**: Allows advanced users to connect directly
- ๐ŸŽ“ **.edu Email-Only Rooms** *(future enhancement idea)*
- ๐Ÿงญ **Host as Lightweight Relay**: Host handles all connections
- ๐Ÿ†” **Nickname-Only Identity**: IP hidden from peers
- ๐Ÿ” **AES Encryption**: Messages encrypted using shared room password
- ๐Ÿ“ **Local Message Logging**: Messages stored locally as `.txt` files
- ๐Ÿงน **Kick Support**: Hosts can remove users from room
- ๐Ÿ–ฅ๏ธ **Terminal UI via `rich`**: Colorful, responsive terminal experience
- ๐Ÿ”“ **No Ngrok / Paid Services**: Fully open and local-first
- ๐Ÿ” **Optional UPnP Support**: For automatic port forwarding (where available)

---

## ๐Ÿ“ฆ Architecture

> A minimal yet powerful P2P hybrid architecture

- ๐Ÿ‘ค **Host** acts as the central relay/server for the room
- ๐Ÿงฉ **Peers** connect directly to host via TCP
- ๐Ÿ” **AES-256 encryption** with shared room password
- ๐Ÿ—ƒ๏ธ **Local storage** of configs and message history
- โŒ No third-party API or cloud involved

---

## ๐Ÿ” Security Model

| Feature           | Description                                           |
|------------------|-------------------------------------------------------|
| ๐Ÿ”’ End-to-end Encryption | Using `pycryptodome` and AES-256                |
| ๐Ÿ•ต๏ธ Anonymous Nicknames | Peers only see nicknames, not IPs               |
| ๐Ÿšซ No Central Logging    | No data is stored remotely                      |
| ๐Ÿ” Host-only IP Exposure | Only host shares their IP/port to others       |

---

## ๐Ÿ“š What You'll Learn (and Show Off)

- ๐Ÿง  Python Networking (TCP sockets)
- ๐Ÿงต Multithreading for handling clients
- ๐ŸŽจ Terminal UI with [`rich`](https://github.com/Textualize/rich)
- ๐Ÿ” AES-based encryption (`pycryptodome`)
- ๐ŸŒ P2P connection architecture
- ๐Ÿ” UPnP & NAT traversal basics
- ๐Ÿงฉ CLI argument parsing with `argparse`
- ๐Ÿ“ฆ Packaging for `pip` with `setuptools`
- ๐ŸŒ Open-source development workflows

---

## ๐Ÿš€ Usage & Installation

> Package it for quick installs and use via command-line:

### ๐Ÿ“ฅ Install via pip (in future):
```bash
pip install p2pchat

๐Ÿ–ฅ๏ธ Host a Room

p2pchat --host 7788 --name Alice --password myroom

๐Ÿ“ก Join a Room

p2pchat --join 1.2.3.4:7788 --name Bob --password myroom

๐Ÿงช Best Use Cases

  • ๐Ÿ‘พ Hackerspaces & dev clubs
  • ๐ŸŽ“ College or LAN group chat
  • ๐Ÿง‘โ€๐Ÿคโ€๐Ÿง‘ Friends-only chats (fully local)
  • ๐Ÿ•ต๏ธโ€โ™‚๏ธ Privacy-first communities
  • ๐ŸŒ Chatting across NAT/firewalls (with UPnP enabled)

๐Ÿ’ก Future Ideas

  • ๐Ÿ“ง .edu email-based rooms
  • ๐Ÿ”— Invite codes with expiration
  • ๐Ÿ“ˆ WebSocket-based GUI frontends
  • ๐Ÿ“ฒ Mobile companion app (via QR invite)
  • ๐ŸŒ Public Room Discovery (optional directory mode)

๐Ÿง  About This Project

This is a passion project meant to demonstrate:

  • How terminal apps can still be powerful & elegant
  • That encrypted, serverless chat is totally possible
  • That Python is capable of networking, UI, and encryption together

Want to contribute, fork, or star the project? Join us โ€” this is open-source privacy, made simple.


About

Terminal based Chat App

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published