Mitra3M
Back to Projects
enterprise2024

Mitra3M

A comprehensive digital ecosystem for modernizing aquaculture management and empowering fish farmers.

Mitra3M Preview

The Overview

Mina Mitra Pembudidaya is a mobile application designed to help fish farmers (pembudidaya) manage their ponds, track cultivation cycles, and optimize yields. Unlike typical record-keeping apps, Mina Mitra integrates a Decision Support System (DSS) based on the Analytical Hierarchy Process (AHP) to assist farmers in making scientific, data-driven decisions regarding feed selection, water quality management, and harvest timing.

The Challenge

The main engineering challenge was building a complex data-collection tool that feels simple and intuitive for users who may not be tech-savvy, often working in remote areas with poor connectivity.

  • Constraint: The app must be fully functional offline, syncing data reliably when connectivity is restored.
  • Complexity: Implementing the AHP Algorithm directly on the mobile client to provide instant feedback without server round-trips.

Technical Decisions & Trade-offs

Every tool was chosen with a specific purpose. Here is why I chose this stack over others:

DecisionWhy I Chose ItTrade-off / Alternative Considered
Flutter BLoC (Cubit)Strict state management was crucial for handling the complex lifecycle of a fish pond (active, harvest, failed).More boilerplate than Provider, but necessary for the complex state flows of multi-step forms.
Dio (Custom Interceptors)Required robust handling of unstable networks, retries, and token refreshing.Heavier than standard http package, but the interceptor capabilities were non-negotiable for our auth flow.
Client-Side AHPTo provide instant decision support without latency.Increases app bundle size and logic complexity compared to a server-side calculation.

The Engineering Solution

To address the challenges, I architected the solution using Clean Architecture to ensure scalability and testability.

  • Architecture & Pattern: We utilized a Feature-Driven directory structure combined with BLoC for state management. This allowed us to scale the development team by assigning ownership of specific features (e.g., pond, feed, finance) without merge conflicts.
  • Performance Optimization: Extensive use of Lazy Loading and CachedNetworkImage to ensure the feed of activity logs remains smooth even after thousands of entries.
  • Key Feature Implementation: Built a custom Cycle Management Engine that tracks the biological growth curve of the fish based on sampling data to estimate current biomass and FCR (Feed Conversion Ratio).

💻 Code Spotlight: AHP Implementation

Here is a glimpse of how we structured the AHP logic. By abstracting the matrix calculations, we made the decision engine pluggable for different criteria (e.g., Cost vs. Quality vs. Availability).

// Example: Simplified AHP Matrix Calculation Logic
class AhpCalculator {
  /// Calculates the priority vector for a given comparison matrix
  List<double> calculatePriorityVector(Matrix matrix) {
    // 1. Normalize the matrix
    final normalizedMatrix = _normalize(matrix);
    
    // 2. Calculate row averages (Priority Vector)
    final priorityVector = normalizedMatrix.rows.map((row) {
      return row.reduce((a, b) => a + b) / row.length;
    }).toList();
 
    return priorityVector;
  }
  
  // Consistency Check logic would follow...
}

The Result & Impact

  • Efficiency: Farmers reported a 20% reduction in feed waste due to better FCR tracking.
  • Adoption: Successfully deployed to rural farmers with a high retention rate due to the offline-first capabilities.
  • Reliability: The robust error handling architecture ensures that data collected in the field is never lost, even if the app crashes or the battery dies.

Retrospective: What I'd Do Differently

If I were to rebuild this project today, I would improve:

  1. Local Database: We initially relied heavily on SharedPreferences for simple caching; I would migrate to Drift (SQLite) or Isar earlier to handle the complex relational queries required for cross-cycle reporting.
  2. Form Management: The extensive forms for data entry became hard to maintain; I would adopt a flutter_form_builder or similar data-driven form generator to reduce boilerplate UI code.

Key Takeaway: This project proved that complex mathematical models (like AHP) can and should live on the client-side when the user experience demands instant interactivity, even in low-resource environments.

Gallery

Mitra3M screenshot 1
Mitra3M screenshot 2