A real-time temperature monitoring dashboard with data processing, statistics, and visualization capabilities.
Temperature Monitor is a distributed system that collects, processes, and visualizes temperature data in real-time. The project consists of multiple microservices working together to provide a seamless monitoring experience.
- Real-time Temperature Monitoring: Live updates via WebSocket connections
- Statistical Analysis: Calculate mean, median, mode, and extremes
- Interactive Dashboard: Beautiful UI with temperature visualizations
- Unit Conversion: Toggle between Celsius and Fahrenheit
- Time Range Selection: View data from the last hour to the last week
The project consists of the following components:
- WebSocket Server: Handles real-time data streaming
- Alert Lambda: Processes temperature alerts based on thresholds
- Stats Lambda: Calculates statistical data about temperatures
- Website: React-based UI for data visualization
- Dummy Sensor: Simulates temperature data for testing
-
Backend:
- Go (WebSocket server, dummy sensors)
- Python (Lambda functions with FastAPI)
- SQLite (Data storage)
- SQLC (SQL query generation)
-
Frontend:
- React
- TypeScript
- Recharts (data visualization)
- Bun (JavaScript runtime/bundler)
- Shadcn UI components
- Go 1.19+
- Python 3.10+
- Bun
- uv (Python package manager)
- sqlc
- air (for live reloading)
Clone the repository:
git clone https://github.com/your-username/temperature-monitor.git
cd temperature-monitorGenerate all required files:
make genThis command will:
- Generate database queries for the WebSocket server
- Set up virtual environments for both lambda functions
- Install dependencies for the website
- Prepare the dummy sensor
Start all services in development mode with hot-reloading:
make dev/websocket # Start WebSocket server
make dev/alert-lambda # Start alert processing service
make dev/stats-lambda # Start statistics service
make dev/website # Start frontend development server
make dev/dummy-sensor # Start dummy data generatorOr run individual services as needed.
Build all components:
make buildThis creates optimized builds for the WebSocket server, dummy sensor, and website.
Start all services in production mode:
make preview/websocket
make preview/alert-lambda
make preview/stats-lambda
make preview/website
make preview/dummy-sensorThe temperature dashboard provides:
- Current temperature display with visual indicators
- Historical temperature chart
- Statistical data (mean, median, mode, highest, lowest)
- Time range selection (1h, 12h, 1d, 1w)
- Unit toggle (°C/°F)
- Dark/light mode toggle
- WebSocket connection status indicator
To clean all generated files and build artifacts:
make cleanContributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
Made with ❤️ for temperature enthusiasts everywhere
