Case Study · Software Architecture

Building a Maintenance & Repair Mobile App Without Replacing Legacy ERP

Engineered an ecosystem of three PWA applications and a PHP integration gateway wrapped around a legacy enterprise ERP system, maintaining business continuity, enabling offline capabilities, and integrating a payment gateway.

  • K Monthly Active Clients
  • % CAC Reduction
  • % System Uptime
Design Priorities

Four Core Principles Shaping Every Architectural & Implementation Decision

01

ERP Continuity

Core operational systems remained fully functional throughout all development phases with zero downtime.

02

Field Operation Reliability

Actions are persisted locally first, then securely synchronized once internet connectivity is restored.

03

End-to-end Auditability

Immutable audit trails for state transitions across work orders, notifications, payments, and accounting ledger entries.

04

Controlled Modernization

An explicit integration contract isolating modern applications from legacy schema complexities.

01

Overview

Three Modern Apps, One Gateway, Single Source of Truth

The platform adopted a layered architecture where each PWA manages its own permissions, local data model, and caching strategies, while SQL Server remains the authoritative single source of truth for operational and accounting data.

Customer App

C PWA

End-to-end journey from booking to payment, featuring reliable real-time status tracking and transactional messaging.

  • Phone number & OTP authentication
  • Booking, tracking, and rescheduling
  • Invoicing, receipts, and Paymob checkout

Technician App

T Offline Ready

Device-first field execution with clear state synchronization and conflict resolution mechanisms.

  • Notes, photo capture, and measurements
  • Spare parts reservation and usage tracking
  • Customer e-signature & proof of completion

Workshop Portal

S Web / PWA

Unified workflow for intake, repair dispatch, stock management, and exception handling.

  • Custody tracking & device health logs
  • Technician queues & repair testing
  • Parts issuance, returns, and replacements
02

Challenge & Solution

Integration Boundaries Protecting Legacy Business Logic

The enterprise operated on a legacy ERP embedded with deeply intricate business logic. The primary architectural challenge was to build modern interfaces on top of the existing infrastructure while refactoring core rules for optimal performance with new applications without interrupting daily legacy operations.

Additionally, field technician operations required seamless functionality in low or zero connectivity environments. This was achieved by architecting an Offline-first PWA paradigm, persisting data locally and syncing automatically once connectivity is restored.

Core Architectural Decision Decoupled command acceptance from processing execution. Mobile requests never block waiting on heavy legacy database transactions; commands can be safely retried idempotently without duplicating spare parts, invoices, or payments.

03

Offline-first PWA

Offline-First as a Core State, Not an Exception

The technician app was designed to operate seamlessly during connectivity outages. Every action is assigned a UUID and written to IndexedDB before network dispatch, queued until confirmed by an authoritative server response.

Locally Persisted IndexedDB
Pending Server Sync Outbox Queue
Server Confirmed Authoritative State

Purpose-Driven Storage Tiering

  • Cache Storage — App shell, static assets, and UI components.
  • IndexedDB — Tasks, work orders, spare parts catalog, drafts, and outbox mutations.
  • Memory — Transient view states and non-persisted sensitive session data.

Independent & Re-entrant Sync

Data integrity does not rely solely on Background Sync; multi-factor verification occurs at the backend gateway to validate and commit incoming state events.

Minimizing On-Device Footprint

  • Smaller cached projections
  • Automated cleanup & expriy
  • Device-bound session tokens
  • Redacted payment details
Offline command envelope
  { "client_action_id": "60a9f923-7fac-4f70-84fe-2f6ea945ef1a", "aggregate_type": "work_order", "aggregate_id": "WO-18472", "operation": "record_part_usage", "expected_version": "0x000000000001A74B", "occurred_at": "2026-09-10T14:18:22Z", "payload": { "part_id": 381, "quantity": 1 } }  
04

Paymob + SMS Gateway

Replay-Safe & Auditable Workflow for Payments and Notifications

Payment initiation tokens are strictly generated backend-side based on validated invoice records; the client runtime is never trusted to pass final transaction amounts.

Client-side responses strictly handle interface feedback, while cryptographically signed Webhooks serve as the authoritative confirmation of payment processing.

  1. 1

    Invoice Validation

    Validates record ownership, pending balances, currency match, and payable status directly against SQL Server.

  2. 2

    Local Attempt Initialization

    Generates a unique Merchant Reference and Paymob Checkout Token.

  3. 3

    Authoritative Webhook Processing

    Verifies digital HMAC signatures, transaction amounts, and currencies, preventing duplicate processing via idempotency checks.

  4. 4

    Ledger Settlement & Event Dispatch

    Updates payment status, invoice settlement, and emits outbox events within a unified DB transaction.

Financial Integrity Rule A Late Failure Callback can never void a Captured Payment unless accompanied by an explicit, authenticated Refund or Reversal event.

05

Results

Modernizing Core Workflows Without High-Risk System Overhauls

  • Delivered a modern, fluid user experience for field technicians and workshop staff, modernizing business processes while tapping into legacy capabilities without risky complete rewrites.

  • Established a direct communication channel for end customers to request home appliance repairs, track real-time job progress, and inspect/pay repair invoices transparently.

  • Paved the way for incremental feature migration from the legacy ERP over time, mitigating operational risks tied to big-bang system replacements.

Zero Planned Downtime

Phased rollout with rollback capability.

40%

Reduction in invoice settlement time

40–65%

Drop in Status Inquiry Support Calls

30%

Customer Acquisition Cost (CAC) Reduction

35%

Increase in Customer Lifetime Value (CLV)

Accept commands reliably, apply them idempotently, reconcile against the authoritative state, and make every state transition observable.

Core Architectural Principle
06

Client Testimonial

Muhammad translated our messy requirements into a clear architecture we could actually build. Performance is up, technical debt is down, and the team finally has a roadmap.

Khalid Alaa CTO, Eldawlia for services
07

FAQ

Frequently Asked Questions

Why was replacing the ERP not the recommended path?
The legacy ERP was operationally sound, containing years of refined business logic and domain rules. Integrating a modern middleware layer allowed faster time-to-market and incremental feature migration while eliminating the operational risks of a complete system migration.
How are duplicate actions prevented during offline resynchronization?
Every offline transaction is assigned a client-generated UUID prior to local persistence. The API gateway processes commands idempotently, enforcing strict database constraints against duplicated work order mutations.
How is electronic payment integrity guaranteed?
Payment status is verified exclusively via cryptographically signed backend Webhooks, matching transaction amounts and reference IDs directly against order ledger records.
How did the customer PWA drive down CAC?
Acquisition previously depended on high-cost outbound advertising. Launching the customer PWA with integrated referral and loyalty programs drastically reduced acquisition costs. Furthermore, Customer Lifetime Value (CLV) increased by over 30%, as installed home-screen apps streamlined repeat service requests for home appliance maintenance.