Single Storm Codex server (milestone 3): upload → parse → Postgres → real time → REST. Uses Axum, Tokio, SQLx, and PostgreSQL.
docker compose -f docker-compose.dev.yml up -d # Postgres 17 on :5433
export DATABASE_URL=postgres://storm:storm@127.0.0.1:5433/storm_codex
export BIND_ADDR=127.0.0.1:8088
cargo run -p storm-codex-server # automatic migrations, listens on :8088- Raw archive: each
.StormReplaykept as is (ARCHIVE_DIR) — source of truth. - Postgres: complete projection (
matches,match_players, JSONB + promoted columns),parser_versionpartout, re-process idempotent. - Dump decoded on demand:
…/raw+ bounded LRU disk cache (RAW_CACHE_MAX_BYTES).
POST /api/upload— Bearer token, archive first, parse in a pool (= number of cores, off the HTTP thread), projection. Response:parsed/409 duplicate/parse_failed(≤ 2 s),202 acceptedif saturated.GET /api/matches(map/mode/hero/player filters, paginated) ·GET /api/matches/{id}(detail{match, players}) ·GET /api/players/{toon}·GET /api/heroes.GET /api/matches/{id}/raw?stream=…— dump decoded on the fly + LRU cache.GET /ws— WebSocket, pushmatch.parsed(end of game → page up to date < 5 s).POST /api/admin/tokens·DELETE /api/admin/tokens/{id}·GET /api/admin/uploads(health) ·POST /api/admin/reprocess(idempotent re-parse, driven byparser_version) — BearerADMIN_TOKEN.
uploads.fingerprint= SHA-256 of the content (fast file dedup, pre-parse).matches.fingerprint= SHA-256 ofdate|map|length|sortedToons(game dedup, overlay compat);project_matchis idempotent (delete-then-insert), with retry on deadlock.
Configuration comes from environment variables. For deployment, see the operations guide and security policy.
MIT. Not affiliated with Blizzard.