Classroom Comfort Monitoring
Air quality and comfort for school classrooms: sensors report CO₂, temperature, humidity and light, an API stores every reading, and a dashboard charts them per school and room.
Thousands of small readings, a few people reading them
Each school sends batches of readings from many rooms and five sensor types, sometimes twice. Staff need one clear view per school and classroom, not raw rows.
- Express / TypeScript API: readings, events and buildings
- Prisma schema and MySQL data model
- Next.js monitoring dashboard with Plotly charts
- JWT auth on both apps
- Jest + Supertest tests, TypeDoc docs, Vagrant dev box
One chart per reading type for the selected school or room.
A small JSON API that the gateways and the dashboard both use.
Typed queries and one schema shared in the repo.
Snapshot tests on the endpoints; docs built from the comments.
A gateway posts all its rooms and sensor types in one request, grouped by type, instead of one call per reading.
Large request bodies; the body limit had to be raised.
A reading is unique by classroom, timestamp and type, so a batch sent twice doesn't create duplicates.
Corrections need a new timestamp or an explicit update.
The dashboard reads only through the API with a token, so gateways and UI share one set of rules.
Two apps to deploy and two places that check JWTs.