Skip to content

PWA + offline-first patterns for web/admin clients #61

@MUKE-coder

Description

@MUKE-coder

Problem

Property managers, restaurant staff, field technicians — many Grit apps are used on flaky networks. Today the app fails badly when offline: blank screens, lost form input, no clear retry. "Add offline support" is a 2-month project per app.

Proposal

Out-of-the-box PWA + offline-first conventions:

  • `grit init` produces a service worker (Workbox-based) with sensible defaults: network-first for API, stale-while-revalidate for assets
  • The app installs to home screen with proper icons + splash + manifest
  • The api-hooks factory (feat (fix): feature request and small but powerful fixes #7) gains an `offlineCache: true` option — list responses persist to IndexedDB, available immediately on next load
  • Mutation queue: when offline, mutations enqueue locally; when reconnected, replay in order with conflict detection
  • `` component shows online/offline + pending mutation count
  • Dev dashboard has a "go offline" toggle for testing

Why this is differentiating

Offline-first is hard. Convex, RxDB, WatermelonDB are entire products built around it. A Go-backed framework that ships offline mode for free wins markets where connectivity is unreliable (most of the world).

Acceptance

  • The rental-manager app, run on a tablet at a hotel front desk, keeps working when wifi drops
  • A booking created offline syncs automatically when the network returns
  • Conflicts (offline edit + server update during the gap) surface a resolution UI

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions