Xylem Messenger
End-to-end encrypted messenger: a FastAPI/MongoDB key-distribution and sync server plus an Android client.
- Year
- 2026
- Role
- Solo developer (server and Android client)
- Kind
- Personal
- Status
- Shipped
- Links
- Android APK · Source 1 · Source 2
Problem
Messaging apps usually ask you to trust the server. The goal was a messenger where the server only ever holds public keys and ciphertext, built end to end as an undergraduate thesis.
What I built
Xylem Messenger is an E2EE messenger in two parts. The server stores public identity and signed pre-keys (X3DH-style), authenticates users with Ed25519 signatures over one-time nonces, and syncs messages over WebSockets, falling back to silent push when a client is offline. The Android client does the X3DH handshake and all encryption on-device, keeps keys in the Android KeyStore and chat history in an SQLCipher database.
Decisions & trade-offs
- Signed one-time nonces (Ed25519) instead of passwords, so the server never stores a secret that could leak.
- One MongoDB Change Stream for the whole app, dispatched to per-user queues, instead of a stream per connection.
- The server deletes a message only after the client confirms it saved it, so a dropped connection loses nothing.
- Silent push to wake offline clients instead of keeping long-lived connections open.
Highlights
- Signature-based auth with expiring one-time nonces (Ed25519) on both REST and WebSocket, no passwords
- One MongoDB Change Stream for the whole app, dispatched to per-user asyncio queues, with a backlog fetch so nothing is lost on reconnect
- Server deletes a message only after the client confirms it persisted it (COMPLETED acknowledgment)
- Silent high-priority FCM pushes wake offline clients to sync
- Android client: X3DH handshake on-device, private keys in Android KeyStore, history encrypted at rest with SQLCipher, signed pre-key rotation every 28 days
- Tests on both sides (pytest for routes/database/websocket; Android test sources); server ships a Dockerfile and a mock browser client
Stack
- FastAPI
- Python 3.13
- MongoDB (Motor)
- WebSockets
- Ed25519
- Firebase Cloud Messaging
- Docker
- Kotlin
- Jetpack Compose
- Hilt
- Room + SQLCipher
- Google Tink