Field Architecture · Reference Implementation

Offline Hazard Capture Sandbox

When an electrician finds standing water in a sub-basement, cellular signal is usually dead. This sandbox demonstrates how frontline reporting works without an app store download or a login screen. The worker snaps a photo and enters their site badge number. The phone saves the report locally, and pushes it to the project office the moment signal returns.

Works Without Cell Signal No Password or App Install Queues Reports Offline Matches Gate Sign-In Sheet
Companion articles: Why Frontline Workers Fabricate Safety Data → · Why Construction Safety Software Fails on Subcontractor Crews →
Network Status:
Connected
Turn on Airplane Mode to simulate walking into a basement dead zone.
Real Device Test Want to test actual frontline resilience?

Turn off your phone or laptop's Wi-Fi, or switch on physical Airplane Mode in quick settings. Because the service worker is active, this page will not display a browser "No Internet" error. You can submit an observation, reload the page with zero signal, and turn Wi-Fi back on to watch the queue push automatically.

Site Hazard Quick-Report
No app install · No password
All Synced
QR Tag: Stair 2, Level -2
Default is auto-set by QR scan; dropdown provides override if physical tag is muddy.
Standard text input — works with native keyboard speech-to-text dictation.
Tap to load field scenarios:
Hazard evidence thumbnail
📷 Field Photo (WebP)
3.8MB → 142KB WebP Quota Safe
Upload a photo. The browser scales and compresses it to WebP format, then stores it in IndexedDB instead of the phone's much smaller localStorage quota.
✓ Marcus Vance · Pinnacle Steel Erectors (Ironworker)
Matched against gate induction. No password or email login needed.

Browser Local Storage Queue

0 Pending

When cellular signal drops, submissions write directly to the browser's local memory. When signal returns, records push automatically.

Queue is empty. Turn on "Airplane Mode" above and submit an observation to watch it queue locally.
Simulation helper only — production queues cannot be deleted from the phone; records persist until server acknowledgment.
Apple Safari 7-Day Storage Deletion: Mobile Safari deletes website storage after 7 days if the worker does not reopen the page. Treat phone memory as a temporary buffer measured in hours: sync whenever cellular signal flickers and prompt workers before records lapse.
First-Time Offline Setup (Gate Induction): A phone browser cannot open an app offline without loading it once while connected. Trade workers scan the QR tag at the morning security gate over 4G or Wi-Fi. The phone saves the form and code instantly, allowing workers to open and use it in sub-basements and elevator shafts with zero signal.
Storage Architecture: Full-resolution smartphone photos (4MB–8MB) fill localStorage's ~5-10MB per-site quota after just 1 or 2 submissions, and every save there rewrites the entire queue as one JSON string. This sandbox shrinks each photo on an offscreen <canvas> element to WebP format (~140KB) and writes it as a raw image Blob to IndexedDB one queued record at a time, so quota and rewrite cost stop scaling with queue length.

Gate Induction Resolver (Server)

5 Trades Pre-Loaded

The worker only typed a badge number. When received by the server, the backend resolves the employer, trade contract, and valid certifications:

Badge Trade Worker Subcontractor Firm Verified Certs
B-4819 Marcus Vance Pinnacle Steel Erectors OSHA 30 · Subpart R
B-5102 Elena Rostova Apex Mechanical NFPA 51B (Hot Work Permit Authorizer) · Confined Space
B-3921 David Chen Liberty Electrical NFPA 70E Arc Flash
B-6044 Jamar Jackson Tri-State Concrete OSHA 10 · Silica

Resolved Safety Events (General Contractor Audit Log):

No synced records yet. Submit a report to see the server link the badge to the worker's name, subcontractor, and trade certifications.