A device-management backend and dashboard for an organisation's sensors: per-device access tokens, temperature and file ingestion buffered through a Redis queue and written in batches, and a dashboard for devices, keys, files, and users.
IoT Manager is where an organisation registers its devices and where those devices send their data: temperature readings, uploaded files, and whatever comes next.
Each device gets its own access token, which it uses to post readings and files to the API. A dashboard lets the organisation manage devices, regenerate keys, browse and download files, and manage users. It's SvelteKit with Drizzle ORM on SQLite, plus Redis and BullMQ for ingestion, and the whole thing is packaged with Docker Compose.
Devices talk in small, constant bursts. The database prefers fewer, larger writes.
Incoming readings aren't written straight to SQLite. Each one becomes a job on a BullMQ queue in Redis. A worker takes up to a hundred waiting jobs at a time, sorts them into temperature readings and file records, inserts each group in one statement, and removes the jobs once the write succeeds. A short Redis lock with a set-if-absent expiry means only one worker drains the queue in any one-second window, even with several instances running.