How b0mbastik/messenger works
The repository contains two secure-messaging products: a TLS terminal client/server and a browser messenger with a FastAPI backend and React frontend. In the terminal flow, clients register or authenticate with a password and CA-backed identity, then exchange end-to-end encrypted direct messages through the server. The web version adds browser authentication, online presence, chat, settings, and persisted message history. The graph includes the shared cryptographic layer and each product’s major runtime stages. Some web UI and route wiring is unsampled, so uncertain links are dashed.
Main entry points: client/app.py Terminal client · server/app.py TLS server · MessengerApp.tsx Messenger interface · routes.py HTTP and WS routes
Components 26
Terminal Messenger
- Terminal client
client/app.py - TLS server
server/app.py - Account registry
server/accounts.py - Live sessions
server/storage.py
Shared Security
- TLS setup
ca/tls_utils.py - CA certificates
ca/cert_utils.py - Local identity
shared/identity.py - Message protocol
shared/protocol.py - E2E encryption
shared/e2ee.py
Web Backend
- HTTP and WS routes
web-messenger/backend/app/api/routes.py - Account workflows
web-messenger/backend/app/services/accounts.py - Token security
web-messenger/backend/app/services/security.py - SQLite store
web-messenger/backend/app/services/store.py - WebSocket sessions
web-messenger/backend/app/ws/manager.py - Request schemas
web-messenger/backend/app/models/schemas.py - Application setup
web-messenger/backend/app/main.py
Web Frontend
- Messenger interface
web-messenger/frontend/src/app/MessengerApp.tsx - Authentication screens
web-messenger/frontend/src/features/auth/LoginPage.tsx - Chat interface
web-messenger/frontend/src/features/chats/ChatPanel.tsx - Settings panel
web-messenger/frontend/src/features/settings/SettingsPanel.tsx - Browser cryptography
web-messenger/frontend/src/crypto/e2ee.ts - Browser identity storage
web-messenger/frontend/src/crypto/identityStore.ts - HTTP API client
web-messenger/frontend/src/lib/api.ts - Chat and auth state
web-messenger/frontend/src/store/chatStore.ts
Other components
- Messenger user
- Browser user
Connections 32
- Messenger user → Terminal client: uses
README.md - Terminal client → TLS server: connects over TLS
README.md - TLS server → Account registry: authenticates accounts
server/app.py - TLS server → Live sessions: tracks sessions
server/app.py - TLS server → TLS setup: builds TLS context
server/app.py - Terminal client → TLS setup: opens TLS connection
client/app.py - Terminal client → CA certificates: checks certificates
client/app.py - TLS server → CA certificates: issues and verifies
server/app.py - Terminal client → Local identity: loads identity
client/app.py - Terminal client → Message protocol: exchanges messages
client/app.py - TLS server → Message protocol: reads messages
server/app.py - Terminal client → E2E encryption: encrypts messages
client/app.py - TLS server → E2E encryption: validates envelopes
server/app.py - Browser user → Messenger interface: uses
README.md - Messenger interface → Authentication screens: presents auth
- Messenger interface → Chat interface: presents chat
- Messenger interface → Settings panel: presents settings
- Messenger interface → Chat and auth state: uses state
- Messenger interface → HTTP API client: requests API
- Messenger interface → Browser cryptography: encrypts messages
README.md - Browser cryptography → Browser identity storage: uses identity
- HTTP API client → HTTP and WS routes: calls routes
- Application setup → HTTP and WS routes: registers routes
web-messenger/backend/app/main.py - Application setup → Account workflows: configures service
web-messenger/backend/app/main.py - Application setup → SQLite store: configures store
web-messenger/backend/app/main.py - Application setup → WebSocket sessions: configures manager
web-messenger/backend/app/main.py - HTTP and WS routes → Account workflows: handles auth
web-messenger/backend/app/api/routes.py - HTTP and WS routes → Token security: checks identity
web-messenger/backend/app/api/routes.py - HTTP and WS routes → WebSocket sessions: dispatches messages
web-messenger/backend/app/api/routes.py - HTTP and WS routes → Request schemas: validates payloads
web-messenger/backend/app/api/routes.py - Account workflows → SQLite store: reads and writes
web-messenger/backend/app/services/accounts.py - Account workflows → CA certificates: validates certificates
web-messenger/backend/app/services/accounts.py