Shuhaib
Enterprise Mobile SolutionInternal Enterprise AppFeb 2025 - Dec 2025

WAVES 2 - Adv. Sales Platform

Mobile Developer & UI/UX Designer at SpiralCode Innovates LLP

Case Study Narrative

The business context and technical outcomes of this project.

01. The Problem

Merging primary and secondary sales created extreme validation challenges in the field, with salespersons bypassing rules and losing data in dead zones.

02. The Challenge

Ensure zero data loss for orders and checkouts in remote areas, enforce strict checkout rules (forced checkout constraints) to prevent fake shop visits, and automate travel expense auditing.

03. The Solution

Implemented an offline-first architecture with BLoC, combining instant local database validation with a deferred, fire-and-forget sync queue using exponential retry backoff, alongside background mileage calculations based on GPS paths.

04. The Result

Ensured 100% reliable order synchronization, reduced fake shop check-ins through forced check-outs, and eliminated manual travel expense entry errors.

Offline-First Sync Architecture

Hover over any system node in the diagram below to inspect its technical details and implementation responsibility.

Flutter / Dart

Flutter UI

Reactive presentation layer with optimistic state updates.

flutter_bloc

BLoC

Business logic component handling local state validation.

Clean Architecture

Repository

Bridges local data and network services seamlessly.

Hive DB

Local Hive

Fast, zero-latency local key-value database.

WorkManager / WorkManager (Kotlin)

Background Sync

3-stage transactional queue with exponential retry backoff.

REST API

ERPNext API

Central enterprise system receiving verified sync records.

Key Engineering Challenges

A detailed breakdown of low-level infrastructure and systems problems successfully solved during implementation.

Atomic local order queue storage with Hive
3-stage background synchronization with exponential backoff
Enforced checkout constraints with geolocation validation
Automated background travel mileage tracking
Telemetry tracking using Sentry and Crashlytics

The Challenge

Problem Statement

Merging primary and secondary sales created complexity in validation and data synchronization. The goal was to enforce strict sales discipline (e.g., forced checkout) while ensuring zero data loss in offline environments.

Data Synchronization Logic
Fake Shop Visits
Complex Validation

Research & Decisions

Sync Architecture

Adopted a 'Fire-and-Forget' UI pattern. Time & Location are captured at trigger, while heavy resolution (Google Maps API) happens in the background.

Validation

Combined instant local validation with deferred server-side checks. Photo proof is compressed locally before being queued for upload.

Resilience

Fail-safe Logic: The app stores reference data for manual sync if the 3-retry background worker encounters persistent network failure.

Features & Implementation

Technologies Used

Flutter
BLoC
Clean Arch
Kotlin Plugin
Sentry
Firebase

Project Interface Flow

Visual layout mapping the primary interface checkpoints and telemetry data pipelines of the application.

Screen mockup 1
Checkpoint 1
Screen mockup 2
Checkpoint 2
Screen mockup 3
Checkpoint 3
Screen mockup 4
Checkpoint 4