Adds the City of Sandpoint's printed "Downtown & Waterfront Public Parking"
map as a georeferenced overlay, and lets you track your time on any of its
areas without ever touching the ParkSmarter/IPS API.
Georeferencing (tools/citymap/)
- The PDF carries no geo metadata, so the page->WebMercator affine is
recovered by fitting the drawing to OSM street centrelines.
- pdftocairo writes stroked street segments with per-path matrix()
transforms in local coords while filled lots are absolute; both are
handled. The five legend swatches share the real geometry's colours and
are identified by stroke-width and position, then dropped.
- 49 areas, fitted to RMS 4.1 m (X) / 3.5 m (Y). On-street segments land a
mean 4.0 m from the nearest OSM road. sp-039/040 sit further out because
they are angled bays along the old rail corridor, on no named road at all.
- Sandpoint's grid jogs 38 m between N 2nd Ave and S 2nd Ave; the page shows
the same jog at the fitted scale, which independently confirms the fit.
App
- Map tab: "City map" layer in the legend's colours, tappable.
- "Park here" pins the car from GPS and auto-detects the containing area
(40 m snap). With no fix it asks you to tap the spot instead, so the pin
never depends on GPS working.
- The pin lives in its own storage key, not inside the session: pinning the
car without starting a timer must survive backing out of the screen.
- Durations cap at the posted limit — a 2-hour space is not offered a
4-hour timer. Lots and no-limit spots get the long options.
- Reuses the existing foreground-service countdown. The second notification
button reads "+1 hr" for a city area rather than "Extend": there is
nothing to buy, so it edits the local timer and says so.
- Account -> Align city map: nudge/scale/rotate the whole overlay against a
live GPS fix. Save-on-phone needs no admin token, since the person who can
see the misalignment is the one standing on the street.
Server
- parking_areas + map_overlay tables, public read, admin replace-all. The
areas come from one source document, so replacement is wholesale rather
than an upsert.
Dropped geometryCenter from the geo module: on the real data it returns a
point in the water for the crescent City Beach lot and mid-block for
L-shaped runs. Nothing used it.
Tests: 8 geometry tests in app/, 5 area/overlay tests in server/.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Anonymous Mode — "Park without signing in" on the login screen (with a popup of
what works vs needs a login). Anonymous users browse parking areas from our
mirror, see labels, and start free check-in timers; paying, sessions, and
account screens prompt to sign in. AuthContext gains an 'anonymous' status +
enterAnonymous/requireLogin.
Zone mirror — server gains a `zones` table + public GET /api/zones and admin
POST /api/zones/sync. Signed-in admins push the zones they pull (authed) from
ParkSmarter after each map search, so anonymous users can read areas without a
ParkSmarter login. Map/Scan read the mirror when anonymous.
Also: the free "Check in" button is now always available with a 2h/3h/4h picker
(no longer gated on a prior label) — fixes "couldn't start a timer on a free
zone". CORS probe confirmed ParkSmarter allows any origin but only Content-Type,
so a future PWA can't auth to it — the mirror is what makes anonymous browsing
(and a PWA) possible.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
New server/ service classifying zones as free_2h/3h/4h street vs pay_immediate
lots. Public reads; writes require the admin bearer token (timing-safe compare).
@fastify/rate-limit (120/min global, 20/min writes), manual IP denylist +
auto-block on repeated auth failures. SQLite via better-sqlite3. Dockerfile +
compose (loopback-only, mem/cpu capped) + nginx block + README. 9 tests pass.
Deployed live at https://bigbrainparking.mowden.top (behind nginx + certbot).
Not an npm workspace — kept out of the app/CI install to avoid the native dep.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>