A simple, live IoT dashboard demo showcasing how to create real-time data visualization for Superstack deployments using just two core files.
This single-page web application demonstrates how to build a live dashboard for viewing IoT sensor data from Superstack deployments. The dashboard displays real-time data from four different IoT device types:
- Air Quality Sensors - Air quality index, CO2, volatile compounds, and humidity
- Power Meter - Voltage, current, and power consumption
- Color Sensor - Light spectrum analysis across multiple wavelengths
- Trash Level Sensor - Fill level monitoring
To see the code running on each device, check out the Superstack deployment here.
The entire dashboard is built with just two main files:
- Contains the complete UI structure with navigation tabs for each IoT device type
- Uses BeerCSS for modern, responsive styling
- Includes Chart.js for data visualization
- Features a settings panel where users can enter their deployment ID and API key
- Handles all the application logic and data fetching
- Imports chart configurations from
chart-settings.js
- Runs a timer loop that fetches data from the Superstack API every second
- Updates charts and displays in real-time based on the latest sensor readings
- Manages connection status and error handling
Only two external libraries are used:
- BeerCSS - Modern CSS framework for styling and responsive design
- Chart.js - Powerful charting library for creating interactive data visualizations
index.html
– Main HTML file with UI structuremain.js
– Core application logic and data fetchingchart-settings.js
– Chart configuration and setupsimulated-data.js
- Data that is used to render the graphs while not connected
- Data Fetching: The app polls the Superstack API every second to get the latest sensor data
- Real-time Updates: Charts and displays update automatically as new data arrives
- Responsive Design: Works on desktop, tablet, and mobile devices
- Error Handling: Shows connection status and handles API errors gracefully
- Clone this repository
- Open
index.html
in a web browser - Navigate to the Settings tab
- Enter your Superstack deployment ID and API key
- The dashboard will automatically connect and start displaying live data
- Stored securely on a backend server
- Never exposed in client-side code
- Protected using proper authentication and authorization
- Never shared publicly in HTML or JavaScript files
Visit the live demo at: https://demos.siliconwitchery.com
Feel free to submit issues and enhancement requests!