No description
Find a file
2025-07-27 16:03:16 +03:00
apps Update Grafana configuration and enhance README: rename Grafana container, add health checks, and configure InfluxDB datasource. Introduce new dashboards for DHT11 sensor data visualization and improve documentation for setup and usage. 2025-07-27 16:03:16 +03:00
screenshots Update README and add ESP8266 sensor documentation: change screenshot path, remove old screenshot, and introduce detailed README for DHT11 sensor reader with InfluxDB integration, including configuration and operation instructions. Refactor config and main files for improved measurement interval and retry logic. 2025-07-27 15:45:56 +03:00
.cursorignore Update environment variable handling: add PUBLIC_MEASUREMENT_INTERVAL to Docker configurations, update README and .env.example, and refactor Svelte component to utilize the new interval for data refresh. 2025-07-26 17:46:10 +03:00
.dockerignore Add Docker support for Meter Dashboard PWA with multi-stage build and nginx configuration. Introduced Dockerfile, docker-compose.yml, and optimized nginx settings for performance and security. Updated package.json for Bun compatibility and added .dockerignore files to exclude unnecessary files from builds. Enhanced README with deployment instructions and health check details. 2025-07-24 10:01:17 +03:00
.envrc Add initial setup for DHT11 Sensor Dashboard with SvelteKit. Introduced environment configuration, basic UI components, and InfluxDB integration. Added .env.example and .gitignore files, along with essential styles and utility functions. Updated package dependencies for improved functionality. 2025-07-24 08:19:07 +03:00
.gitignore untrack stats 2025-07-25 11:21:17 +03:00
bun.lock Refactor package.json and bun.lock: reorganize dependencies, remove printenv, and update zod version. Delete obsolete README-Docker.md for cleaner project structure. 2025-07-25 14:26:57 +03:00
docker-compose.prod.yml Update environment variable handling: add PUBLIC_MEASUREMENT_INTERVAL to Docker configurations, update README and .env.example, and refactor Svelte component to utilize the new interval for data refresh. 2025-07-26 17:46:10 +03:00
docker-compose.yml Update Grafana configuration and enhance README: rename Grafana container, add health checks, and configure InfluxDB datasource. Introduce new dashboards for DHT11 sensor data visualization and improve documentation for setup and usage. 2025-07-27 16:03:16 +03:00
flake.lock Refactor project structure and enhance Docker configuration for DHT11 sensor application. Updated .envrc for quiet flake usage, added Docker Compose setup, and included Grafana provisioning files. Introduced new SvelteKit web application for real-time sensor data visualization with InfluxDB integration. Cleaned up unused assets and improved documentation. 2025-07-24 06:55:10 +03:00
flake.nix Refactor project structure and enhance Docker configuration for DHT11 sensor application. Updated .envrc for quiet flake usage, added Docker Compose setup, and included Grafana provisioning files. Introduced new SvelteKit web application for real-time sensor data visualization with InfluxDB integration. Cleaned up unused assets and improved documentation. 2025-07-24 06:55:10 +03:00
LICENSE mend 2025-04-12 23:34:19 +03:00
package.json Update package.json scripts for UI integration, modify environment variable naming for measurement interval, enhance Bulgarian and English translations for dashboard components, and remove unused hooks for cleaner codebase. 2025-07-27 10:13:43 +03:00
README-Docker.md Update environment variable handling: add PUBLIC_MEASUREMENT_INTERVAL to Docker configurations, update README and .env.example, and refactor Svelte component to utilize the new interval for data refresh. 2025-07-26 17:46:10 +03:00
README.md Update Grafana configuration and enhance README: rename Grafana container, add health checks, and configure InfluxDB datasource. Introduce new dashboards for DHT11 sensor data visualization and improve documentation for setup and usage. 2025-07-27 16:03:16 +03:00
screenshot.png Add new screenshots for dashboard and mobile views: include dark and light mode images for enhanced visual representation. 2025-07-27 15:48:54 +03:00
turbo.json mend 2025-04-12 23:34:19 +03:00

🌡️ Meter - IoT Sensor Monitoring System

Mobile Dashboard

A comprehensive IoT sensor monitoring system that collects, stores, and visualizes temperature and humidity data in real-time. Built with modern web technologies and designed for both development and production environments.

📋 What is Meter?

Meter is a complete IoT monitoring solution that consists of:

  • 📡 Sensor Nodes: ESP8266 and Raspberry Pi implementations for data collection
  • 🗄️ Data Storage: InfluxDB time-series database for efficient data storage
  • 📊 Web Dashboard: Modern SvelteKit application with real-time visualizations
  • 📈 Monitoring: Grafana dashboards for advanced analytics and alerting

The system is designed to be modular, allowing you to deploy individual components or the entire stack depending on your needs.

🏗️ Repository Structure

meter/
├── apps/                    # Individual applications
│   ├── web/                # SvelteKit dashboard application
│   │   ├── src/            # Source code
│   │   ├── static/         # Static assets and PWA icons
│   │   └── package.json    # Frontend dependencies
│   ├── esp/                # ESP8266 sensor implementation
│   │   ├── src/            # Arduino source code
│   │   ├── platformio.ini  # PlatformIO configuration
│   │   └── flake.nix       # Nix development environment
│   └── rp/                 # Raspberry Pi sensor implementation
│       ├── main.py         # Python sensor code
│       ├── pyproject.toml  # Python dependencies
│       └── Dockerfile      # Container configuration
├── grafana/                # Grafana dashboards and configuration
│   └── provisioning/       # Dashboard and datasource configs
├── docker-compose.yml      # Production deployment
├── docker-compose.prod.yml # Production configuration
└── README.md              # This file

🚀 Getting Started

# Clone the repository
git clone <repository-url>
cd meter

# Start all services
docker-compose up -d

# Access the dashboard
open http://localhost:8080

Individual App Setup

🌐 Web Dashboard (SvelteKit)

The web dashboard is a modern Progressive Web App built with SvelteKit.

cd apps/web

# Install dependencies
bun install

# Set up environment
cp .env.example .env
# Edit .env with your InfluxDB configuration

# Start development server
bun run dev

# Build for production
bun run build

Key Features:

  • Real-time data visualization with LayerChart
  • Progressive Web App (PWA) with offline support
  • Multi-language support (English & Bulgarian)
  • Responsive design for all devices
  • Dark mode support

Technologies:

  • SvelteKit 2.x with Svelte 5 runes
  • TypeScript for type safety
  • Tailwind CSS for styling
  • LayerChart for data visualization
  • InfluxDB client for data fetching
  • PWA capabilities with service worker

📡 ESP8266 Sensor

Low-power sensor implementation using Arduino framework.

cd apps/esp

# Install PlatformIO CLI (if not installed)
pip install platformio

# Configure credentials
cp src/credentials.example.h src/credentials.h
# Edit src/credentials.h with your WiFi and InfluxDB settings

# Build and upload
pio run --target upload

# Monitor serial output
pio device monitor

Key Features:

  • Deep sleep mode for low power consumption
  • DHT11 sensor support on GPIO D1
  • Automatic WiFi reconnection
  • Configurable measurement intervals
  • Error handling with retry logic

Technologies:

  • Arduino framework for ESP8266
  • PlatformIO for development environment
  • DHT sensor library
  • WiFi and HTTP client libraries
  • Nix development environment

🍓 Raspberry Pi Sensor

Python-based sensor implementation for continuous monitoring.

cd apps/rp

# Install dependencies
uv sync
# or pip install -r requirements.txt

# Configure environment
export INFLUXDB_URL="http://localhost:8086"
export INFLUXDB_TOKEN="your-token"
export INFLUXDB_ORG="your-org"
export INFLUXDB_BUCKET="sensor-data"

# Run the sensor
python main.py

Key Features:

  • Continuous monitoring (no sleep mode)
  • GPIO access for DHT11 sensor
  • Docker support for easy deployment
  • Configurable measurement intervals
  • Robust error handling

Technologies:

  • Python 3.11+
  • Adafruit CircuitPython DHT library
  • RPi.GPIO for hardware access
  • InfluxDB Python client
  • Docker containerization

🛠️ Technology Stack

Frontend (Web Dashboard)

  • Framework: SvelteKit 2.x with Svelte 5 runes
  • Language: TypeScript
  • Styling: Tailwind CSS 4.x
  • Charts: LayerChart with D3.js
  • UI Components: ShadCN Svelte
  • Icons: Lucide Svelte
  • Internationalization: Paraglide JS
  • Build Tool: Vite
  • Package Manager: Bun

Backend & Data

  • Database: InfluxDB (time-series)
  • Monitoring: Grafana
  • Containerization: Docker & Docker Compose
  • Development: Nix (flake.nix)

Hardware & Sensors

  • Microcontrollers: ESP8266 (NodeMCU, Wemos D1 Mini)
  • Single Board Computers: Raspberry Pi
  • Sensors: DHT11 (temperature & humidity)
  • Development: PlatformIO (ESP8266), Python (Raspberry Pi)

DevOps & Deployment

  • Container Orchestration: Docker Compose
  • Environment Management: Nix flakes
  • Package Management: Bun (Node.js), uv (Python)
  • Static Hosting: Vite adapter-static

📊 Data Flow

  1. Sensors (ESP8266/Raspberry Pi) collect temperature and humidity data
  2. InfluxDB stores time-series data with location and device tags
  3. Web Dashboard queries InfluxDB and displays real-time visualizations
  4. Grafana provides advanced monitoring, alerting, and analytics

🔧 Configuration

Environment Variables

# InfluxDB Configuration
VITE_INFLUXDB_URL=http://localhost:8086
VITE_INFLUXDB_TOKEN=your-api-token
VITE_INFLUXDB_ORG=my-org
VITE_INFLUXDB_BUCKET=sensor-data
VITE_INFLUXDB_MEASUREMENT=dht11_reading

Hardware Setup

  1. ESP8266: Connect DHT11 to GPIO D1 (GPIO 5)
  2. Raspberry Pi: Connect DHT11 to GPIO 4
  3. Power: 3.3V supply for sensors
  4. WiFi: Configure network credentials in sensor code

🌐 Access Points

📱 Mobile Experience

The dashboard is fully responsive and works as a Progressive Web App:

  • Install on home screen
  • Offline functionality
  • Push notifications (configurable)
  • Native app-like experience

🔒 Security

  • Environment-based configuration
  • Secure API token authentication
  • CORS protection for web access
  • Production-ready security practices

🤝 Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Test thoroughly
  5. Submit a pull request

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

🆘 Support

  • Check the Docker README for deployment details
  • Review individual app READMEs for specific setup instructions
  • Open an issue for bugs or feature requests

Built with ❤️ for IoT enthusiasts and developers