Agrolify

A smart greenhouse platform connecting live environmental measurements, remote controls, and automation in one dashboard.
Connecting software with the greenhouse
Agrolify connects physical greenhouses to a Rails API and a React dashboard. Each ESP32 maintains an authenticated WebSocket connection using the same Action Cable protocol as the browser. Measurements stream to the dashboard, while control commands return to the device with confirmation that they were received.
Key features
• Live monitoring: Air and soil temperature, humidity, soil moisture, water-tank level, and GPS updates, with local weather forecasts alongside.
• Remote control: Operate fans, windows, and the water pump from the dashboard, with command confirmation from the device.
• Server-side automation: Evaluate incoming measurements against per-device thresholds, automate fans, and push alerts through a dedicated WebSocket channel. Rules run independently of any connected browser.
• History and watering: Explore measurement charts backed by PostgreSQL, set recurring watering schedules, and review the complete watering log.
• Multiple greenhouses: Attach, detach, and switch between devices in one dashboard, with locations on Google Maps and a multilingual interface.
Software
The backend is a Ruby on Rails 8 API with PostgreSQL, Action Cable WebSockets, and cookie-based JWT authentication, tested with RSpec. The React 19 frontend runs on Vite, using Redux Toolkit and React Router for application state and navigation, Ant Design for the interface, Recharts for historical data, and i18next for localization.
ESP32 firmware is written in C++ with Arduino libraries. WebSocketsClient maintains the live connection, ArduinoJson handles messages, and WiFiManager supports device provisioning.
Hardware
The ESP32 reads air conditions from a DHT21, soil temperature from a DS18B20, soil moisture from a capacitive probe, and water-tank level from an HC-SR04. A GPS module supplies outdoor positioning, while a 16x2 I2C LCD displays readings on site.
A relay board connects the controller to the fan, motorized window openers, and water pump, turning dashboard commands and automation rules into physical actions.
