Architecture
Every operational row is scoped by companyId. The signed-in plant session selects one factory. Ops viaOps can enter a factory as admin without becoming a plant user.
Pipeline
- Device exists in the registry with an ingest token and a type/unit from the sensor taxonomy.
- A reading arrives (HTTP or MQTT) with a finite numeric
value. ingestReadingstoresReading, optionalmessageId, quality, source, gateway.- Alert rules, machine-state hints, energy deltas, and (on demo) ERP-shadow batch/bin/QC updates may run.
- Command Center, OEE, energy, Executive read those facts. They do not invent production.

Processes on the VM
The app is a long-running Node process (not serverless): Postgres, MQTT (embedded Aedes or MQTT_URL), connector runtime, simulator (demo tenants only), offline alert scan, edge sync.
Isolation
A plant user cannot request another factory id. Ops aggregation uses authorized site lists. Paused factories reject plant login.
Walk the screen
- Confirm the signed-in session is one factory. Another factory is not a filter.
- Follow a reading from a registered device, through a finite numeric value, into a stored reading.
- Expect alerts, energy, and demo side-effects to run from that store. Command Center, OEE, energy, and Executive read it.
- Remember the app is a long-running Node process with Postgres, MQTT, connectors, and a simulator only for demo factories.
- A paused factory rejects plant login. A plant user cannot request a different factory.
Worked example
A temperature value arrives for the demo factory and the dashboard for that factory moves. The neighbouring factory's dashboard does not. You do not add a production total on Executive that was not in the stored readings.
Common mistakes
- Treating Command Center as a place that invents production.
- Expecting the simulator to run for a live factory.
- Using one plant login to open a second factory.
Recap
- Rows are scoped to the factory on the session.
- Apps read stored facts. They do not invent production.
- Paused factories reject plant login.
