clone

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

feat/184-task-notice-migration
lofi / apps / reference / README.md
README.md 2.8K rendered
1# lofi reference application23This application proves the author-facing lofi workflow against the public `@nzip/lofi` runtime.4Framework implementation stays package-owned while the application retains its product source.56## Author-owned files78- `src/schema.ts` — application data model9- `src/permissions.ts` — application access policy10- `src/app.ts` — named application configuration11- `src/pages/` — product pages and shell content12- `src/islands/` — product interaction and rendering13- `src/styles/` — product styling14- `tests/` — product behavior and author-boundary tests1516## Package-owned framework1718- `@nzip/lofi` — storage, identity, synchronization, lifecycle, diagnostics, and framework adapter19- `@nzip/lofi/access` — private, direct-share, and fixed-role group templates and operations20- `@nzip/lofi/preact` — optional framework UI such as `DeviceStatus` and `PwaActions`21- `.lofi/` — ignored Astro/Jazz integration materialized by framework commands22- `dist/sw.js` — service worker generated by `deno task build`2324Application work imports supported package APIs and does not carry framework implementation files.25`public/manifest.webmanifest`, `public/favicon.svg`, `src/layouts/`, and `src/env.d.ts` remain26application-owned integration and branding surfaces.2728The [exact generated-project map](../../docs/reference/project-layout.md) lists every generated29source-controlled path and separates it from regenerated `.lofi/` tooling and `dist/` output.3031Browser journeys import readiness, offline, two-client, and sanitized failure-artifact helpers from32`@nzip/lofi/testing`. `tests/convergence_e2e_test.ts` is a worked example: two clients add a task33offline and converge after reconnecting. The normal `deno task test` skips it (and never launches34Chromium); run it against a synced deployment with35`LOFI_E2E_BASE_URL=http://127.0.0.1:4321/ deno test -A tests/convergence_e2e_test.ts`.3637`deno task build` produces a self-contained static PWA in `dist/` (the Preact islands compile to38`dist/_astro/*.js`); `deno task preview` serves it locally.39`deno task deploy:create --org <org>40--app <app>` hosts it on Deno Deploy as a static site and41`deno task deploy` pushes updates — both push the built `dist/` as the deploy root (nothing to build42remotely, and no `src/app.ts` misdetection). These are generic, org/app-free scaffolding; releasing43the `@nzip/lofi` package itself is a separate JSR publish (repo root), not a site deploy.4445When sync is configured, the author-owned `AccountGate` demonstrates opt-in backup, recoverable46passkeys, recovery-phrase fallback, explicit account replacement, and app-scoped sharing identities47using only public package APIs. Passkey availability remains browser-, provider-, origin-, and48RP-ID-dependent; the UI does not imply universal portability.