Skip to Content
Core FeaturesOffline-First PWA

Offline-First PWA

Aura keeps working when the network doesn’t. Two mechanisms cooperate (public/sw.js + src/lib/offline-sync.ts):

Service Worker caching

The Service Worker caches the application shell and static assets, so the workspace loads and runs fully offline.

IndexedDB mutation queue

Writes that would normally hit Firestore are enqueued while offline:

src/lib/offline-sync.ts
export interface PendingMutation { // collection, operation, payload … attempts: number // number of sync attempts // createdAt, lastAttempt timestamps } export type SyncStatus = 'idle' | 'syncing' | 'error' | 'offline' export async function enqueueMutation(m: Omit<PendingMutation, 'id' | 'createdAt' | 'attempts'>): Promise<string>

When connectivity returns, background sync drains the queue, emitting SyncEvents (sync-start, sync-complete, sync-error, mutation-queued, online, offline) that the UI surfaces as a sync status indicator.

Division of labor

DataOffline strategy
App shell & assetsService Worker cache
Project CRDT statey-indexeddb — merges on reconnect
Firestore documentsIndexedDB mutation queue + background sync
Task stateIndexedDB task persistence (src/lib/task-persistence.ts)