Signed HTTP routes
APIs verify signatures over method, path, time, body, and identity. Responses are schema-validated before send.
Self-hosted encrypted communication
Encrypted chat, calls, files, and backups in one self-hosted app. Devices keep identity and keys; server only moves encrypted traffic.
Architecture guide
Use this guide to jump straight to client code, backend coordination, privacy boundaries, backups, operations, and quality controls.
Backend
Backend validates identity and transport, then coordinates real-time state. It routes presence, queues, calls, and files without reading plaintext.
APIs verify signatures over method, path, time, body, and identity. Responses are schema-validated before send.
Each session starts with signed nonce challenge. After auth, socket carries encrypted messages, receipts, presence, and call signaling.
Redis stores presence, public keys, encrypted queues, receipts, push subscriptions, pending calls, sessions, and dashboard counters.
Server validates policy, chunks, hashes, manifests, auth, expiry, and acknowledgements. File bytes arrive already encrypted.
Frontend
Browser owns identity, keys, local data, chat, calls, push, and backups. Backend coordinates delivery, not content.
ECDH P-256, ECDSA P-256, AES-GCM, fingerprints, and `CryptoKey` private keys.
Dexie and IndexedDB keep keys, peers, messages, previews, attachments, queues, and cached media.
WebRTC calls use TURN credentials, ICE restart, relay fallback, wake lock, and reload recovery.
Service worker handles precache, push alerts, call and message notifications, transfer reminders, and update activation.
Privacy model
Identity comes from cryptographic keys, not usernames or passwords. Messages, files, calls, and backups are protected before infrastructure sees them.
Backups
Frontend decides what data to export. PCBK Core defines encrypted file format and restore rules.
Select identity, peers, messages, attachments, queues, previews, and media for chosen backup mode.
Argon2id, HKDF, HMAC, AES-GCM, canonical CBOR, and per-record nonces protect file and records.
Restore checks prelude, authenticated header, manifest, record order, payload shape, and rollback behavior.
Infrastructure
Nginx owns public edge. Backend owns identity checks, signatures, authorization, and event rules.
TLS, static PWA files, API proxying, WebSocket proxying, dashboard serving, and generic throttling.
Presence, queues, receipts, calls, public keys, push subscriptions, and runtime counters.
STUN/TURN traversal for WebRTC calls when direct peer media transport is not available.
Private operational view for sessions, queues, services, system signals, risk, alerts, and recent events.
Quality boundaries
Tests target backup restore, rollback, and encrypted storage. Runtime validation keeps route and WebSocket contracts strict.