PWA: installable offline app with IndexedDB local storage - #2
Merged
Conversation
A PWA-mode rewrite of the storage layer for offline-capable, install- to-device usage. After installing the app from any host, all data lives locally on that device — no server, no Vercel filesystem. Changes: - Storage moved from filesystem markdown to IndexedDB (lib/idb-store.ts, using the idb package). Same Store/Project/Member/CFP shapes round- trip cleanly through object stores. - lib/store.tsx replaces fetch() calls with direct IDB reads/writes; every page keeps its existing useStore() interface. - API routes (app/api/**) deleted — no longer needed. - PDF generation moved client-side via @react-pdf/renderer's pdf() API (lib/pdf-client.ts). The Export PDF button generates a blob in the browser and triggers a download. - PWA manifest at app/manifest.ts (name, icons, theme, standalone display, start_url). - Service worker via @serwist/next caches the app shell so the PWA launches and navigates offline after first install. - New /settings page with Download (JSON or ZIP+markdown), Restore (JSON or ZIP), and Wipe-everything actions for moving data between devices. - Sidebar gains a Settings entry next to Archives, both pinned to the bottom. - lib/fs-store.ts deleted; report.tsx unchanged (works client- or server-side). Trade-offs: - Data is per-device, per-browser-profile. The PI moves between machines via Settings → Download backup → Restore on the other device. - After install, the app needs no internet to function. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
A separate-architecture branch of PI-hub that turns the app into an installable, offline-capable PWA with all data stored locally on the device after install.
This branch deliberately diverges from `main`: `main` has the server-driven markdown-on-disk model (good for self-hosting or sharing seed data), while this branch is a single-user device-local SPA.
Architecture changes
What's new
Trade-offs
Deployment
Same Next.js project; deploys to Vercel exactly like `main`. The PWA install button appears once the app is served over HTTPS. After install, the app runs offline.
Test plan
🤖 Generated with Claude Code