Building a Real-Time Aquaculture Intelligence Platform: The AquaStackX Story
Indian aquaculture farmers were losing crops to preventable mortality events — not because the warning signs weren't there, but because there was no system to capture, track, or act on them in time. AquaStackX was built to change that.
The Problem We Were Solving
Indian aquaculture — primarily shrimp and fish farming — is a ₹60,000+ crore industry, but the average farmer is flying blind.
Water quality in a pond can deteriorate within hours. Dissolved oxygen can crash overnight. pH swings after heavy rain. Ammonia builds up when feeding rates are miscalculated. Any of these, left undetected, causes mass mortality — wiping out weeks or months of investment in a single event.
Before AquaStackX, this is what "monitoring" looked like for most farms:
- A technician manually checks parameters once or twice a day with a handheld meter
- Results recorded in a paper logbook — often illegible, never searchable
- Lab reports (pH, ammonia, nitrite, alkalinity, salinity) sent as photos of handwritten forms via personal WhatsApp
- No historical trend visibility. No alerts. No way to correlate water quality shifts with mortality events over time.
The farm owner found out about a problem when it was already too late.
This is our product. We built AquaStackX — we didn't just consult on it. Every architectural decision was a real-world constraint, not a whiteboard exercise.
What We Built
AquaStackX is a mobile-first SaaS platform for aquaculture operations — designed for three distinct actors: farm technicians in the field, lab analysts processing water samples, and farm owners monitoring their operation.
The platform has three layers:
Mobile App (Flutter + Riverpod)
The primary interface for field technicians. Built offline-first — technicians in areas with poor connectivity can log readings that sync automatically when a connection is available.
Core features:
- Pond parameter logging: dissolved oxygen (DO), pH, temperature, salinity, ammonia, nitrite, alkalinity, turbidity
- Water sample submission workflow: technician logs sample → lab receives task → analyst enters results → farmer sees report instantly via push notification
- Mortality event logging with root cause tagging (disease, parameter crash, feeding error, weather)
- Full pond activity timeline: every reading, report, and event in chronological order
Web CRM (React 19 + Vite + TailwindCSS v4)
The management interface for farm owners and operations managers:
- Multi-pond dashboard with real-time status indicators per pond
- Lab report management with parameter trend charts
- Technician activity monitoring and task assignment
- Alert configuration: threshold per parameter, per pond, per actor
Backend API (Express.js + Supabase)
- REST API with structured Pino logging and a
correlationIdon every request — every production issue is traceable by correlation ID in under 10 minutes - Supabase as the primary data layer: PostgreSQL with Row Level Security (RLS) for multi-tenant data isolation
- Supabase Realtime for live subscriptions — a new lab result posted by an analyst appears on the farmer's phone within 2 seconds, without polling
- WhatsApp notification delivery via Meta Cloud API for critical parameter alerts
Technical Architecture
Multi-Tenancy via Row Level Security
Each tenant (aquaculture company) is fully isolated at the database layer via Supabase RLS policies. A technician at Farm A cannot read or write data belonging to Farm B — even if they share the same PostgreSQL instance. RLS enforces this structurally; there is no application-layer filtering to forget or bypass.
Offline-First Mobile
Riverpod state management with local SQLite cache. Pending writes are queued and replayed in creation order when connectivity returns. Conflict resolution: last-write-wins with server timestamp as the authority for parameter readings.
Real-Time Lab Reports
When a lab analyst submits a WaterReport record, Supabase Realtime broadcasts the change to all subscribed clients for that tenant. The farmer's mobile app receives the update via websocket within 2 seconds — no polling, no manual refresh.
The Core Data Model
Deliberately simple. The central entity is the WaterReport — every parameter reading and lab result is a structured record anchored to a specific Pond at a specific timestamp.
| Entity | Description |
|---|---|
| Tenant | The aquaculture company — the billing and isolation boundary |
| Pond | A physical farming unit owned by a Tenant |
| WaterReport | Structured lab analysis: Pond × timestamp × parameter values |
| Actor | A user with a role (farmer, technician, lab_admin) within a Tenant |
| Alert | A threshold configuration per Pond: parameter + threshold + notification targets |
Every WaterReport record is the raw material for the Pond Score ML model — the historical dataset being accumulated in production is what makes predictive scoring possible (see the Pond Score case study).
Results
Since deployment:
- Critical event response time improved by 68% — threshold alerts fire within 2 minutes of a parameter crossing the configured limit. Previously, a technician might not notice until the next manual check — up to 12 hours later.
- Lab report turnaround dropped from 2–3 days to under 5 minutes — analysts submit results digitally; farmers receive push notifications instantly.
- Farm technicians manage 40+ ponds from a single mobile dashboard, vs manually visiting, testing, and logging each pond individually.
- Mortality event data is now 100% structured and searchable — previously scattered across WhatsApp chats and paper notebooks.
- Zero data isolation incidents — RLS-enforced multi-tenancy has held across all tenant onboardings.
What This Demonstrates for Client Engagements
Every pattern in AquaStackX is directly applicable to enterprise field data platforms:
- Multi-tenant RLS → any SaaS platform that needs structural data isolation between customers
- Offline-first mobile → field teams in manufacturing, logistics, agriculture, or construction with intermittent connectivity
- Real-time event broadcasting → operational dashboards that need live status without polling
- Structured audit trail → any regulated industry that needs traceable records of what happened, when, and by whom
We built this. We run it. We know exactly where the edge cases are.
Not Sure Where to Start?
Book a free 30-minute strategy session with a senior data architect — no pitch, no obligation.
Schedule Your Free Strategy Session