How java-mx/bitchat-python works
BitChat Python is an asynchronous terminal client for encrypted peer-to-peer chat over BLE and local networks. Users launch the terminal interface, discover peers, establish authenticated Noise sessions, and exchange messages; the mesh router supports multi-hop forwarding. The graph includes protocol encoding and fragmentation, persistent configuration, platform capability detection, and both transport families. Several internal links are based on documented capabilities rather than inspected call sites; those are marked dashed with no evidence path.
Main entry points: session_coordinator.py Session coordinator · app.py Terminal interface · manager.py BLE discovery and transport · transport.py LAN transport
Components 21
Terminal client
- Terminal interface
src/bitchat/tui/app.py - Chat widgets
src/bitchat/tui/widgets/chat_view.py - Command parser
src/bitchat/commands/parser.py - Session coordinator
src/bitchat/app/session_coordinator.py - Application controller
src/bitchat/app/application.py
Identity and security
- Peer identity
src/bitchat/crypto/identity.py - Noise handshake
src/bitchat/crypto/noise.py - Secure sessions
src/bitchat/crypto/sessions.py
Protocol and mesh
- Packet model
src/bitchat/protocol/packet.py - Packet fragmentation
src/bitchat/protocol/fragmentation.py - Mesh router
src/bitchat/mesh/router.py
Peer connectivity
- BLE discovery and transport
src/bitchat/ble/manager.py - BLE GATT server
src/bitchat/ble/server.py - BLE platform adapter
src/bitchat/ble/adapter.py - LAN transport
src/bitchat/network/transport.py - LAN connection server
src/bitchat/network/server.py
Platform and state
- Hardware capabilities
src/bitchat/platform/capabilities.py - Configuration storage
src/bitchat/storage/config.py - Terminal themes
src/bitchat/tui/theme.py
Other components
- Terminal user
- Remote peer
Connections 27
- Terminal user → Terminal interface: uses
README.md - Terminal interface → Session coordinator: coordinates sessions
src/bitchat/tui/app.py - Terminal interface → Command parser: parses commands
src/bitchat/tui/app.py - Terminal interface → Chat widgets: renders chat
src/bitchat/tui/app.py - Terminal interface → Terminal themes: uses theme
src/bitchat/tui/app.py - Application controller → Session coordinator: starts sessions
src/bitchat/app/application.py - Application controller → Command parser: dispatches commands
src/bitchat/app/application.py - Application controller → Configuration storage: loads settings
src/bitchat/app/application.py - Session coordinator → Peer identity: uses identity
src/bitchat/app/session_coordinator.py - Session coordinator → Secure sessions: manages sessions
src/bitchat/app/session_coordinator.py - Secure sessions → Noise handshake: uses handshake
src/bitchat/crypto/sessions.py - Session coordinator → Mesh router: routes packets
src/bitchat/app/session_coordinator.py - Session coordinator → BLE discovery and transport: selects transport
src/bitchat/app/session_coordinator.py - Session coordinator → LAN transport: selects transport
src/bitchat/app/session_coordinator.py - Session coordinator → Configuration storage: persists settings
src/bitchat/app/session_coordinator.py - BLE discovery and transport → BLE platform adapter: uses adapter
src/bitchat/ble/manager.py - BLE discovery and transport → BLE GATT server: coordinates server
- LAN transport → LAN connection server: uses server
src/bitchat/network/transport.py - Hardware capabilities → BLE platform adapter: detects support
src/bitchat/ble/adapter.py - BLE discovery and transport → Remote peer: discovers peers
README.md - LAN transport → Remote peer: discovers peers
README.md - BLE discovery and transport → Packet model: transfers packets
src/bitchat/ble/manager.py - LAN transport → Packet model: transfers packets
src/bitchat/network/transport.py - Session coordinator → Packet model: exchanges messages
src/bitchat/app/session_coordinator.py - Packet model → Packet fragmentation: fragments payloads
src/bitchat/protocol/fragmentation.py - Mesh router → Remote peer: relays messages
README.md - Session coordinator → Remote peer: sends encrypted chat
README.md