This is a peer-to-peer messaging app where multiple nodes can connect to each other and exchange encrypted messages. Messages are synchronized across the network using a gossip protocol.
Install dependencies:
pip install -r requirements.txt
Start the first node on port 5001:
py app.py 5001
In another terminal, start the second node on port 5002:
py app.py 5002
Open http://localhost:5001 and http://localhost:5002 in separate browser windows
- On the 5001 interface, click "Sambungkan Peer" and enter 5002
- On the 5002 interface, click "Sambungkan Peer" and enter 5001
Select a peer from the sidebar and send messages
- Each node generates RSA public/private key pairs on startup
- When you connect to a peer, your public key is exchanged
- Messages are encrypted with the recipient's public key
- The gossip protocol automatically spreads messages across all connected peers
- Messages are stored locally in SQLite databases
app.py - Main Flask server with all routes and logic
requirements.txt - Python dependencies
docker-compose.yaml - Multi-node Docker setup
static/ - CSS and JavaScript files
templates/ - HTML template
instance/ - Created automatically for database files
- Each node listens on its own port (5001, 5002, etc.)
- Data persists in node_PORT.db files
- The app runs in debug mode locally
- Messages sync every 2 seconds in the UI