Plexus is an encrypted messenger — direct and group chats, voice and video calls, files, voice messages and live location — running on a Spring Boot core with three satellite services. The same backend hosts an AI assistant that replies inside the chat and by e-mail. Direct chats can be sealed end-to-end: what the database stores is ciphertext it cannot unwrap.
Every messenger routes messages; the question is who can read them along the way. Plexus draws the line in the architecture itself: in sealed chats the server only ever transports envelopes — the keys never leave the devices. And because a messenger also wants to be useful, the same backend runs an AI assistant that answers where plaintext legitimately exists: its own chat, group mentions and e-mail.
The UI looks familiar on purpose. The unusual parts live underneath.

Real-time messaging with Telegram-style delivered/read ticks, replies, pins, reactions, scheduled messages, drafts with files — and two-scope deletion: for everyone or just for me.
Direct chats can be sealed: messages, attachments and even shared coordinates leave the device as ciphertext. Devices are verified and new ones linked by scanning a QR code.
One-to-one calls and group conferences up to six participants in a client-side mesh. Media is encrypted per frame; a TURN relay waits for the networks that refuse peer-to-peer.
The assistant answers in its own chat, replies by e-mail and can be @-mentioned inside group conversations. Voice notes arrive already transcribed.
Attachments and voice notes, drag-and-drop drafts and a media gallery per chat. Blobs are stored as chunked ciphertext — a Range request decrypts only the chunks it covers.

A share streams position ticks to every member until it expires — peers watch the marker move on the map. In sealed chats even the ticks stay ciphertext.
Owners can attach bots: external ones poll and reply through a chat-scoped bearer token; internal ones are @-mentioned and answer through the AI pipeline — quoting the mention.
Each layer exists because the one before created a real need — not because the diagram looked nice.
The project began as an AI helper for a physician, reachable by ordinary e-mail. A Spring Boot core, a Postgres database and a Vue chat view — the messenger skeleton was there before the messenger was.
SSE streams per user, presence pings, delivered/read receipts — real-time without polling or page refreshes. The Vue SPA grows into a real messenger client — sessions, contacts, named chats.
Device keys, sealed envelopes, verification, QR linking — the e2e1 spec is written once and implemented byte-exactly twice: WebCrypto in the browser, Kotlin on Android.
WebRTC signaling moves into the core: 1:1 calls, then mesh conferences up to six. Media frames get their own AES-GCM transform — the call server never hears a word.
Mail ingest, push delivery and every AI provider key leave the monolith for three small services. The core keeps a token-guarded internal API; satellites hold the credentials.
Kafka fans user events out to every node, a second core goes live behind the load balancer, deploys become rolling restarts — and a nightly age-encrypted backup quietly does its job.
Browsers, Android phones and plain e-mail all converge on a pair of identical core nodes. The core speaks two dialects: a public session API for clients and a token-guarded internal API that only satellites may reach — each key opens just its own subtree.
Dashed border = its own deployment, reachable only through the internal API or Kafka. The two core nodes are interchangeable — a rolling restart never takes the service down.
A deliberate monolith at the centre — cheap to run, easy to reason about. The sharp boundaries are inside it, and at the satellites' token doors.
X-Forwarded-For honoured only from trusted proxy ranges.Postgres is the only system of record; Flyway owns the schema. What sits inside depends on the chat's trust level: at-rest envelopes everywhere, end-to-end envelopes where chats are sealed.
enc1 = AES-256 column encryption on message text; enc2 = chunked AES-256-GCM (256 KB blocks) on blobs — a Range request decrypts only the chunks it touches. Sealed-chat payloads arrive as ciphertext already; the at-rest key just adds a second skin.
The non-extractable private key never leaves the device — WebCrypto marks it unexportable at creation. Lose the device without a backup, and its wraps are unrecoverable by design.
No websockets in the critical path. The twist is direction: satellites pull work out of the core — the core never pushes into them.
A sealed chat, an offline recipient, one short sentence. This is the actual path it takes through the system.
The UI builds the payload — text, quote, attachment descriptors — as UTF-8 JSON. Nothing has left the device.
WebCrypto mints a 256-bit content key K and AES-256-GCM-encrypts the payload under a random IV.
For each of their devices: wrapKey = SHA-256(ECDH(myPriv, theirPub) ‖ "plexus-e2e-wrap" ‖ ids),
then AES-GCM-seal K under it. Phone and tablet each get their own copy.
The envelope — {v, s, c, w{…}} — goes up over the session. Attachments travel as separately
keyed blobs (plexus-e2e-file-v1 AAD).
The row lands in assistant_messages under the at-rest enc1 key — a second envelope around
an envelope the server already cannot open.
A message-posted user event lands on plexus-user-events; both core nodes consume
it, so the recipient's node can answer regardless of which one took the POST.
Any connected device gets the envelope on its /api/events stream — delivery and later read
receipts return along the same path.
plexus-push sees the event on the topic, asks /internal/push/targets who to wake — dormant
accounts skipped, dead tokens reported back — and FCM delivers a silent data push.
Their device recomputes ECDH(theirPriv, yourPub), unwraps K from its personal
w[device] entry — a key that exists nowhere else.
AES-256-GCM verifies and decrypts; the bubble renders — and your ticks flip to delivered, then read.
The Caddy edge, the database, Kafka, the push satellite — all saw the same thing: an envelope, sizes and timestamps.
The e2e1 spec is written once and implemented twice — byte-exact across WebCrypto and the Android client — so a phone can unwrap what a browser sealed. This is what one envelope looks like on the wire, and what your message becomes as it leaves the device:
An ECDH P-256 pair is generated locally; the public half registers at
/api/crypto/keys, the private half is non-extractable and never uploaded.
Scan a QR code on an already-trusted device — it seals your identity for the new device through a short-lived link session. No account password can mint a trusted key.
Each device pair caches the peer's fingerprint; a changed key raises a verify dialog instead of silently re-sealing. Recovery keys ride a separate backup blob.
Attachments get their own content key and integrity hash; shared coordinates travel inside the same envelope — the server learns that something moved, never what.
The design goal isn't "encrypt everything" — it's not needing to trust the server with the readable form in the first place, while staying honest about the chats where plaintext exists by design.
Signaling goes through the core — that's unavoidable, someone has to introduce the peers. The conversation itself is peer-to-peer, encrypted frame by frame.
A single docker-compose file is the whole production topology: edge, two cores, database, broker, three satellites, monitoring and a nightly encrypted backup — rebuilt and rolled forward by one deploy script.
The tour, assembled. Clients above, perimeters in the middle, credentials only at the edges.