Architecture Deep Dive

Sift & Screen Platform

An offline-first Flutter application engineered for fleet management and daily maintenance logging in highly disconnected industrial environments.

The Offline-First Philosophy

Built explicitly for quarries and field environments, Sift & Screen replaces paper-based pre-start checks with a resilient digital workflow. The core architectural mandate is that the application must function flawlessly in "Airplane Mode" without data loss.

All data entries—maintenance logs, fuel usage, and production metrics—are saved immediately to a local SQLite database via PowerSync. When network connectivity is restored, the background synchronization engine securely pushes changes to the cloud and pulls master data updates.

Tech Stack

  • Frontend: Flutter / Dart
  • Local Storage: SQLite (via sqflite & PowerSync SDK)
  • Cloud Backend: Supabase (PostgreSQL, Auth, Storage)
  • Sync Engine: PowerSync Dynamic Parameterized Sync Rules
  • Integrations: Google Sheets (via Supabase Edge Functions)

Multi-Tenant Synchronization Engine

Strict Data Isolation

The application serves multiple enterprise clients securely. Data isolation is enforced strictly at the database level using PowerSync Dynamic Parameterized Sync Rules rather than weak client-side filters. Devices only ever download rows matching their authorized company bucket.

Push Workflow (Local → Cloud)

  • The SDK uses the active Supabase JWT to authenticate with the Sync Engine.
  • Transactions are batched automatically. Either the entire log batch commits successfully to PostgreSQL, or it waits for a more stable connection.
  • Local image paths are seamlessly uploaded to Supabase Storage prior to row commitments.

Pull Workflow (Cloud → Local)

  • Bucket Evaluation evaluates sync_rules.yaml based on the user's JWT.
  • Managers pull their specific `admin_id` bucket, while workers sync data via their linked `device_user_id`.
  • Timestamp Arbitration resolves sync conflicts by ensuring "last write wins" without overwriting management adjustments.

Hybrid Authentication Flow

Authentication is split into a hybrid model to cater to both cloud-connected managers and offline field operators.

Manager Auth (Cloud)

Managers and owners sign up via standard Supabase Email/Password, mapping their session securely to the company's admin records.

Device Linking

When an operator installs the app, Supabase authenticates them anonymously. Inputting a valid Join Code securely links the device ID to the specific company in PowerSync.

Worker Auth (Local)

Operators log in entirely offline using a 4-digit PIN verified against the synchronized, local SQLite worker table.

Return to Projects