Skip to content

Mobile Extension: React Native App with Offline-First & Native Scanning #47

@Nitya-003

Description

@Nitya-003

Description

While the web dashboard is excellent for administrators and retailers, it is impractical for farmers and transporters working in the field. We need a native mobile application (/mobile) that provides a rugged, high-performance experience optimized for on-site operations.

This extension will focus on three pillars: Native Performance (QR Scanning), Reliability (Offline Support), and Real-time Awareness (Push Notifications).

Goals

  1. Provide a high-speed QR scanning interface for high-volume batch processing.
  2. Enable data entry in areas with zero or intermittent internet coverage (Offline-first).
  3. Keep stakeholders informed via mobile alerts without requiring them to check the web dashboard.

Tasks

1. High-Performance Native QR Scanner

  • Library Integration: Setup react-native-vision-camera and vision-camera-code-scanner.
  • Native Optimization: Configure the scanner to use the device's auto-focus and flash (torch) for low-light warehouse/field conditions.
  • Instant Verification: Implement a "Scan-to-View" flow that fetches batch history immediately upon a successful QR read.

2. Offline Mode & Local Persistence

  • Local Storage: Implement AsyncStorage or SQLite to cache batch data and user profiles locally.
  • Sync Queue: Create an "Outbox" pattern. If a farmer updates a batch without internet:
    1. Save the update to the local queue.
    2. Display a "Pending Sync" status.
    3. Use NetInfo to detect internet restoration and automatically push updates to the Blockchain/API.

3. Real-time Push Notifications

  • Infrastructure: Integrate Firebase Cloud Messaging (FCM) or Expo Notifications.
  • Trigger Logic: Configure the backend to send a notification when:
    * A farmer's batch is received by a Mandi.
    * A transport vehicle reaches a checkpoint.
    * A retailer marks a batch as "Sold."

4. Cross-Platform UI/UX

  • Styling: Use NativeWind (Tailwind for React Native) to mirror the "Apple-level" aesthetic from the web.
  • Biometrics: (Optional) Implement FaceID/TouchID for secure and fast login.

Definition of Done

  • /mobile directory initialized with a working React Native/Expo build.
  • App can successfully scan a CropChain QR code and display batch details.
  • App stores data locally when the "Airplane Mode" is on and syncs when it is off.
  • Push notifications are successfully received on a physical device.
  • UI/UX is consistent with the web design system (Typography and Color Palette).

Labels: Hard, Enhancement

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions