clone

a deno framework for local-first web apps that open instantly, work offline and sync when users choose

feat/prf-provision-custody
lofi / apps / reference
README.md

lofi reference application

This application proves the author-facing lofi workflow against the public @nzip/lofi runtime. Framework implementation stays package-owned while the application retains its product source.

Author-owned files

  • src/schema.ts — application data model
  • src/permissions.ts — application access policy
  • src/app.ts — named application configuration
  • src/pages/ — product pages and shell content
  • src/islands/ — product interaction and rendering
  • src/styles/ — product styling
  • tests/ — product behavior and author-boundary tests

Package-owned framework

  • @nzip/lofi — storage, identity, synchronization, lifecycle, diagnostics, and framework adapter
  • @nzip/lofi/access — private, direct-share, and fixed-role group templates and operations
  • @nzip/lofi/preact — optional framework UI such as DeviceStatus and PwaActions
  • .lofi/ — ignored Astro/Jazz integration materialized by framework commands
  • dist/sw.js — service worker generated by deno task build

Application work imports supported package APIs and does not carry framework implementation files. public/manifest.webmanifest, public/favicon.svg, src/layouts/, and src/env.d.ts remain application-owned integration and branding surfaces.

The exact generated-project map lists every generated source-controlled path and separates it from regenerated .lofi/ tooling and dist/ output.

Browser journeys import readiness, offline, two-client, and sanitized failure-artifact helpers from @nzip/lofi/testing. tests/convergence_e2e_test.ts is a worked example: two clients add a task offline and converge after reconnecting. The normal deno task test skips it (and never launches Chromium); run it against a synced deployment with LOFI_E2E_BASE_URL=http://127.0.0.1:4321/ deno test -A tests/convergence_e2e_test.ts.

deno task build produces a self-contained static PWA in dist/ (the Preact islands compile to dist/_astro/*.js); deno task preview serves it locally. deno task deploy:create --org <org> --app <app> hosts it on Deno Deploy as a static site and deno task deploy pushes updates — both push the built dist/ as the deploy root (nothing to build remotely, and no src/app.ts misdetection). These are generic, org/app-free scaffolding; releasing the @nzip/lofi package itself is a separate JSR publish (repo root), not a site deploy.

When sync is configured, the author-owned AccountGate demonstrates opt-in backup, recoverable passkeys, recovery-phrase fallback, explicit account replacement, and app-scoped sharing identities using only public package APIs. Passkey availability remains browser-, provider-, origin-, and RP-ID-dependent; the UI does not imply universal portability.