AiThao
Technology · AiThao

Realtime messaging

A message should appear on the other phone the moment you send it, and it should never be lost on the way. Those are two different jobs, and AiThao does them in that order: first saved, then delivered.

What it does for you

  • Messages and reactions appear immediately on the other person’s phone and on your other devices.
  • A phone that was offline catches up when it comes back, without gaps.

How it works

Each app keeps one authenticated WebSocket connection open to the server. When you send a message, the server writes it to the database first and only then publishes an event. Several server processes run side by side and pass events to each other over a shared publish/subscribe channel, so whichever process holds the recipient’s connection delivers it.

If the recipient is offline, a push notification wakes their phone, and the app catches up from a replay log when it reconnects. In an end-to-end encrypted chat, what travels through all of this is an encrypted envelope the server cannot read.

Under the hood

WebSocket · Node.js · TypeScript · PostgreSQL · Redis

Questions

What happens if I send a message with no connection?

The app sends it when the connection returns. Once the server has it, it is saved before anyone is notified.

How long does the server keep an encrypted message?

Until each of the recipient’s phones has its copy, at most 30 days.

See the translation for yourself

The web demo lets you try AiThao before the app is out. AiThao is waiting for Apple’s approval to appear in the App Store; there is no install link yet.

Open the demo