What’s new
Put together a live demo mode so anyone reviewing the project doesn’t have
to set up Mosquitto or flash a Pico just to click around. The whole thing
runs on Render’s free tier. Every visitor gets their own isolated in-memory
SQLite seeded with demo MCUs, a DHT11 sensor, 24 hours of backfilled
readings, and a per-session ticker that generates simulated data every 10
seconds. MQTT, Wake-on-LAN and shell command execution are all mocked.
The session isolation was the part I was most worried about. The db module
is imported from 15+ files and I really didn’t want to refactor all of
them. Ended up wrapping everything in AsyncLocalStorage and putting a Proxy
over the db export, so every request transparently hits its own session’s
database without any of the callers knowing. Socket.io broadcasts are
scoped to per-session rooms so visitors never see each other’s data.
Got bitten by Linux case sensitivity on the first deploy (mcuRepository.js
vs MCURepository imports). Worked fine on Windows, crashed immediately
on Render. Also ran into a template literal syntax bug where \" inside a
${} interpolation silently broke the whole MCU detail page, but only in
production. That one took a while to find.
Added an English landing page at / that explains what the project does
and embeds a YouTube link for the hardware demo video. Included a
render.yaml blueprint so forking and deploying is basically one click.
Used Claude Code a lot for the AsyncLocalStorage architecture and the
Render-specific gotchas I wouldn’t have known to look for. Wiring and
testing was still on me, which is where most of the time went anyway.
Log in to leave a comment