01The idea
A logistics client wanted to know whether cheap sensors could tell them when a cold-chain box warmed up. Before quoting a project, we built the smallest possible version on a desk.
Three sensors, one small Rust service and a web dashboard: enough to see whether the readings were reliable, and what a driver would actually need to see on a phone.
02How it's built
Sensors publish temperature and door events over MQTT. A Rust bridge validates and batches them, writes to Postgres and pushes live updates to the dashboard over a WebSocket.
- MQTT in, WebSocket out, Postgres in between
- Runs on a single small device
- Batches writes, so a flaky network doesn't lose data
- Alerts after a threshold, not on every blip
1// read sensor messages, drop bad ones, batch the rest2while let Some(msg) = mqtt.next().await {3 let Ok(reading) = Reading::parse(&msg.payload) else {4 continue; // ignore malformed packets5 };6 batch.push(reading);7 if batch.len() >= 50 || batch.age() > FIVE_SECS {8 db.write(&batch).await?;9 ws.broadcast(batch.latest());10 batch.clear();11 }12}03What we learned
The hardware was the easy part. Deciding when an alert is worth waking someone up for took most of the time, and it turned out to be a product question, not an engineering one.
- Prototype the alert before the dashboard
- Assume the network will drop out
- Put the cheapest possible version in front of real users
The desk prototype turned a vague brief into a fixed-scope project in two weeks.





