Central ingest API + database for running multiple mirage-core
sensor nodes and seeing their data in one place. See CLAUDE.md for the
full context and DECISIONS.md for why it's shaped this way.
POST /v1/nodes/register— mint a node identity (UUID) and API key.POST /v1/ingest/sessions— a node pushes one session's data (its ownsession.SessionJSON, keyed bysession_id). Idempotent: retried pushes overwrite rather than duplicate.POST /v1/ingest/heartbeat— liveness ping, mirrors mirage-core's localsensor_heartbeatsfleet-wide.
Both ingest routes require Authorization: Bearer <api_key>. The key alone
determines which node a write belongs to — nothing in the request body is
trusted to say so.
cp .env.example .env # set a real DB_PASSWORD
docker compose up -d
Register a node:
curl -s -X POST localhost:8090/v1/nodes/register \
-d '{"label":"nuremberg-01"}'
Push a session (from whatever mirage-core patch ends up doing this):
curl -s -X POST localhost:8090/v1/ingest/sessions \
-H "Authorization: Bearer <api_key>" \
-d '{"session_id":"...", ...rest of session.Session...}'
/v1/nodes/registeris currently unauthenticated — anyone who can reach it can mint a node identity. Needs an admin credential in front of it before this leaves a trusted network.- mirage-core itself doesn't push to this API yet — nothing here changes mirage-core's behavior until that patch lands there.
- No dashboard. Reads against the central DB (per-node and consolidated)
are for whatever queries this later — likely mirage-web's
/consolegaining a node picker, per CLAUDE.md. - Delivery is currently "node retries/queues locally, ingest API just upserts." If production shows frequent ingest failures, revisit with an actual queue/stream in front of ingestion (see DECISIONS.md).