Phase 1: chunk store, tile rendering pipeline, and Leaflet viewer

api: WS gateway with token auth (Postgres-backed servers table, seeded via
`bun run seed`), column-granularity chunk store (hand-written SQL
migrations, no drizzle-kit CLI — its config loader needs esbuild, which
doesn't install cleanly here), dirty-chunk Redis stream producer with
per-flush dedup, and a tile-serving route.

worker: consumes the dirty-chunk stream via a proper consumer group,
rasterizes each chunk's columns into a single-resolution top-down PNG
(static pre-Flattening block-id palette), uploads to MinIO, and upserts
the tile pointer.

frontend: barebones Leaflet 2D viewer (CRS.Simple, one native zoom level)
wired to /api/servers and /api/tiles.

Object storage: tiles live in a dedicated `mcmapper-tiles` bucket on the
existing shared MinIO instance (devstack-minio on octo-winsrv) instead of
a per-stack container, via a scoped access key limited to that one bucket
— see README's "Object storage" section. MINIO_SECRET_KEY is real and is
deliberately not committed; docker-compose layers an untracked .env over
.env.example for it.

Full pipeline verified end-to-end against live containers: WS auth ->
Postgres upsert -> deduped Redis dirty-chunk event -> worker rasterize ->
MinIO upload -> tile fetch through the api route, including from the
actual mod-side WS client (see MCMapper-Mod's matching commit).
This commit is contained in:
2026-08-08 15:36:56 +02:00
parent 4c7cc26281
commit 7bed571ffa
30 changed files with 3779 additions and 84 deletions
+15 -4
View File
@@ -5,8 +5,19 @@ html(lang="en")
meta(name="viewport" content="width=device-width, initial-scale=1")
title MCMapper
link(rel="stylesheet" href="/css/tailwind.css")
link(rel="stylesheet" href="https://unpkg.com/leaflet@1.9.4/dist/leaflet.css")
script(defer src="https://unpkg.com/alpinejs@3.x.x/dist/cdn.min.js")
body.bg-neutral-900.text-neutral-100.min-h-screen.flex.items-center.justify-center
div(x-data="{ ready: true }")
h1.text-2xl.font-semibold MCMapper
p.text-neutral-400(x-show="ready") Backend scaffold is up. Map viewer lands in Phase 1.
script(src="https://unpkg.com/leaflet@1.9.4/dist/leaflet.js")
style.
html, body, #map { height: 100%; margin: 0; }
body.bg-neutral-900.text-neutral-100
div#app.h-screen.flex.flex-col(x-data="mapmapper()" x-init="init()")
header.px-4.py-2.flex.items-center.gap-4.border-b.border-neutral-700
h1.text-lg.font-semibold MCMapper
span.text-sm.text-neutral-400(x-show="!loading && server")
| Viewing:
span(x-text="server?.name")
span.text-sm.text-neutral-500(x-show="loading") loading servers…
span.text-sm.text-red-400(x-show="!loading && !server") No server registered yet — see backend README (bun run seed).
div#map.flex-1
script(src="/js/map.js")