NEXUS OPS/ Data model
CONNECTING
← Overview
Sample device

Entities & storage

hover to trace relations · click (or Enter) to inspect · samples update every tick
1 : n1 : 10historyraiseswrites1 : naggregated intochanges packed intoSensorTypeshared codekey PKlabelunitdecimalshi / lo [warn, crit]DeviceMongoDB_id = deviceId PKnametypesite · floor · zoneroom · rackactiveReadingMongoDB_id = deviceId:sensor PKdeviceId FKsensor FKvalue · unitstatusts · locationSamplememorydeviceId FKsensor FKtsvalueAlertmemoryid PKdeviceId FKsensor FK | nullseverityvalueraisedAtEventMongoDB_id = id PKdeviceId FKkindseveritysensor · valuets (TTL)SummarySSE wirets · seqtotal · reportingbyStatusbySensorbyZoneaveragesDeltaSSE wireseq · tsrows[ [idx, status, lastSeen, v0…v9] ]MongoDBmemorySSE wireshared code

Wire format

GET /api/stream · text/event-stream · one frame per event per tick

Every frame carries id: <seq>. Events: hello on connect, summary and delta every tick, alert on transitions, and a : hb comment heartbeat. The browser validates each frame with the shared zod schemas and drops bad ones.

Device

MongoDB

MongoDB · devices (10,000)

One physical unit with a stable deviceId (DEV-00001), a name, a device type and a location, reporting all ten sensor types.

Fields
_id = deviceId PKnametypesite · floor · zoneroom · rackactive
Related

Live sample