How netitto0/hydrotwin works
HydroTwin is a web-based irrigation simulator: users manage zones in a dashboard, inspect weather and history, and trigger manual irrigation or simulation ticks. The FastAPI application validates requests, obtains weather, applies simulation rules, and persists zone state, readings, and events. The README documents the dashboard’s charts, controls, and API capabilities. Some implementation details are unsampled, so edges rely on shown calls or README statements where noted.
Main entry points: main.py REST routes · app.js Dashboard client · simulation.py Simulation rules · weather.py Weather client
Components 11
Dashboard
- Dashboard client
static/app.js - Dashboard page
static/index.html - Dashboard styles
static/styles.css
API
- REST routes
app/main.py - Request and response schemas
app/schemas.py
Irrigation
- Simulation rules
app/services/simulation.py - Weather client
app/services/weather.py
Persistence
- Zone and event models
app/models.py - SQLite session and engine
app/database.py
Other components
- Irrigation user
- Open-Meteo
Connections 14
- Irrigation user → Dashboard client: uses
README.md - Dashboard client → Dashboard page: renders
README.md - Dashboard page → Dashboard styles: uses
README.md - Dashboard client → REST routes: requests
static/app.js - REST routes → Request and response schemas: validates
app/main.py - REST routes → Simulation rules: runs ticks
app/main.py - REST routes → Weather client: fetches weather
app/main.py - Simulation rules → Weather client: uses snapshot
app/services/simulation.py - Weather client → Open-Meteo: requests forecast
app/services/weather.py - REST routes → SQLite session and engine: opens sessions
app/main.py - REST routes → Zone and event models: reads and writes
app/main.py - Simulation rules → Zone and event models: updates and records
app/services/simulation.py - Zone and event models → SQLite session and engine: maps entities
app/models.py - Dashboard client → Dashboard client: renders history and charts
static/app.js