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 / docs / reference / project-layout.md
project-layout.md 6.8K rendered
1# Generated project layout23The generated project is deliberately small: application source and branding are yours, while the4pinned `@nzip/lofi` package supplies runtime, PWA, identity, sync, diagnostics, and Astro/Vite5integration. Package commands regenerate framework tooling and production output without copying6framework source into the application.78```mermaid9flowchart TB10 Root["my-app/"]11 Root --> Config["Generated configuration"]12 Root --> Public["Product assets"]13 Root --> Src["Author-owned source"]14 Root --> Tests["Application tests"]15 Root -. command generated .-> Tooling[".lofi/<br/>ignored package tooling"]16 Root -. build generated .-> Dist["dist/<br/>build output"]17 Package["one pinned @nzip/lofi version"] --> Tooling18 Package --> Dist19 Package --> Src20```2122## Exact source-controlled file map2324The following keys are extracted by the documentation drift test and compared with a real generated25project. Adding or removing a generated file requires updating this map in the same change.2627<!-- generated-file-map:start -->2829| Path | Ownership category | Role |30| ------------------------------------ | ----------------------- | -------------------------------------------------------------------------------------- |31| `.env.example` | Generated configuration | Names optional public sync settings and server-only secrets without values. |32| `.gitignore` | Generated configuration | Keeps secrets, dependencies, package tooling, builds, and failure artifacts untracked. |33| `README.md` | Generated configuration | Gives the generated app's first commands, package boundary, and hosting path. |34| `deno.json` | Generated configuration | Pins one lofi package version and exposes the supported task surface. |35| `public/apple-touch-icon.png` | Product asset | Supplies the replaceable 180x180 iOS Home Screen icon. |36| `public/favicon.svg` | Product asset | Supplies the replaceable vector browser icon and source mark. |37| `public/icon-192.png` | Product asset | Supplies the regular 192x192 install icon. |38| `public/icon-512.png` | Product asset | Supplies the regular 512x512 install icon. |39| `public/icon-maskable-512.png` | Product asset | Supplies a padded 512x512 maskable icon with a safe-zone-aware mark. |40| `public/icon-monochrome.svg` | Product asset | Supplies the transparent silhouette used where the OS applies a solid icon color. |41| `public/screenshot-narrow.png` | Product asset | Supplies a replaceable labeled phone-sized install screenshot. |42| `public/screenshot-wide.png` | Product asset | Supplies a replaceable labeled desktop-sized install screenshot. |43| `public/manifest.webmanifest` | Product asset | Declares stable install identity, locale, scope, orientation, icons, and shortcuts. |44| `src/app.ts` | Author-owned source | Composes the app name, storage, sync, credential origins, and repository link. |45| `src/env.d.ts` | Generated configuration | Adds Astro and lofi build-time environment types. |46| `src/islands/AccountGate.tsx` | Author-owned source | Presents opt-in account backup, sync, and recovery controls. |47| `src/islands/TaskList.tsx` | Author-owned source | Implements the replaceable starter task experience. |48| `src/islands/use-tasks.ts` | Author-owned source | Binds the starter task table to Preact through public package APIs. |49| `src/layouts/Shell.astro` | Author-owned source | Owns document metadata, install links, and package boot. |50| `src/pages/index.astro` | Author-owned source | Composes the starter page and package-owned optional UI. |51| `src/permissions.ts` | Author-owned source | Declares application read and mutation policy. |52| `src/schema.ts` | Author-owned source | Declares persisted application tables and fields. |53| `src/styles/global.css` | Author-owned source | Styles the starter page, islands, and optional package surfaces. |54| `tests/auth_e2e_test.ts` | Application test | Demonstrates an opt-in browser credential round trip. |55| `tests/author-boundary_test.ts` | Application test | Prevents framework plumbing from returning to author UI. |56| `tests/backup_migration_e2e_test.ts` | Application test | Proves local rows survive sync election and the phrase guard stays pinned. |57| `tests/convergence_e2e_test.ts` | Application test | Demonstrates the optional two-client synced browser journey. |58| `tests/testing-contract_test.ts` | Application test | Type-checks the public local-first browser helpers. |59| `tsconfig.json` | Generated configuration | Enables strict Astro and Preact source checking. |6061<!-- generated-file-map:end -->6263## Regenerated and ignored output6465These paths are not source-controlled generated files. Package commands recreate them as needed.6667| Path | Ownership category | Role |68| -------- | ----------------------- | ---------------------------------------------------------------------------------------------------------------------- |69| `.lofi/` | Ignored package tooling | Materialized package runtime plus Astro/Vite/Jazz configuration used by `dev` and `build`. |70| `dist/` | Build output | Static production shell, hashed assets, install icons, build identity, precache manifest, and package-emitted `sw.js`. |7172Generated applications do not contain `src/_lofi/`, a source `public/sw.js`, or a checked-in73`astro.config.ts`. Upgrade the single pinned `@nzip/lofi` version to change framework behavior; edit74the author-owned source and product assets to change the application.