Project Halcyon
A live control room for a delivery fleet: every van on one screen, updated each second.
Fleet role: full build. One lead, four builders, two reviewers.
Stack: typescript · websocket · canvas · postgres
Sample project: there is no live site or repository behind these buttons yet.
Walkthrough
Now playing: a generated placeholder, drawn on your device. No file is loaded.
What it does
- 01Dispatchers open one page and see where every van is right now.
- 02Late deliveries turn amber before the customer notices.
- 03It keeps working on a weak connection and catches up when the signal returns.
Four layers
Pull the layers apart and pick one to see what it does and where its code lives.
L1 · Interface
The map and the tables the dispatcher sees. Only the rows on screen are drawn, so 2,000 vans scroll smoothly.
apps/console/src/viewsL2 · Live channel
One open connection per browser. The server sends only what changed since the last message.
services/stream/src/delta.tsL3 · Rules engine
Decides when a delivery counts as late. Rules are plain data, so support staff can change them.
services/rules/src/engine.tsL4 · Storage
Positions for the last 30 days, split by day so old data is dropped cheaply.
infra/db/migrations
What went wrong and how we fixed it
The map froze with 500 vans
- symptom
- Every position update redrew the whole map.
- cause
- The browser was asked to repaint 500 markers each second.
- fix
- Markers moved to one canvas layer and updates are grouped per frame.
Phones lost updates in tunnels
- symptom
- After a short signal loss the screen showed old positions.
- cause
- The client reconnected but never asked for what it missed.
- fix
- Each message carries a number; on reconnect the client asks for everything after its last one.
By the numbers
Sample figures: invented, like the rest of this project.