Coding smart solutions for off-grid farming
Published: May 17, 2026
In my latest update for the Uni-Farm app, I tackled a major challenge for agricultural technology: monetization in areas with spotty internet. Today, I am breaking down how I built a freemium model that works completely offline.
Most freemium apps check a cloud database every time a user tries to perform an action to see if they have "credits" left. But out in the field, a farmer might not have a reliable 4G or 5G connection. If the app has to wait for a server response to scan a leaf, the app hangs and the user experience is ruined.
Instead of relying on the cloud for every scan, I engineered an offline-first wallet utilizing the phone's native browser storage. Here is the core logic I used to check the user's scan limits instantly:
When the user presses the scan button, the app checks the local uniFarmScannerWallet immediately—no internet required. It prioritizes paid scans first. If paidScansRemaining > 0, it deducts one and allows the scan. If they are out of paid scans, it checks if they have hit their limit of freeScansUsed.
This approach has two massive benefits:
By building offline-first, I am ensuring the app remains a reliable tool for farmers, regardless of where they are planted.