How youssef-reda440/cse3-iot-labs works
This lab is a small browser-based IoT lamp dashboard. A user opens the dashboard, which displays lamp controls and sends lamp commands over WebSocket; the server hosts the page and accepts WebSocket connections. The sampled WebSocket handler only logs commands and replies with acknowledgements—it does not control hardware. The lamp and log service files are empty in the excerpts, so no behavior is attributed to them. The HTML is served by the HTTP app, but its script wiring was not sampled.
Main entry points: websocket.js WebSocket handler · index.js Runtime entry · server.js HTTP app · index.html Dashboard page
Components 6
Server runtime
- Runtime entry
labs/lab-01/index.js - HTTP app
labs/lab-01/server/server.js
Browser dashboard
- Dashboard page
labs/lab-01/views/index.html - Dashboard controls
labs/lab-01/views/js/dashboard.js
WebSocket transport
- WebSocket handler
labs/lab-01/websocket/websocket.js
Other components
- User
Connections 6
- User → Dashboard page: opens
- Runtime entry → HTTP app: creates server
labs/lab-01/index.js - Runtime entry → WebSocket handler: attaches handler
labs/lab-01/index.js - HTTP app → Dashboard page: serves
labs/lab-01/server/server.js - Dashboard controls → WebSocket handler: sends commands
- WebSocket handler → User: replies to client
labs/lab-01/websocket/websocket.js