Live city
0 of 30 couriers free
Click the map to set a pickup, or place a random order.
The search shows up here, ring by ring, as soon as an order is placed.
On the road
No orders on the road.
Every request, timed by the server
Each response carries a Server-Timing header: loading the city from Redis, replaying the seconds since your last request, matching, and saving. Point at a request to see where its time went.
Requests appear here as the page talks to the API.
Cells of 201 m
At resolution 9, reaching a courier one kilometre away takes 3 rings and 37 cell lookups. Bigger cells need fewer rings but hand more couriers to the ranking. The live map follows this switch.
Lookups, then maths
Look in the pickup’s cell
The pickup becomes a cell id. Couriers filed under that id come back from one map lookup.
Widen by one ring
Six neighbours, every one an edge away. Still only lookups, no distance maths.
Enough candidates
Three free couriers found. A matcher that stops here can still pick the wrong one.
Stop at the first ring: courier B, 143 m
One ring more: courier B, 143 m
One ring more, then rank
Grid distance isn’t real distance. Drag the pickup toward courier A and watch the two answers split.
The rules of the search
Measured on 2,000 orders against a seeded city of 300 couriers, one in five busy.
How big is your fleet?
0.000ms
Measuring in your browser…
Under the hood
What happens to one order, in the order it happens. Your city exists only for you and only while you use it.
Route handler
Validates every coordinate and answers 400, 404, 409 or 429 with what to fix.
City service
Saves with compare-and-set and retries, so a poll can never overwrite an order.
Pure city
Replays the seconds since your last request from a saved seed. Same state in, same city out.
Matcher
Rings of H3 cells and map lookups; distance only to rank. Covered by tests.

Śródmieście at night, where the couriers ride. The Palace of Culture and Science, lit at the bottom, is the centre of the city in the code.

The view from the Palace: a resolution 9 cell is about two of these blocks across.
Upstash Redis
One hash per visitor, gone after 15 idle minutes. Reads replay, only changes write.
Vercel Functions
Any instance serves any request: nothing lives in a function’s memory.