Delivered remotely for a business based in Austin, United States. Names withheld by agreement.
Project Overview
Irrigated acreage depends on tightly coordinated hardware: deep-well turbine pumps, variable frequency drives, mainline pressure transducers, soil moisture probes, and automated pivot or drip valves. When those assets are scattered across non-contiguous tracts, operators historically relied on physical truck rolls to verify pump status, adjust run timers, or diagnose tripped breakers. That manual loop creates blind spots during peak evapotranspiration windows, turning minor hydraulic anomalies into flooded headlands or stressed crops.
This engagement produced a unified monitoring and remote actuation platform spanning an iOS and Android field app in React Native and a desktop React operations portal. Backed by TypeScript domain contracts, local SQLite persistence, and Firebase cloud infrastructure, the platform translates raw controller signals into actionable hydraulic dashboards while allowing authorized crews to govern watering cycles from anywhere.
Field & Telemetry Bottlenecks
Deploying software into working farmland exposes realities that conventional office applications rarely confront:
- Intermittent rural coverage: Technicians standing beside a pump house frequently drop to weak edge signal or zero data, causing naive API-driven apps to hang mid-command or display stale sensor states without warning.
- Dangerous command ambiguity: If an operator taps "Start Pump" inside a dead zone and the app silently retries twenty minutes later after another worker manually locked out the panel, equipment damage or safety hazards can follow.
- Fragmented hardware dialects: Ranches often run mixed generations of RTUs, flow meters, and valve controllers whose raw register maps mean little to irrigators comparing daily acre-inches applied.
- Alert fatigue during peak season: Streaming every raw voltage blip as a push notification trains crews to ignore critical alarms when a mainline genuinely ruptures.
Architectural Strategy
We structured the system around an explicit separation between authoritative hardware state and optimistic operator intent. Rather than pretending a mobile phone can talk directly to a pump in real time over flaky rural LTE, every state transition passes through deterministic state-machine validation with timestamps, freshness indicators, and precondition checks.
Sharing a strict TypeScript core across the React web dashboard, the React Native client, and Firebase Cloud Functions eliminated drift between sensor parsing, unit conversions, and validation rules. On mobile devices, SQLite serves as the primary read-and-queue engine so crews never stare at loading spinners while driving between blocks.
Core Capabilities
- Live Hydraulic & Zone Topology: Interactive farm maps and schematic cards show active pump amperage, discharge pressure, flow rates, reservoir levels, and soil moisture curves per block.
- Precondition-Guarded Remote Actuation: Authorized operators can start, pause, or override irrigation sets, adjust fertigation dosing schedules, and trigger emergency shutoffs with two-step confirmation.
- Offline Field Operations & Command Outbox: Full zone history, valve maps, and maintenance logs remain browsable offline in SQLite, alongside a visible outbox of queued schedule edits waiting for signal.
- Tiered Threshold Alerting: Configurable rules distinguish informational completion notices from critical dry-run, over-pressure, power-loss, and low-flow alarms pushed via Firebase Cloud Messaging.
- Water Allocation & Runtime Auditing: Immutable logs pair every irrigation cycle with totalized flow volume and operator attribution for groundwater district reporting.
Technical Architecture
Field gateways aggregate Modbus and SDI-12 readings from local pump panels and sensor nodes, publishing normalized telemetry frames over MQTT to a cloud ingestion bridge. Serverless Cloud Functions validate device signatures, evaluate alarm thresholds, and update Firebase state documents that stream directly to connected React web dashboards and React Native clients.
Flow: Field Sensors & RTUs → Cellular/LoRaWAN Gateway (MQTT) → Cloud Ingestion Bridge → Firebase Cloud Functions & Firestore/RTDB → React Web Console & React Native App (SQLite Local Cache & Outbox)
On the mobile client, an inbound sync worker mirrors assigned ranch subgraphs from Firebase into normalized SQLite tables. UI components read exclusively from SQLite via reactive hooks, guaranteeing instant screen transitions regardless of signal quality. Outbound commands follow the reverse path: a user action writes a pending record to SQLite with a short time-to-live window, and a background network monitor submits it to a Cloud Function that verifies current controller revision numbers before issuing an MQTT actuation message back to the gateway.
Technology Stack
| Category | Technology detail |
|---|---|
| Mobile Application | React Native (iOS and Android cross-platform builds) |
| Web Operations Console | React SPA with responsive field-map and schedule views |
| Language & Shared Contracts | TypeScript across mobile, web, and telemetry payload schemas |
| On-Device Persistence | SQLite local store for offline zone snapshots and command outbox |
| Real-Time State & Sync | Firebase Cloud Firestore and Realtime Database listeners |
| Authentication & Access | Firebase Authentication with custom role-scoped claims |
| Alerting & Push Delivery | Firebase Cloud Messaging for fault, pressure, and frost alerts |
| Field Telemetry Transport | MQTT broker bridge translating cellular/LoRaWAN controller frames |
| Serverless Command Relay | Firebase Cloud Functions for validation and gateway dispatch |
Engineering Trade-offs & Solutions
| Engineering Challenge | Solution & Trade-off |
|---|---|
| Firebase offline cache lacks complex multi-table filtering for large ranches | Paired Firebase sync streams with local SQLite tables in React Native; added a thin synchronization mapper in exchange for fast relational queries over thousands of valve logs offline. |
| Delayed offline retries could execute stale pump commands unexpectedly | Attached explicit TTL deadlines and last-known controller state revisions to every queued SQLite command; expired or conflicted commands fail safe instead of actuating hardware late. |
| Continuous sensor chatter risks high cellular data bills and noisy UIs | Implemented edge deadband filtering and scheduled rollup intervals on field gateways, reserving immediate unbatched publishing strictly for fault transitions and user-initiated polls. |
| Web dispatchers and mobile field crews needed identical unit math | Centralized pressure, flow-rate, and evapotranspiration calculations into a shared TypeScript package rather than maintaining separate mobile and browser business logic. |
Security & Reliability
Physical water infrastructure requires defensive controls at every layer. Operators authenticate through Firebase Authentication backed by short-lived tokens and custom claims defining which farms and valve groups they can view or actuate. Read-only advisors such as agronomists inspect soil moisture trends without seeing control toggles.
Server-side Firebase Security Rules block direct client writes to authoritative hardware state nodes. Clients write only to command-request endpoints where Cloud Functions enforce safety interlocks—such as blocking pump startup if downstream valves report closed or a maintenance lockout flag is active. Every command, acknowledgment, and timeout writes an append-only audit entry.
Performance & Scale
To keep React Native rendering fluid on field tablets, telemetry charts downsample historical series cleanly based on viewport width while preserving peak and fault markers. Firebase listeners subscribe selectively to the active ranch or pivot group rather than hydrating entire catalogs into memory.
In the React web console, dispatchers managing concurrent blocks rely on virtualized status tables and memoized map layers updating only the changed marker. Cloud Functions remain stateless and horizontally scalable, absorbing morning startup surges and synchronized storm-shutdown broadcasts cleanly.
Operational Outcomes
Moving irrigation oversight from clipboard checks and fragmented vendor portals into a unified cross-platform system transformed daily ranch execution:
- Faster fault intervention: Crews receive targeted pump-trip and pressure-drop alerts immediately, isolating mainline leaks and dry-well conditions before crops enter moisture stress.
- Elimination of unnecessary field drives: Dispatchers verify system pressure, remaining pivot arc, and cumulative flow remotely from the React console or mobile app prior to rolling service trucks.
- Predictable offline fieldwork: Technicians work uninterrupted in remote corners of a property, with clear visual indicators showing telemetry age and synchronized command confirmation.
- Defensible water stewardship: Complete runtime and metered volume records simplify seasonal water-district compliance and irrigation efficiency reviews across blocks.