Skip to the live city

Ring by ring

Hex Courier finds the nearest free courier in Warsaw by searching Uber’s H3 hexagons outward from the pickup, one ring at a time.

Live city

Source on GitHub
Demo running: a sample order every 12 seconds.

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.

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…

  1. 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.

  2. Route handler

    Validates every coordinate and answers 400, 404, 409 or 429 with what to fix.

  3. City service

    Saves with compare-and-set and retries, so a poll can never overwrite an order.

  4. Pure city

    Replays the seconds since your last request from a saved seed. Same state in, same city out.

  5. Matcher

    Rings of H3 cells and map lookups; distance only to rank. Covered by tests.

  6. Central Warsaw at night from a plane: lit streets in a grid, the Palace of Culture and Science glowing near the bottom

    Ś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.

  7. Rooftops and streets of central Warsaw seen from the Palace of Culture and Science

    The view from the Palace: a resolution 9 cell is about two of these blocks across.

  8. Upstash Redis

    One hash per visitor, gone after 15 idle minutes. Reads replay, only changes write.

  9. Vercel Functions

    Any instance serves any request: nothing lives in a function’s memory.