An intelligent IoT system that monitors air quality and environmental conditions in real-time, featuring live dashboards, threshold alerts, and comprehensive data analytics.
- Real-time Monitoring: Track temperature, humidity, CO2 levels, and noise in real-time
- IoT Integration: MQTT-based sensor communication for scalable device management
- Live Dashboard: Beautiful, responsive dashboard with auto-refreshing charts
- Smart Alerts: Color-coded status indicators for quick health assessment
- Data Persistence: PostgreSQL database for historical data analysis
- Flexible Architecture: Easy to add new sensors and monitoring parameters
- Symfony 8 - Modern PHP framework
- PostgreSQL 15 - Robust relational database
- Doctrine ORM - Database abstraction layer
- PHP 8.2+ - Latest PHP features
- Eclipse Mosquitto - MQTT message broker
- php-mqtt/client - MQTT client library
- Python 3.x - Sensor simulation
- Chart.js - Interactive data visualization
- Vanilla JavaScript - No framework overhead
- Responsive CSS - Mobile-friendly design
- Docker - Containerized MQTT broker
- Git - Version control
- PHP 8.2 or higher
- Composer
- PostgreSQL 15+
- Docker
- Python 3.x (for sensor simulator)
- Git
git clone https://github.com/SamaD-01/zephyrus.git
cd zephyruscd symfony-api
composer installCopy the example environment file and configure your database:
cp .env.example .envEdit .env:
DATABASE_URL="postgresql://YOUR_USER:YOUR_PASSWORD@127.0.0.1:5432/zephyrus?serverVersion=15&charset=utf8"php bin/console doctrine:database:create
php bin/console doctrine:migrations:migratedocker-compose up -dcd iot-simulation
pip install paho-mqttYou need 3 terminals running simultaneously:
cd symfony-api
symfony server:startAccess dashboard at: http://127.0.0.1:8000
cd symfony-api
php bin/console mqtt:subscribecd iot-simulation
python sensor_simulator.pyzephyrus/
βββ symfony-api/ # Symfony backend
β βββ src/
β β βββ Command/ # MQTT subscriber command
β β βββ Controller/ # API & Dashboard controllers
β β βββ Entity/ # Database entities
β β βββ Repository/ # Data repositories
β βββ templates/ # Twig templates
β βββ docker-compose.yml # MQTT broker configuration
β βββ mosquitto.conf # Mosquitto settings
βββ iot-simulation/ # IoT sensor simulator
β βββ sensor_simulator.py # Python MQTT publisher
βββ docs/
GET /api/readings/latestResponse:
[
{
"id": 1,
"deviceId": "simulator-sensor-001",
"temperature": 22.5,
"humidity": 45.0,
"co2": 800,
"noise": 40.2,
"timestamp": "2026-01-16 12:30:45"
}
]GET /api/readings/chartResponse:
{
"labels": ["12:30:45", "12:30:50", ...],
"datasets": [...]
}-
Real-time Cards: Live sensor values with color-coded status
- π’ Green: Normal
- π‘ Yellow: Warning
- π΄ Red: Critical
-
Charts: Multi-line chart showing all metrics over time
-
Auto-refresh: Updates every 5 seconds
-
Responsive Design: Works on desktop, tablet, and mobile
# Subscribe to test topic
docker exec -it zephyrus_mqtt mosquitto_sub -h localhost -t "test/topic"
# Publish test message (in another terminal)
docker exec -it zephyrus_mqtt mosquitto_pub -h localhost -t "test/topic" -m "Hello!"php bin/console dbal:run-sql "SELECT COUNT(*) FROM sensor_reading"For Production:
- Change default MQTT credentials
- Enable MQTT authentication
- Use HTTPS/WSS for web traffic
- Implement user authentication
- Add rate limiting
- Enable CORS properly
- Use environment variables for secrets
# Check if container is running
docker ps
# Restart MQTT broker
docker-compose restart mqtt
# Check logs
docker logs zephyrus_mqtt# Verify PostgreSQL is running
# Check DATABASE_URL in .env
php bin/console doctrine:database:create- Check browser console (F12) for errors
- Verify API endpoints return data:
/api/readings/chart - Ensure sensor simulator is running
- Discord/Email alert system
- Multi-device management panel
- AI anomaly detection
- Historical data export (CSV/Excel)
- Multi-room/location support
- Mobile app
- Cloud deployment (AWS/Heroku)
- Real ESP32 hardware integration
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
Abdessamad
- GitHub: @SamaD-01
- LinkedIn: Abdessamad AJJA
- Portfolio: ajja.surge.sh
- Symfony Framework
- Eclipse Mosquitto
- Chart.js
- PostgreSQL Community
β Star this repository if you find it helpful!
