Commit Graph

3 Commits

Author SHA1 Message Date
Jeff Emmett 12d3e86e13 feat(rcart): merge group shopping into rCart module
Add shared shopping carts with URL product extraction, pooled funding,
and extension support alongside existing cosmolocal catalog/orders.

- Shopping cart schemas (ShoppingCartDoc, ShoppingCartIndexDoc)
- Server-side product extraction (JSON-LD, meta tags, Amazon/Shopify)
- 13 new API routes (cart CRUD, items, contributions, extension endpoints)
- 3-tab UI (Carts/Catalog/Orders) with cart detail, funding progress
- Local-first client subscriptions for real-time cart sync
- Updated landing page to reflect group shopping workflow

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-10 01:21:38 -07:00
Jeff Emmett 63ac2a268e perf: parallelize local-first init — batch IDB loads, cache crypto keys, preload sync states
Sequential document loading during init() was the main bottleneck: each cached
doc required a serial IDB read + key derivation + decryption + Automerge.load.
With N documents this meant N× single-doc latency instead of 1×.

Changes:
- Add loadMany() to EncryptedDocStore for parallel Promise.all() batch loading
- Cache derived space/doc CryptoKeys in DocCrypto (one derivation per session)
- Add preloadSyncStates() to DocSyncManager for parallel sync state loading
- Update all 11 module local-first-client init() methods to use batch APIs

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-03 14:18:55 -08:00
Jeff Emmett ef3d0ce447 feat: batch local-first migration for 10 modules (Phase 3)
Add Automerge schemas, lifecycle hooks (onInit, docSchemas), and
local-first client wrappers for all remaining PG modules:
rWork, rVote, rCal, rFiles, rCart, rBooks, rTrips, rInbox, rSplat, rFunds.

Each module now:
- Defines typed Automerge document schemas (schemas.ts)
- Registers docSchemas and onInit hook with SyncServer reference
- Moves initDB() from top-level to onInit for unified startup
- Has a client-side local-first wrapper (local-first-client.ts)

Dual-write route handlers will be wired incrementally per module
following the rNotes pattern established in Phase 2.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-02 14:01:58 -08:00