Personal · Design and build
Le Tour de Bouffe
Plan a food crawl, walk the shortest route, remember every bite
A web app for food tours with friends. Plan the stops, invite the group with a link, auto-route the walk, mark each place eaten or skipped, and keep a review of every restaurant (dish by dish) in a library that outlives the tour. Next.js 16, Supabase and Google Places.

The problem
A food crawl with friends usually lives in a group chat. Someone pastes a list of places, someone else pastes a map, and by the second stop nobody can find either. The order of the stops is whatever order they were pasted in, so you walk across the city twice. A week later nobody remembers which noodle place was the good one.
I wanted one place to plan the tour, walk it, and remember it.
What I built
Tours. Each tour has a date range, a logo and a progress ring showing how much of it you have eaten. A stop is scheduled for a day and, if you like, a time. You can drag stops into order, or press Auto-route and let the app find the shortest walk. At each stop you mark it Eaten, Skipped or Not yet. Only eaten stops count toward progress, and only eaten stops get a rating.
Adding places. One dialog has three modes: add a stop to a tour, suggest one for somebody else to accept, or save a place to your library with no tour at all. Search is backed by Google Places, with photos, hours and ratings. Your group's own reviews are shown first and Google's after. A Custom tab covers the stall that is not on any map: paste a Google Maps link, use your current location, or type the coordinates.
Invites and roles. You invite people with a shareable link, one live link per role. Paste it into a group chat and it unfurls with that tour's own logo and name. Roles are built from capability flags (edit the tour, take part, suggest places, add places, invite others), and a tour can define its own role, such as Driver.
Attendance and activity. Everyone marks themselves in, maybe or out for each stop. An alerts page shows what other people changed, plus the stops coming up in the next week.
Reviews worth keeping. A review has separate stars for food, service and atmosphere, alongside:
- spend per person and parking cost as ranges, in the place's local currency
- group size, and whether you need to book
- notes on vegetarian options, dietary needs, kids and wheelchair access
- photos and video
- a rating, note, photo and price for each dish
Any review can be turned into a shareable story card.
The library. Every place you have ever added, with your visit log. It includes solo visits that belong to no tour, private tags like cheap lunch, and a menu for each place. You can filter by tour, by tag, or by open at a time I pick, and sort by distance.
It installs as a PWA. On a phone the navigation sits in a bottom bar, because you are using it one-handed while walking.
How it works
Routing without a routing API
The auto-route button makes no network calls. It builds a straight-line (haversine) distance matrix, gets a first route by always walking to the nearest unvisited stop, then improves it with 2-opt: reverse any segment that makes the walk shorter, until nothing does. The route is open, because a food crawl does not walk back to where it started. With no fixed start, it tries every stop as the starting point and keeps the shortest.
For a walking crawl inside one city, that is indistinguishable from optimal. It costs nothing, has no quota, and answers instantly. Turn-by-turn directions are left to Google Maps. A Maps directions link allows only nine intermediate waypoints, so a longer tour is split into consecutive legs that overlap by one stop, rather than silently losing its tail.
The database is the security model
Everything sits in Supabase Postgres behind Row Level Security, and every read is scoped to the signed-in user. The interesting part was everything RLS cannot express on its own:
- RLS picks rows, not columns. A participant may set a stop's status but not move it. A guard trigger enforces that.
- No privilege escalation through invites. Someone who can invite but not edit may only create links for roles whose capabilities are a subset of their own. The UI mirrors that rule so it never offers a role the database would refuse. The rule's test walks every capability key, so a capability added later cannot slip past it.
- Ownership is not a capability, so a tour can never end up with no owner.
- The activity log is written only by triggers. Clients have no write policy on it at all. Bulk position rewrites are filtered out, so one auto-route does not flood everyone's alerts.
- Notifications are derived, not fanned out. There is no row per recipient, just the change log and a single last read timestamp per person.
The schema is backed by a suite of SQL tests that run against a throwaway Postgres in Docker.
Respecting Google's bill and Google's terms
Places API (New) bills each request by the most expensive field it asks for, so the app is careful about requests:
- One autocomplete session token covers a whole type-and-pick interaction, and the details call closes it.
- Each place gets exactly one details request.
- Google's filter by place type caps at five types, which loses places like a
warung typed as
indonesian_restaurant. So search asks broadly and filters on the client against the full list.
Google reviews and photo references are never stored. Photo URLs carry the API key and expire, so every image goes through the app's own photo proxy.
Small things that were not small
- Dates are built by hand. Server and client formatted dates in different locales, which caused hydration mismatches, and Node builds with small-icu quietly fall back to en-US. A date-only value is parsed from its string parts so it never shifts by a day in UTC.
- Uploads skip Server Actions. Next caps an action's request body at 1 MB, so photos and video go straight from the browser to Supabase Storage. Storage policies check the uploader's permissions, and a trigger stamps each file with its tour, place and author so it cannot be misattributed.
- History does not rewrite itself. A dish you ordered is its own record, only loosely linked to the menu, so editing a menu later never changes an old review.
- The service worker caches only hashed static assets, never authenticated pages. On a shared phone, the next person cannot see your tours.
- Swipe-to-delete uses CSS scroll-snap rather than pointer maths. The button it reveals is a real, focusable button, and deleting a whole tour asks you to type its name.
Where it landed
Fifty commits over nine days, about 33k lines of application code and schema, 26 migrations, and pure-logic tests for the route optimiser, the Maps link parser, permissions, dates, currency and the share card. It started on Mapbox and moved to Google Places partway through, for better coverage of small local places.
It is built on Next.js 16 with partial prerendering. Every route ships a static shell, and each person's data streams in behind it, so the app paints before any query has returned.
Related projects
Personal
Sketché
An offline-first digital sketchbook for Android with its own brush engine: 34 tuned brushes, pressure curves, tilt shading, S Pen palm rejection, layers with blend modes, groups and clipping, selection and perspective transform, symmetry and perspective guides. There is no account and no cloud: every brush, texture and palette is generated on the phone, and drawings never leave it unless you share them.
Personal
AI Traffic Lights
A frameless, always-on-top traffic light that shows whether Claude Code is working, finished, or waiting on you. One window per session, captioned with its project, parked wherever you leave it. Built with Tauri and Rust for Windows.
Personal
Bach's Household
A fictional gothic estate that runs on its own. Sixteen staff move through an interactive multi-floor map on hourly schedules, carry relationships and memories, and appear in story episodes that an AI agent writes and illustrates ahead of release. Built as an exploration of the pieces a tabletop RPG generator will need.



