WorkLog is a local-first Expo Web PWA. The app keeps the main writing and reporting loop on the client, then optionally syncs a sanitized payload to Cloudflare D1 after login.
flowchart LR
User["User"] --> PWA["Expo Web PWA"]
PWA --> LocalStorage["Browser localStorage"]
PWA --> ModelAPI["User-selected model API"]
PWA --> Functions["Cloudflare Pages Functions"]
Functions --> D1["Cloudflare D1"]
PWA -. "API Key stays local" .-> LocalStorage
PWA -- "sanitized payload" --> Functions
App.jscontains the current single-file product shell and UI state.src/worklogcontains record parsing helpers.scripts/prepare-pwa.jsprepares the static PWA assets after Expo export.
functions/api/[[path]].jsexposes the Pages Functions API.migrations/schema.sqldefines users, sessions, and user data.wrangler.example.tomldocuments the required D1 binding.
- Records, goals, ideas, wishes, project metadata, model config, and report settings are stored locally.
- If the user logs in, the app sends a sanitized payload to
/api/data. - The backend stores the payload as JSON in D1.
- Model API keys are never sent to the backend.
Synced after login:
- Entries.
- Goals.
- Ideas.
- Wishes.
- Project archive metadata.
- Report kind and material toggles.
- Report template.
- Model provider, endpoint, and model name.
Never synced:
- Model API keys.
- Exported backup files.
- Browser data outside WorkLog keys.
flowchart TD
A["Write a fragment"] --> B["Structured record"]
B --> C["Calendar review"]
B --> D["Project dashboard"]
B --> E["Report generation"]
F["Goals / ideas / wishlist"] --> E
F --> B
D --> E