EcoGrow is an integrated IoT solution designed for precision agriculture. The platform leverages edge computing, real-time telemetry, and predictive analytics to monitor greenhouse environments and mitigate biological risks to plant growth.
The system utilizes an ESP32-based hardware layer to collect high-granularity sensor data, which is then processed through a dual-service backend architecture to provide real-time monitoring, AI-driven risk assessment, and comprehensive historical reporting.
The EcoGrow ecosystem is partitioned into several distinct functional layers:
- ESP32 Microcontroller: Serves as the primary IoT gateway.
- Sensor Integration: Captures temperature, relative humidity, and CO2 concentrations.
- Data Ingestion: Transmits telemetry over MQTT to the centralized broker.
- MQTT (Paho): High-performance messaging protocol for low-latency data transmission.
- Socket.io: Enables bi-directional, real-time communication between the backend services and the presentation layer.
- IoT Hub: Manages MQTT client sessions and sensor data normalization.
- Inference Engine: Executes predictive models to identify risks of bacterial or fungal proliferation.
- Background Scheduler: Periodically evaluates environmental conditions and triggers autonomous alerts.
- Data Persistence: Interfaces with MySQL for historical record-keeping.
- Authentication Microservice: Handles JWT-based user authentication and Google OAuth 2.0 integration.
- Secure Sessions: Implements cookie-based session management and identity verification.
- Monitoring Dashboard: Real-time visualization using Recharts for telemetric data.
- Administrative Interface: Dedicated portal for user management and system status monitoring.
- Risk Analytics: Dedicated interface for AI-generated environmental insights.
- Predictive Analytics: Integrated with Gemini AI for advanced environmental risk forecasting and mitigation suggestions.
- Telemetry Processing: Real-time data stream processing with sub-second latency from edge to dashboard.
- Identity Management: Modular authentication service with support for multi-provider login and role-based access control (RBAC).
- Automated Testing: Comprehensive end-to-end validation suite using Selenium.
ecogrow/
├── src/ # Frontend Application (React/Vite)
│ ├── pages/ # Functional views (Dashboard, Admin, Auth)
│ ├── components/ # Modular UI elements
│ └── services/ # API integration layer
├── server/
│ ├── backend/ # Core IoT and AI Service (Python/Flask)
│ │ ├── app.py # Service entry point and scheduler
│ │ ├── ai_service.py # Risk analysis logic
│ │ └── mqtt_service.py # Telemetry ingestion client
│ ├── index.js # Authentication Service (Node.js/Express)
│ └── db/ # Database schema and migration scripts
├── seleniumtest.py # E2E Automation Suite
└── package.json # Deployment and dependency configuration
- Python 3.9+
- Node.js 18+
- MySQL Server 8.0+
- MQTT Broker (EMQX or Mosquitto recommended)
Execute the following SQL commands or import server/db/schema.sql into your MySQL instance:
CREATE DATABASE ecogrow_db;Navigate to server/backend/ and install dependencies:
pip install -r requirements.txtConfigure external service parameters in the .env file (Database, MQTT Broker, Gemini API Key).
Start the core service:
python app.pyInstall Node.js dependencies in the project root:
npm installStart the authentication microservice:
npm run dev:serverInitialize the Vite development server:
npm run devThe project includes a Selenium-based automated testing suite for validating critical user flows:
- TC01: Authenticated session establishment.
- TC02: CSV/Excel report generation and data export validation.
- TC03: Real-time notification toggle and UI state persistence.
To execute tests:
python seleniumtest.pyThe application is architected for deployment on AWS EC2 instances. Ensure that the security groups are configured to allow traffic on the following ports:
- 5173: Frontend Development Server
- 5000: Core IoT/AI Service
- 4000: Authentication Microservice
- 8883/1883: MQTT Broker Traffic