Willows Bell
SYSTEM STATUS: DEVELOPMENT_MODE // [UNSTABLE_BUILD_VERSION_0.8.4]
PROJECT_DOSSIER // ACCESS_GRANTED
FILE_REF: TRACEABILITY

Shea Traceability Project

Traceability Mobile

Summary

Traceability Mobile is a production-grade Flutter monorepo implementing an agricultural supply chain traceability platform. The system tracks commodities from farmers and producers through warehouses to end-users, providing complete batch management, inventory control, and provenance tracking. It consists of two specialized mobile applications — Field Agent (for producers and agricultural cooperatives) and Warehouse Manager (for logistics and warehouse operations) — that share a common backend, widget, and utility layer through a Melos-managed monorepo structure.

The platform targets agricultural supply chains, enabling field agents to register farmers, manage cooperatives, create batches, and scan goods via NFC, while warehouse managers handle batch receiving, goods movement between warehouses, vendor management, and scanner-based inventory operations via Bluetooth and audio-jack scanners.


My Role

  • Designed and implemented the full Flutter monorepo architecture across two mobile applications and three shared packages
  • Built the offline-first data layer using Hive with intelligent sync to a REST backend via Dio
  • Implemented MVVM architecture with Riverpod state management, GetIt dependency injection, and Freezed immutable models
  • Developed hardware integration features including NFC scanning, Bluetooth Classic/BLE scanner connectivity, GPS location capture, and camera-based image handling
  • Created the shared authentication flow (JWT-based), profile management, and notification system in the common package
  • Built responsive layouts supporting both mobile and tablet form factors
  • Integrated Firebase Crashlytics for production error monitoring
  • Managed the full feature lifecycle for batch management, goods tracking, farmer/cooperative registration, vendor management, and warehouse-to-warehouse goods movement

Architecture

Tech Stack

LayerTechnology
FrameworkFlutter (Dart)
State ManagementRiverpod (Hooks), StateNotifier, ChangeNotifier
NavigationRoutemaster (declarative)
NetworkingDio with interceptors, JWT auth
Local StorageHive (NoSQL), Flutter Secure Storage
Code GenerationFreezed, json_serializable, build_runner
DIGetIt (service locator)
Crash ReportingFirebase Crashlytics
MonorepoMelos

Project Structure

traceability_mobile/
├── melos.yaml
├── analysis_options.yaml
├── projects/
│   ├── field_agent/              # Field agent mobile app
│   └── warehouse_manager/        # Warehouse manager mobile app
└── packages/
    ├── traceability_backend/     # API services, models, DAOs, config
    ├── traceability_common/      # Shared screens & utilities
    └── traceability_widgets/     # Custom UI components

Layered Architecture

Presentation (Screens - HookConsumerWidget)
        ↓
ViewModel (BaseChangeNotifier / StateNotifier)
        ↓
Repository (Online + Offline abstraction)
        ↓
Service (API calls, business logic)
        ↓
DAO (Hive local storage)
        ↓
Models (Freezed, JSON serializable, Hive adapters)

Key Patterns

  • MVVM

  • Repository Pattern — Repositories bridge services and DAOs, handling online/offline scenarios

  • Service Locator — GetIt registers singletons and lazy singletons

  • Offline-First — All entities cached in Hive; data pre-fetched on auth; background sync

  • Code Generation — Freezed for immutable models with copyWith, pattern matching, and Hive type adapters

Domain Models

All models are immutable (Freezed), JSON-serializable, and Hive-persistent.


Features

Field Agent App

FeatureDescription
AuthenticationLogin, registration, email verification (JWT-based)
DashboardOverview of farmer, cooperative, and batch activity
Farmer ManagementCRUD operations for individual farmers with GPS location capture and image uploads
Cooperative ManagementRegister and manage cooperatives, assign farmers to cooperatives
Warehouse ManagementCreate and manage warehouses, assign warehouse managers
Batch ManagementCreate, edit, receive batches; scan goods via NFC; view batch history and received batches
Goods ManagementRegister goods, assign to batches, individual sales unit identification
NFC ScanningTag reading for product identification and batch item linking
Profile & SettingsView/edit profile, change password, notifications
GeolocationGPS capture for farmer and warehouse registration
Image HandlingPhoto capture with compression for profiles and goods

Warehouse Manager App

FeatureDescription
AuthenticationLogin, registration, email verification (JWT-based)
DashboardOverview of batch receiving and goods movement
Vendor ManagementCRUD operations for suppliers/vendors with organization profiles
Batch ManagementCreate, receive, and track batches; view received batch details and moved goods
Scanner IntegrationBluetooth Classic, BLE, and audio-jack scanner support with device pairing management
Goods MovementTransfer goods between warehouses with vehicle details and waybill tracking
RFID ScanningRFID scanner utilities for inventory operations
Profile & SettingsView/edit profile, change password, notifications

Shared Capabilities (Common Package)

FeatureDescription
Offline-FirstFull Hive-based local persistence with background sync
Responsive UIAdaptive layouts for mobile (480px) and tablet (800px+)
Connectivity MonitoringReal-time network status detection with graceful degradation
Crash ReportingFirebase Crashlytics integration for production error telemetry
Tag ScannerShared NFC/barcode tag reading screen
ID ScannerDocument ID scanning page
NotificationsIn-app notification system