Delivered remotely for a business based in Oslo, Norway. Names withheld by agreement.
Project Overview
Across rural and coastal municipalities, thousands of residential and commercial properties rely on decentralized wastewater and treatment installations rather than municipal sewer mains. Environmental regulations mandate periodic on-site inspections—checking sludge depth, pump amperage, alarm floats, effluent clarity, and filter integrity—often in valleys, cabins, or wooded plots with unreliable cellular reception. Paper clipboards introduce transcription mistakes and delayed filings; naive cloud-only mobile apps freeze the moment bars disappear.
We engineered a multi-tenant compliance and field service platform headquartered for Norwegian environmental service workflows, uniting a Laravel and MySQL multi-tenant backend, a React operational dispatch console, Blade-rendered regulatory certificates, and an offline-first React Native field app powered by local SQLite and Firebase notifications.
Field Connectivity & Compliance Gaps
Service contractors and municipal oversight teams previously struggled with four recurring operational failures:
- Dead-zone workflow halts: Cloud-dependent mobile forms lost unsaved measurements or failed validation lookups whenever technicians worked in basements or remote fjords.
- Tenant cross-contamination risk: Managing multiple regional service companies and municipal inspection authorities inside ad-hoc spreadsheets risked exposing property owner records across organizational boundaries.
- Inconsistent statutory documentation: Technicians used varying checklist formats, omitting mandatory deficiency codes or before-and-after maintenance photos required by environmental auditors.
- Delayed defect escalation: Critical pump failures or overflow hazards sat unaddressed until inspectors returned to the office days later to transcribe handwritten notes.
Architectural Strategy
The platform centers on a local-first execution model on mobile paired with a tenant-isolated authoritative ledger on the server. When a technician starts a shift, React Native pulls an incremental snapshot of assigned properties, previous inspection histories, treatment-unit specs, and dynamic checklist templates into an encrypted on-device SQLite database.
From that moment onward, the mobile app never blocks on network calls. Technicians record measurements, capture geo-tagged photos, and collect property-owner sign-offs directly against SQLite, writing mutation envelopes to a durable local outbox. Whenever connectivity returns, a two-phase sync engine replays structured payloads to Laravel idempotently before streaming compressed attachments. Firebase delivers schedule changes and urgent re-assignments when devices are online.
Core Capabilities
- Multi-Tenant Asset & Property Registry: Each service provider or municipality manages isolated portfolios of treatment units, GPS coordinates, hardware serials, and statutory inspection intervals.
- Dynamic Offline Checklists: Conditional inspection forms adapt automatically to treatment system type—such as biofilters, septic tanks, or chemical dosing units—without requiring connectivity.
- Two-Stage Deterministic Sync: Structured findings sync immediately upon reconnection so office reviewers see anomalies right away, followed by queued diagnostic photography.
- React Dispatch & Anomaly Triage: Coordinators assign recurring seasonal routes, visualize overdue properties, and flag critical environmental non-compliance for follow-up work orders.
- Automated Blade Compliance Reports: Approved inspections compile into standardized PDF compliance certificates complete with inspector credentials, timestamps, measurements, and annotated photos.
Technical Architecture
Coordinators schedule inspection cycles in the React portal, storing assignments in MySQL partitioned logically by tenant ID. Laravel exposes delta-sync endpoints that package property rosters and template schemas for React Native, persisting them locally inside SQLite. During site visits, all form interactions write solely to SQLite. Upon network restoration, the mobile sync worker transmits idempotent JSON batches to Laravel, which commits inspection snapshots in MySQL, triggers Blade PDF generation via background queues, and pushes route updates through Firebase Cloud Messaging.
Flow: React Dispatch Schedule → Laravel Tenant Sync API → React Native + SQLite Offline Execution → Idempotent Outbox Replay (JSON first, Photos second) → MySQL Compliance Ledger & Blade PDF Reports
Separating structured telemetry from binary photo uploads ensures dispatchers learn about urgent equipment failures within seconds of signal recovery, even over marginal rural bandwidth.
Technology Stack
| Category | Technology detail |
|---|---|
| Multi-Tenant Backend | Laravel (PHP 8.x tenant-scoped APIs, sync endpoints, regulatory rules) |
| Field Technician App | React Native cross-platform app for route execution, checklists, and evidence capture |
| Local Offline Storage | SQLite on-device relational store for cached work orders, schemas, and outbox queues |
| Dispatch & Review Portal | React web workspace for seasonal route planning, defect review, and SLA tracking |
| Compliance Reports & Admin | Laravel Blade views for tenant provisioning and standardized PDF inspection certificates |
| Central Database | MySQL storing tenant organizations, treatment asset registries, and audit trails |
| Live Sync & Dispatch Alerts | Firebase Cloud Messaging & lightweight status signals for schedule updates |
| Background Processing | Laravel Queues for PDF generation, recurring visit scheduling, and regulator exports |
Engineering Trade-offs & Solutions
| Engineering Challenge | Solution & Trade-off |
|---|---|
| Preventing duplicate inspection records during flaky rural reconnects | Assigned client-generated UUID idempotency keys to every inspection submission and photo item in SQLite, trading slightly larger sync payloads for safe, repeatable retries. |
| Ensuring offline validation rules match server-side compliance logic | Serialized declarative checklist schemas and threshold rules into SQLite during morning sync, avoiding brittle hardcoded validation drift between React Native and Laravel. |
| Isolating multi-tenant data reliably across shared infrastructure | Enforced database-level tenant keys via Laravel global scopes and strict route policies, trading single-tenant DB simplicity for streamlined schema upgrades across all organizations. |
| Resolving dispatch schedule changes against in-progress offline visits | Treated field inspection observations as immutable append-only events while scoping dispatcher edits strictly to unassigned future visits, eliminating destructive merge conflicts. |
Security & Reliability
Environmental compliance logs serve as legal evidence for property owners and municipal regulators. All API communications enforce TLS with token-scoped tenant context verified on every Laravel request. On mobile devices, sensitive customer contact information and inspection drafts rest inside SQLite stores guarded by device authentication and purged cleanly upon session termination.
To preserve evidentiary integrity, finalized inspection records become read-only in MySQL once signed off by the technician. Any subsequent correction creates an audited amendment record linked to the original submission rather than mutating historical readings. Automated backup verification and dead-letter queue alerts guard background PDF rendering and municipal data export jobs.
Performance & Scale
Seasonal inspection surges—particularly spring thaw and autumn maintenance windows—concentrate sync bursts when dozens of field crews return to coverage simultaneously. Laravel queue workers isolate heavy Blade PDF compilation and image resizing from synchronous API threads, keeping sync acknowledgments brisk.
Incremental watermark-based sync ensures React Native devices download only modified properties and updated checklist definitions rather than pulling entire municipal registries each morning. On the web, React dispatch grids virtualize large property lists and filter server-paginated MySQL indexes so coordinators review thousands of treatment sites effortlessly.
Operational Outcomes
Moving field crews from paper clipboards and fragile online forms to an offline-first multi-tenant platform reshaped compliance operations:
- Uninterrupted rural field execution: Technicians complete complex checklists and capture photo evidence inside deep valleys and basements without losing work to dropped connections.
- Immediate defect visibility: Prioritized structured telemetry sync alerts dispatchers to failed pumps or environmental hazards as soon as a device regains minimal signal.
- Audit-ready statutory reporting: Standardized Blade PDF certificates eliminate manual re-typing and deliver uniform documentation to property owners and municipal authorities.
- Confident multi-organization governance: Strict tenant scoping allows multiple contractors and regional regulators to operate safely within one cohesive platform.