mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-06-19 21:31:46 +00:00
b194e8317d
Add genuine offline read/write capability for trips: - Dexie IndexedDB schema (trips, places, packing, todo, budget, reservations, files, mutationQueue, syncMeta, blobCache) - Repo layer for all domains: offline reads from Dexie, writes optimistically to Dexie and enqueue mutations for later replay - Mutation queue with UUID idempotency keys (X-Idempotency-Key), FIFO flush, temp-ID reconciliation on 2xx, fail-and-continue on 4xx - Trip sync manager: caches all trips with end_date >= today or null, auto-evicts 7d after end_date, fetches bundle endpoint in one request - Map tile prefetcher: bbox from place coords, zooms 10-16, 50MB cap, warms SW cache via fetch - Sync triggers: network online → flush + syncAll; WS reconnect → flush only (rate-limiter safe); visibilitychange/30s → flush only - WS remoteEventHandler writes through to Dexie on every event - Server idempotency middleware + idempotency_keys table (migration 100, 24h TTL nightly cleanup) - GET /api/trips/:id/bundle endpoint for efficient single-request sync - OfflineBanner component: amber (offline) / blue (syncing) / hidden - OfflineTab in Settings: cached trip list, re-sync and clear actions - usePendingMutations hook for per-item pending indicators Closes #505 #541
60 lines
1.6 KiB
JSON
60 lines
1.6 KiB
JSON
{
|
|
"name": "trek-client",
|
|
"version": "2.9.13",
|
|
"private": true,
|
|
"type": "module",
|
|
"scripts": {
|
|
"dev": "vite",
|
|
"prebuild": "node scripts/generate-icons.mjs",
|
|
"build": "vite build",
|
|
"preview": "vite preview",
|
|
"test": "vitest run",
|
|
"test:unit": "vitest run tests/unit",
|
|
"test:integration": "vitest run tests/integration src/**/*.test.{ts,tsx}",
|
|
"test:watch": "vitest",
|
|
"test:coverage": "vitest run --coverage"
|
|
},
|
|
"dependencies": {
|
|
"@react-pdf/renderer": "^4.3.2",
|
|
"axios": "^1.6.7",
|
|
"dexie": "^4.4.2",
|
|
"leaflet": "^1.9.4",
|
|
"lucide-react": "^0.344.0",
|
|
"marked": "^18.0.0",
|
|
"react": "^18.2.0",
|
|
"react-dom": "^18.2.0",
|
|
"react-dropzone": "^14.4.1",
|
|
"react-leaflet": "^4.2.1",
|
|
"react-leaflet-cluster": "^2.1.0",
|
|
"react-markdown": "^10.1.0",
|
|
"react-router-dom": "^6.22.2",
|
|
"react-window": "^2.2.7",
|
|
"remark-breaks": "^4.0.0",
|
|
"remark-gfm": "^4.0.1",
|
|
"topojson-client": "^3.1.0",
|
|
"zustand": "^4.5.2"
|
|
},
|
|
"devDependencies": {
|
|
"@testing-library/jest-dom": "^6.9.1",
|
|
"@testing-library/react": "^16.3.2",
|
|
"@testing-library/user-event": "^14.6.1",
|
|
"@types/leaflet": "^1.9.8",
|
|
"@types/react": "^18.2.61",
|
|
"@types/react-dom": "^18.2.19",
|
|
"@types/react-window": "^1.8.8",
|
|
"@vitejs/plugin-react": "^4.2.1",
|
|
"@vitest/coverage-v8": "^3.2.4",
|
|
"autoprefixer": "^10.4.18",
|
|
"fake-indexeddb": "^6.2.5",
|
|
"jsdom": "^29.0.1",
|
|
"msw": "^2.13.0",
|
|
"postcss": "^8.4.35",
|
|
"sharp": "^0.33.0",
|
|
"tailwindcss": "^3.4.1",
|
|
"typescript": "^6.0.2",
|
|
"vite": "^5.1.4",
|
|
"vite-plugin-pwa": "^0.21.0",
|
|
"vitest": "^3.2.4"
|
|
}
|
|
}
|