Plexus Map is our offline-first hiking map — built for the Caucasus and Thuringia, where connectivity is a rumor. The whole map lives on the phone: vector tiles, terrain, routing graphs and tracks as verified packages. Behind it, a Spring Boot monolith runs a versioned geodata pipeline — OSM extracts in, Planetiler PMTiles and DEM derivatives out — and every byte is licensed, hashed and atomically published.
Consumer map apps treat "offline" as a cache that might help. A touring map can't afford that: the route you plotted in a valley has to survive a ridge with zero bars. Offline is the product, not the fallback — the backend's real job is manufacturing self-contained regions: tiles, terrain, routing graph and license metadata bundled into one verifiable package. Download once, and every later request hits the phone's own storage.
The product surface is a regional package and a map that never spins. Everything else — routes, tracks, drawn trails, elevation — syncs when it can and survives when it can't.
Each package bundles base vector tiles, terrain data and a routing graph with a manifest — checksums verified before activation, licenses attached to every layer.
A leg can follow the GraphHopper network — or go straight across open terrain on a geodesic line. Direct legs are first-class geometry, never snapped to roads that don't exist up there.
Custom ways are user-drawn trails — sketched freehand on the map, stored server-side, synced to every device and reviewable against satellite imagery in the admin panel.
Tracks record with the screen off and land in a GPX-exportable library. Navigation speaks turn-by-turn, and a floating minimized map keeps the route visible over other apps.
The stack wasn't designed on paper — each stage answered something that broke or was legally off-limits.
Public OSM tile servers ban bulk and offline use — so the base map is built from Geofabrik PBF extracts through Planetiler into self-hosted PMTiles, with ODbL attribution carried in the style.
Copernicus GLO-30 COGs become three products: terrain-RGB tiles for elevation queries, a multidirectional hillshade underlay, and contours + slope gradients through GDAL — each with its own projection pitfalls documented in the runbook.
The server runs GraphHopper for planned routes; the device runs a local graph inside each offline package for trails where there is no server to ask. Same profile set, two engines.
Ad-hoc files turned into a pipeline: dataset → version → run → artifacts → release → manifest. A PACKAGE_BUILD job assembles everything in one transaction — a client never meets a half-built package.
Community reports, a consent-gated heatmap, user-drawn ways synced across devices, and an admin panel that can review a drawn trail against the same satellite layer the client sees.
All traffic enters through caddy on :443 behind Cloudflare: the SPA,
static map assets, tile proxies and the API are routed by path, and
/internal/* never reaches the backend. The geodata truth lives in
PostGIS and object storage; GraphHopper runs as its own container because its
memory profile doesn't share well.
Dashed border = a separate host or service. The device never depends on the edge for an already-downloaded region — the whole right side can vanish and a packaged map still renders, routes and records.
The monolith splits into honest modules: the pipeline owns datasets and the workers that grind them; packages own what a client may download; routing and elevation serve live queries; ways and community own what users contribute back.
A user in the mountains taps a region card. This is what actually happens to the byte that becomes their map — and which box it crosses on the way.
It starts as an .osm.pbf — OpenStreetMap's planet, regionally
sliced by Geofabrik. Roads, trails, springs, summits: everything, none of
it styled.
An admin posts a pipeline run: wget the PBF into a clean
work-dir, declare it an artifact. The job queue owns the lifecycle —
progress, timeout, retry.
Planetiler bakes the extract plus water/relief aux data into one vector archive — z0–14, ~160 MB in, a single seekable file out.
Every output lands in the object store with a sha256, schema, source list, license and zoom range — a dataset version, immutable forever.
A RegionRelease pins exact layer versions: base vector, DEM, hillshade, contours, slope, routing graph. Publication is atomic — the old release stays live until the new one verifies.
The manifest lists every file with its URL, bytes and sha256 — written in one transaction so no client ever sees half a package.
Artifacts serve from R2 under versioned prefixes — v2,
v3 — because MapLibre caches a bare URL as fresh forever.
The app pulls each file, checks its sha256 against the manifest, and only then flips the package live — a torn download changes nothing.
MapLibre reads the PMTiles off disk; the DEM archive answers elevation for the route profile; the bundled graph answers routing.
Somewhere above the tree line the signal drops to nothing. Tiles, terrain, routing, track recording — everything keeps working, because the hard part already happened.
"Offline-first" is easy to claim and rare to specify. Here the boundary is architectural, not aspirational — everything in the left column needs nothing but the phone's storage.
A region is never "updated in place" — every change is a new immutable version moving through the same four stations, so a bad render can be rolled back, not hot-patched.
A package's whole promise fits in one document: which files, how big, which hashes, which licenses. Everything else — the map, the routes, the trust — descends from it:
No layer ships offline without offlineAllowed in the source
register — compliance is a pipeline gate, not a footer disclaimer.
Every file's hash rides in the manifest; the client verifies all of them before a package goes live — partial state can't leak in.
Coordinates and tracks are stored rows a user owns — they are never written to server logs or sent to analytics.
A plan and a recording are different entities with different lifecycles — the sync layer never has to guess which one wins.
The edge block runs on the shared Plexus host under
/opt/plexus: the monolith, its GraphHopper and Postgres in compose,
static map assets as bind mounts, the heavy data in R2. Data releases ship
separately from code deploys — a region can be republished without touching
a container.
respond sorts after handle in
adapted config — the 404 shields are matcher-scoped handles, or the SPA
fallback swallows /internal/* into index.html first.style.json on start; regenerated tiles get a new
version path because cached URLs never invalidate.