How greeneye-ai/greeneyeai-server works
This is a greenhouse monitoring and control service: browser and ESP clients interact with a Python server that records sensor/device state, queues relay commands, and exposes schedules, charts’ data, plant status, and a camera stream. The main runtime orchestrates automatic light/water/fan schedules and optional camera-based plant classification. Edges reflect calls and route registration visible in the excerpts; the README is empty and browser implementation details are only partly sampled.
Main entry points: server.py HTTP server · main.py Application runtime · web_paths.py Web API handlers · database.py SQLite worker
Components 20
Runtime orchestration
- Application runtime
main.py
HTTP service
- HTTP server
server/server.py - Request parser
server/request.py - Response builder
server/response.py - HTTP statuses
server/status.py - Static asset cache
server/cluster.py
Greenhouse control
- Web API handlers
web_paths.py - ESP API handlers
esp_paths.py - Automatic schedules
main.py - Relay command queue
web_paths.py
State and storage
- Shared runtime state
server/data.py - SQLite worker
server/database.py - SQLite database
main.db - Schedule file
schedule.json
Camera and plants
- Camera capture
main.py - Plant classifier
main.py - YOLO model
best.pt - Video stream API
web_paths.py
Other components
- Browser UI
- ESP device
Connections 33
- Browser UI → HTTP server: sends HTTP
- ESP device → HTTP server: sends HTTP
- HTTP server → Request parser: parses requests
server/server.py - HTTP server → Response builder: sends responses
server/server.py - Response builder → HTTP statuses: uses codes
server/response.py - HTTP server → Static asset cache: serves assets
server/server.py - Application runtime → HTTP server: constructs and starts
main.py - Application runtime → Web API handlers: registers routes
main.py - Application runtime → ESP API handlers: registers routes
main.py - HTTP server → Web API handlers: dispatches handlers
server/server.py - HTTP server → ESP API handlers: dispatches handlers
server/server.py - HTTP server → Shared runtime state: shares state
server/server.py - HTTP server → SQLite worker: shares database
server/server.py - HTTP server → Static asset cache: updates cache
server/server.py - Application runtime → SQLite worker: creates schema
main.py - SQLite worker → SQLite database: reads and writes
- Web API handlers → Shared runtime state: reads and updates
web_paths.py - Web API handlers → SQLite worker: queries and inserts
web_paths.py - Web API handlers → Relay command queue: enqueues commands
web_paths.py - ESP API handlers → Relay command queue: reads and acknowledges
esp_paths.py - ESP API handlers → SQLite worker: records telemetry
esp_paths.py - Automatic schedules → Shared runtime state: checks mode and schedule
main.py - Automatic schedules → SQLite worker: reads device state
main.py - Automatic schedules → Relay command queue: enqueues relay actions
main.py - Web API handlers → Schedule file: saves schedule
web_paths.py - Application runtime → Schedule file: loads schedule
main.py - Camera capture → Shared runtime state: publishes JPEG frames
main.py - Plant classifier → Shared runtime state: waits for frames; stores labels
main.py - Plant classifier → YOLO model: loads model
- Video stream API → Shared runtime state: streams frames
web_paths.py - Application runtime → Camera capture: starts capture
main.py - Application runtime → Plant classifier: starts processing
main.py - Web API handlers → Video stream API: registers stream handler
main.py