Overview

Kaivila is a mobile marketplace that digitises agricultural trade by connecting three distinct user groups: farmers who list produce for sale, buyers who place bids or direct purchase offers, and facilitators who verify product quality and manage the transaction on behalf of both parties.

The platform was built to bring transparency and efficiency to a market that historically operated through informal intermediary networks, where farmers often had limited visibility into actual buyer demand and pricing.

The Problem

Agricultural produce markets in India suffer from significant information asymmetry. Farmers list produce at local mandis without knowing what buyers across the district or state are willing to pay. Buyers have limited visibility into available supply. Facilitators — who typically have relationships with both sides — operate without structured tools.

The challenge was to design a marketplace that served three fundamentally different user types simultaneously, each with distinct workflows and visibility requirements, in a single application.

Solution

The platform was built around a real-time bidding model — farmers list produce with quantity, grade, and minimum price; buyers browse listings and place bids; real-time chat enables negotiation between parties; and facilitators manage verification and transaction completion.

The most technically distinctive feature was the configurable visibility system: when a product is listed, it initially appears only to buyers in the farmer's local area. If no successful bid is received within a defined window, visibility expands progressively to district level, then state level, then national — increasing the farmer's potential buyer pool automatically without any manual intervention.

Architecture

  • Mobile App: Flutter application serving three distinct user types (farmer, buyer, facilitator) — each with a role-specific interface and feature set from a single codebase
  • Real-time Bidding: WebSocket-based bid broadcasting — new bids are pushed immediately to all parties viewing a listing without polling
  • Real-time Chat: Firebase Realtime Database for low-latency messaging between buyers and sellers during negotiation
  • Visibility Engine: Background scheduler running configurable expansion rules — evaluates bid activity and expands product geographic visibility on a per-listing timer
  • Product Verification: Facilitator workflow for grading, photo documentation, and quality certification before listing goes live
  • Notification System: Firebase Cloud Messaging for bid alerts, visibility expansion events, and chat messages
  • Backend API: Laravel REST API handling authentication, listing management, bid processing, and reporting
  • Database: MySQL for transactional data; Firebase for real-time chat persistence
  • Infrastructure: Deployed on cloud VPS with Docker and automated deployments

Technologies

Flutter Dart Laravel PHP Firebase Realtime Database Firebase Cloud Messaging MySQL WebSockets Docker REST APIs

Key Challenges

  • Multi-role single app: Designing a Flutter application that serves three distinct user types — with completely different workflows, navigation structures, and feature sets — from a single codebase without code bloat
  • Visibility expansion logic: The configurable market expansion system required careful scheduling, state management, and race condition handling — an expansion triggered mid-bid needed to handle in-flight transactions cleanly
  • Real-time bid consistency: Multiple buyers bidding simultaneously on the same listing could create conflicting state — required server-side bid ordering with optimistic UI and conflict resolution
  • Firebase + MySQL hybrid data: Chat data in Firebase and transactional data in MySQL needed to stay consistent — particularly when a chat-initiated deal needed to be recorded in the main database
  • Rural connectivity: Target users include farmers in areas with 2G connectivity — app needed to function reliably on slow networks with graceful degradation when real-time features were unavailable

Results

  • Three-sided marketplace serving farmers, buyers, and facilitators in a single mobile application
  • Real-time bidding with live push notifications to all interested parties
  • Configurable market visibility expansion system — unique to agricultural marketplace design
  • Real-time chat enabling direct buyer-seller negotiation within the platform
  • Product verification workflow ensuring quality standards before listings go live
  • Published on Google Play Store and Apple App Store