Delivered remotely for a business based in Milan, Italy. Names withheld by agreement.
Project Overview
Buried gas mains, high-voltage conduits, fiber trunks, and pressurized water lines sit directly beneath active construction zones. When excavation crews strike unmarked or improperly shielded infrastructure—or begin trenching without valid locate clearances—public safety and essential utility continuity are immediately at risk. Field inspectors and site supervisors tasked with documenting compliance breaches or settling minor administrative citations often work inside concrete utility corridors or peripheral roadworks where reliable wireless data simply does not exist.
We engineered a cross-platform mobile application built on React Native, React, TypeScript, and SQLite specifically for buried-utility protection workflows. Deployed across iOS and Android devices for municipal inspectors and licensed excavation contractors, the app enables offline dig-permit verification, structured damage and violation reporting with geotagged evidence, and integrated digital fine settlement with instant verifiable receipts.
Field Reporting & Enforcement Bottlenecks
Paper clipboards and naive online-only web forms created acute operational friction across active dig sites:
- Dropped submissions in poor coverage: Standard form apps timed out when inspectors descended into sub-surface utility vaults or rural road trenches, wiping out multi-step incident notes and forcing crews to re-enter reports back at the depot.
- Unverifiable incident evidence: Separate smartphone photos lacked structured links to permit numbers, utility operator IDs, and precise GPS timestamps, weakening enforcement records during contested appeals.
- Slow fine resolution cycles: Contractors issued minor administrative citations faced mailed paper invoices and municipal office visits, delaying case closure and holding up subsequent permit renewals.
- Outdated reference codes in the field: Printed fee schedules and utility contact directories quickly went stale whenever municipal regulations or regional operator territories changed.
Architectural Strategy
We treated connectivity as an intermittent optimization rather than an assumption. Using an offline-first SQLite core inside React Native, every screen reads from and writes to local relational tables first. No user action blocks on a remote HTTP round-trip except live fine payment authorization, which explicitly checks network readiness before initiating a tokenized checkout session.
To prevent fragile UI state when network conditions fluctuate mid-upload, we separated user drafting from background synchronization through a strict transactional outbox pattern. Reports, witness details, and photo manifests commit locally with explicit state flags (draft, queued, uploading_media, acknowledged, sync_error), giving inspectors transparent visibility into exactly what has reached municipal servers.
Core Capabilities
- Offline Dig-Permit & Utility Directory Lookup: Locally indexed SQLite tables let inspectors verify active excavation permits, locate expiration dates, and emergency utility operator contacts instantaneously without signal.
- Structured Damage & Violation Capture: Guided React Native workflows enforce mandatory fields—infrastructure type, strike severity, locate-mark presence, and contractor ID—eliminating incomplete field filings.
- Geotagged Photo & Signature Evidence: Embedded camera capture binds high-clarity compressed imagery to GPS coordinates, compass bearing, UTC timestamps, and on-screen contractor acknowledgment signatures.
- Resilient Media & Report Outbox: Lightweight incident metadata syncs immediately upon weak signal recovery, followed by chunked, resumable photo uploads that pause cleanly if signal drops again.
- In-App Citation Payment & Digital Receipts: Authorized contractors inspect open compliance citations, remit administrative fines via a tokenized payment flow, and store offline-accessible clearance receipts.
Technical Architecture
All user interactions run inside React Native TypeScript modules backed by an embedded SQLite database accessed through a typed repository layer. Sensitive authentication tokens and local encryption keys reside inside platform-native secure enclaves (iOS Keychain and Android Keystore).
Flow: Inspector / Contractor (React Native + React UI) → TypeScript Domain Layer → Local SQLite DB & Outbox → Background Sync Worker (HTTPS REST API + Idempotency Keys) → Municipal Enforcement Server & Tokenized Payment Gateway
When connectivity is detected, the background sync worker claims pending outbox rows sequentially. It dispatches structured JSON payloads first, records the server-assigned docket ID in SQLite, and then streams linked image files via multipart pre-signed endpoints. For fine payments, the app requests an ephemeral payment intent over HTTPS, completes card tokenization through the Payment SDK, and caches the resulting cryptographically signed receipt locally.
Technology Stack
| Category | Technology detail |
|---|---|
| Cross-Platform Mobile UI | React Native with React functional components for iOS and Android |
| Type Safety & Domain Models | TypeScript enforcing strict schemas across reports, permits, and sync |
| Local Relational Database | SQLite storing offline permit caches, incident drafts, and sync outbox |
| Evidentiary Media Capture | Native camera and GPS bridge tagging photos with coordinates and UTC time |
| Offline Synchronization Engine | Deterministic outbox worker with exponential backoff and idempotency keys |
| Upstream Integration | Versioned HTTPS REST API client connecting to municipal enforcement systems |
| Citation Fine Settlement | Tokenized Payment SDK flow for card-present/in-app penalty payments |
| Credential & Key Storage | OS Keychain and Android Keystore securing auth tokens and SQLite keys |
| Push & Status Alerts | Native notification handler surfacing citation updates and sync errors |
Engineering Trade-offs & Solutions
| Engineering Challenge | Solution & Trade-off |
|---|---|
| Full raw camera images overwhelmed weak field cellular uploads | Applied deterministic client-side resizing and JPEG compression inside React Native while preserving EXIF GPS/time metadata; slightly reduces raw pixel size in exchange for reliable field uploads. |
| Decoupling report JSON from photo uploads risked partial server records | Server accepts the report manifest in pending_media state first and tracks expected attachment checksums; trades an extra state transition for immediate visibility of urgent utility strikes. |
| Offline-edited drafts could collide with centrally updated citation statuses | Implemented monotonic server revision checks and immutable submitted-report locks; once marked submitted in SQLite, amendments append as supplemental addenda rather than overwriting history. |
| Supporting both inspectors and contractors in one codebase risked UI clutter | Used role-scoped navigation stacks driven by authenticated token claims in TypeScript, sharing core SQLite repositories and receipt views cleanly across personas. |
Evidentiary Integrity & Security
Compliance citations frequently face administrative challenges, making data provenance essential. Every photo captured inside the app records device GPS accuracy metadata and UTC capture time immediately into SQLite alongside a SHA-256 content digest computed prior to upload. Server ingestion verifies that uploaded file hashes match the manifest recorded at capture time.
Authentication tokens never sit in plain AsyncStorage; they are encrypted via iOS Keychain and Android Keystore, with optional biometric unlock protecting shared municipal field tablets. Fine payment flows tokenize card credentials directly with the payment processor SDK so sensitive primary account numbers never touch application state, logs, or SQLite tables.
Offline Storage & Sync Scale
Long-running field devices accumulate thousands of historical permit records and hundreds of inspection photos across months of street work. To keep SQLite queries fast and prevent device storage exhaustion, the sync engine runs scheduled retention pruning: acknowledged reports and verified payment receipts retain lightweight searchable metadata indefinitely while purged local high-resolution image caches free flash space once server checksum confirmation is received.
Indexed SQLite queries across permit IDs, street corridors, and contractor tax numbers keep autocomplete search responsive under 50 milliseconds even with regional utility datasets cached locally.
Operational Outcomes
Equipping excavation compliance teams and contractors with a purpose-built offline mobile tool modernized buried infrastructure oversight:
- Zero lost field reports: Inspectors document trench violations and utility strikes reliably regardless of sub-surface or rural cellular coverage.
- Stronger evidentiary quality: Standardized forms paired with GPS-pinned, hash-verified photographs arrive complete and ready for regulatory review.
- Faster fine resolution: Contractors review citations and settle administrative penalties directly on mobile devices, receiving verifiable clearance receipts immediately.
- Synchronized field intelligence: Automated catalog delta sync keeps regional utility directories and statutory fee schedules uniform across every device in the field.