"Digital Agriculture shouldn't stop where the Internet stops."
BeejX is an Offline-First Super App designed to empower the 400 million smallholder farmers in India who struggle with connectivity. It combines Edge AI (On-device LLMs), IoT (Soil Monitoring), and Computer Vision (Disease Detection) into a single, seamless Flutter application.
While the world talks about "Cloud AI," a farmer in a remote hill village in Uttarakhand has no signal.
- Existing apps fail without 4G.
- IoT Hardware is too expensive ($500+).
- Disease Diagnosis requires sending photos to a server (which fails due to latency).
- Everything at ONE Place
We built an operating system for the farm that works 100% Offline when needed, and syncs to the cloud when possible.
- 🧠 Offline Brain (Samvaad): Runs Google's Gemma-2 (270M) LLM locally on the phone. Farmers can ask "How to fix yellow leaves?" in Hindi/English without internet.
- 👁️ Vaidya (Crop Doctor): Uses a custom MobileNetV2 (TFLite) model to detect diseases like Rice Blast or Wheat Rust in < 200ms using the camera.
- 📡 Bijuka (IoT Sentinel): A low-cost (< ₹2000) hardware kit (Arduino + ESP8266) that monitors Soil pH and Moisture live.
- 📒 Lekha (Smart Ledger): Digitizes farm expenses by scanning bills using OCR.
This project is built almost entirely on Google Technologies:
- Mobile: Flutter (Dart) - Material 3 Design.
- Backend: Firebase (Auth, Realtime Database for IoT).
- AI (Cloud): Gemini API (for complex Query RAG).
- AI (Edge): TensorFlow Lite (Vision) + Gemma (Text via
llama.cpp). - Hardware: ESP8266 NodeMCU + Arduino Mega.
Building BeejX wasn't just about writing UI code. It was a battle against hardware constraints. Here is the real story:
Getting an LLM to run on an Android phone was the hardest part.
- The Challenge: Integrating
llama.cppwith Flutter using Dart FFI. I initially faced constant crashes because the Android NDK libraries weren't linking correctly. - The Fix: I had to manually configure
ndk.abiFilters 'armeabi-v7a', 'arm64-v8a'inbuild.gradleand ensure the.ggufmodel was quantized toq8_0to balance speed and accuracy without blowing up the RAM.
Connecting an Arduino to a beautiful Flutter UI sounds easy, but "Real-time" is hard.
- The Challenge: The ESP8266 would sometimes disconnect in the field, causing the App to show stale data (e.g., showing "Pump ON" when it was actually OFF).
- The Fix: I implemented a Heartbeat Mechanism in Firebase. The hardware updates a timestamp every 5 seconds. If the Flutter app sees the timestamp is > 10 seconds old, it instantly grays out the UI and shows a "Sensor Offline" warning.
Most Agri-apps look like boring government forms.
- The Goal: I wanted BeejX to look like a premium SaaS product.
- The Solution: I used Glassmorphism (frosted glass effects) and
fl_chartfor the Bijuka dashboard. Adapting these high-end visuals to perform smoothly on low-end devices required optimizing the render loop to avoid "Jank."
- Clone the Repo:
git clone https://github.com/BhashkarFulara369/BeejX.git
- Dependencies:
flutter pub get
- Model Setup:
- Download
gemma-2-270m-it.gguf(Quantized). - Place it in the phone's storage or assets.
- Download
- Run:
(Note: Connect a physical Android device. Emulators are too slow for the Offline Brain.)
flutter run --release
- Voice-to-Voice (Hinglish): Fully conversational mode using OpenAI Whisper (Offline).
- LoRaWAN Support: Replacing ESP8266 Wi-Fi with LoRa for 5km+ range.
- Drone Integration: For aerial disease mapping.
me it's me