back to work
2025–26web · mobile · backendSolo·Dec 2025 – Feb 2026·finished

Pocketbridge.

End-to-end encrypted sync between your phone and laptop.

pocketbridge · device sync
phone
enter code
4
8
2
9
1
3
server
waiting
no plaintext
laptop
pair a device482 913expires in 9:58
websocket · redis pub/subend-to-end encrypted
ask for a demo repositorynot hosted · demo on request

problem

Moving a file or a link from my phone to my laptop meant emailing it to myself or pasting it into a chat app. I wanted something direct that didn't hand a copy to a third party.

approach

Every device has its own Ed25519 key. When a device connects, it runs a handshake loosely based on Telegram's MTProto: ephemeral ECDH keys, nonces and signatures, then an encrypted session. A new device pairs with a 6-digit code that expires after 10 minutes. After that, devices send encrypted events with sequence numbers. The server stores them in Postgres, fans them out through Redis pub/sub, and rejects replays. It only ever handles ciphertext.

outcome

Pairing, sync and device revocation work across the web and mobile apps. The backend ran on my own server and deployed through a self-hosted GitHub Actions runner. Not hosted now; demo on request.

stack rationale

  • Redis pub/subSending one event to all of a user's other devices is a fan-out problem. Redis handles it, and it leaves room to run more than one WebSocket server later.
  • Postgres for eventsPhones go offline. Events are kept as ciphertext, so a device can catch up from the last sequence number it acknowledged.
  • Web app firstEvery device already has a browser. The mobile app came second.

full stack

  • TypeScript
  • Next.js
  • React Native
  • Node.js
  • WebSocket
  • Redis
  • PostgreSQL
  • Docker