clone

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

main
lofi / package / starter / src / app.ts.txt
app.ts.txt 2.0K
1import { defineLofiApp } from "@nzip/lofi";2import { app as schema } from "./schema.ts";34/** Author-owned composition. Vendor URLs and browser drivers remain in package runtime code. */5export const app = defineLofiApp({6 name: "lofi-prototype",7 databaseName: "lofi-prototype",8 schema,9 storage: "durable" as const,10 // Identity is local-first: first boot opens a private, on-device account with11 // no sign-in. When a managed Jazz app is configured (JAZZ_APP_ID / JAZZ_SERVER_URL —12 // see `deno task jazz:provision`), the AccountGate island lets the user elect to13 // back up and sync it, and recover it from a passkey or phrase. See the framework's14 // `docs/sync-and-recovery.md` guide.15 //16 // Hostnames you have committed to keeping stable, for the optional device-credential17 // primitive in `@nzip/lofi` (WebAuthn/PRF at-rest encryption). A credential binds18 // to its origin: localhost works for development without configuration, but a19 // deployed origin must be listed here before credentials can enroll on it. An20 // unlisted host is refused so a preview hostname cannot mint passkeys and21 // PRF-protected data that strand when the app moves to its production origin.22 credentialOrigins: [] as readonly string[],23 // Pin this to the canonical production hostname before users create recoverable24 // passkeys. Omit it in local development to use the current hostname.25 // passkey: { rpId: "app.example.com" },26 //27 // Update-lifecycle preferences are optional; this app runs the defaults on28 // purpose: when local data is newer than the cached shell, the framework's29 // minimal read-only banner renders and stale tabs reload after an update.30 // To render your own banner from useSchemaCompat and keep stale tabs open:31 // pwa: { updateBanner: "none", staleTabs: "prompt" },32 sync: { adapter: "jazz" as const },33 // Source/home link shown in the starter footer. Point it at your own repo.34 repositoryUrl: "https://github.com/FelineStateMachine/lofi",35});