How simm36465/smart-irrigation works
Purpose and Scope
AquaFlow is a Flutter client for a smart-irrigation system. It presents irrigation monitoring/control UI for an ESP32-based installation with sensors, pump, and valves. The repository contains the mobile/desktop/web Flutter application; ESP32 firmware, circuit assets, and backend/service code are not present.
Application Entry and Runtime Shell
• Flutter starts at lib/main.dart, with top-level navigation/home composition in lib/home.dart.
• Native launchers embed the Flutter runtime: Android’s android/app/src/main/kotlin/com/example/aquaflow/MainActivity.kt, iOS’s ios/Runner/AppDelegate.swift, and desktop runners under linux/, macos/, and windows/.
• The intended primary target is Android, including Firebase configuration at android/app/google-services.json; the file tree also supports iOS, web, Linux, macOS, and Windows builds.
Authentication Boundary
• lib/login.dart is the dedicated login screen and likely gates entry to the operational dashboard.
• Authentication/provider implementation is not visible in the supplied tree. Any identity, session persistence, or Firebase integration should be treated as an external boundary rather than assumed to be implemented.
Operational Dashboard and Navigation
• lib/home.dart is the likely post-login hub that routes users among irrigation capabilities.
• Feature screens are separated by operational domain under lib/Screens/, keeping monitoring/control presentation modular rather than placing all behavior in the platform runner.
Sensor and Actuator Control
• lib/Screens/capteurs.dart represents sensor readings, matching the system’s soil-moisture, temperature, and humidity monitoring use case.
• lib/Screens/vanes.dart represents valve (“vanes”) control; it is the UI boundary for manual irrigation/flow actions.
• Commands and telemetry are expected to cross from this app to the ESP32 over Wi‑Fi or Bluetooth, but no transport client, ESP32 protocol, or firmware source appears in this repository.
Water State and Historical Analysis
• lib/Screens/reservoirScreen.dart provides a reservoir-oriented view, likely for water-level/status visibility.
• lib/Screens/historyScreen.dart provides historical data visualization or review.
• These screens consume or present system state, but no local database, API layer, or cloud persistence implementation is present in the tree; data-source contracts remain an integration boundary.
Weather Inputs and Static Domain Data
• lib/Screens/weather.dart provides weather-related irrigation context.
• assets/json/weathercode.json is packaged static mapping data for weather codes, likely translating provider/API conditions into display semantics.
• A remote weather provider may be intended, but no explicit client/service implementation is present.
Build, Assets, and Infrastructure
• Flutter dependencies and asset declarations are defined by pubspec.yaml; resolved versions are in pubspec.lock.
• Android Gradle setup is under android/app/build.gradle; Firebase Android metadata is supplied in android/app/google-services.json.
• Platform directories (android/, ios/, web/, linux/, macos/, windows/) are generated host integration layers, while application architecture is concentrated in lib/.
Components 16
Flutter application
Application UI and navigation.
- Flutter entry
lib/main.dart - Home hub · Post-login operational navigation.
lib/home.dart - Login screen · Authentication implementation is external.
lib/login.dart
Operational screens
Irrigation-domain presentation.
- Sensor readings · Soil moisture, temperature, and humidity presentation.
lib/Screens/capteurs.dart - Valve control · Manual irrigation and flow actions.
lib/Screens/vanes.dart - Reservoir status
lib/Screens/reservoirScreen.dart - History
lib/Screens/historyScreen.dart - Weather context
lib/Screens/weather.dart - Weather code map
assets/json/weathercode.json
Build and host integration
Flutter platform embedding and packaging.
- Flutter manifest
pubspec.yaml - Android host · Primary intended deployment target.
android/app/src/main/kotlin/com/example/aquaflow/MainActivity.kt - Android build and Firebase metadata
android/app/build.gradle - Other Flutter hosts · iOS, web, Linux, macOS, and Windows are supported.
Other components
- ESP32 device transport · Telemetry and commands over Wi-Fi or Bluetooth are not implemented here.
- State and history source · No API, database, or persistence layer is present.
- Identity provider · Session and provider implementation are not visible.
Connections 18
- Android host → Flutter entry: launches Flutter
- Other Flutter hosts → Flutter entry: launch
- Flutter manifest → Flutter entry: defines dependencies/assets
- Android build and Firebase metadata → Android host: builds
- Flutter entry → Login screen: starts UI flow
- Login screen → Identity provider: authenticates via
- Login screen → Home hub: enters dashboard
- Home hub → Sensor readings: navigates to
- Home hub → Valve control: navigates to
- Home hub → Reservoir status: navigates to
- Home hub → History: navigates to
- Home hub → Weather context: navigates to
- Sensor readings → ESP32 device transport: receives telemetry
- Valve control → ESP32 device transport: sends commands
- Reservoir status → State and history source: reads state
- History → State and history source: reads historical data
- Weather context → Weather code map: maps conditions
- Weather context → State and history source: may consume weather data