How nemo2547/iot--backend-system works
This is an IoT backend for device telemetry, status lookup, account access, and high-voltage alert dispatch. Its documented cache-aside workflow stores telemetry in PostgreSQL, updates Redis, and serves device status from cache or falls back to PostgreSQL. The sampled application mounts separate telemetry and device routes, while the cache-aside implementation is in an unmounted routes module; the graph preserves both without implying they form one live route. Worker internals were not excerpted, so no queue-consumer behavior is asserted.
Main entry points: app.js API App · routes.js Cached Status · index.js Server Entry · auth.js Auth Routes
Components 14
HTTP API
- Server Entry
src/index.js - API App
src/app.js - Device Routes
src/routes/devices.js
Identity and Access
- Auth Routes
src/routes/auth.js - Token Guard
src/middleware/auth.js
Telemetry and Cache
- Alert Ingest
src/routes/telemetry.js - Cached Status
src/routes/routes.js - Data Clients
src/db/db.js - PostgreSQL
prisma/schema.prisma - Redis Cache
Async Alerts
- Queue Publisher
src/config/rabbitmq.js - RabbitMQ
- Alert Worker
src/worker.js
Other components
- API Client
Connections 17
- API Client → Server Entry: sends requests
readme.txt - Server Entry → API App: starts app
src/index.js - API App → Auth Routes: mounts routes
src/app.js - API App → Device Routes: mounts routes
src/app.js - API App → Alert Ingest: mounts routes
src/app.js - Auth Routes → PostgreSQL: reads and writes
src/routes/auth.js - Device Routes → Token Guard: checks token
src/routes/devices.js - Auth Routes → API Client: returns token
src/routes/auth.js - Alert Ingest → Queue Publisher: publishes alerts
src/routes/telemetry.js - Server Entry → Queue Publisher: connects queue
src/index.js - Queue Publisher → RabbitMQ: sends messages
src/config/rabbitmq.js - Cached Status → Data Clients: uses clients
src/routes/routes.js - Data Clients → PostgreSQL: queries telemetry
src/db/db.js - Data Clients → Redis Cache: connects cache
src/db/db.js - Cached Status → Redis Cache: reads and writes
src/routes/routes.js - Cached Status → PostgreSQL: reads and writes
src/routes/routes.js - RabbitMQ → Alert Worker: possible consumption