refactor: update app module imports, enhance PWA support, and improve…#104
Open
D240021 wants to merge 1 commit intocode-flexing:mainfrom
Open
refactor: update app module imports, enhance PWA support, and improve…#104D240021 wants to merge 1 commit intocode-flexing:mainfrom
D240021 wants to merge 1 commit intocode-flexing:mainfrom
Conversation
… dashboard layout
|
@D240021 is attempting to deploy a commit to the vic's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
Hey @D240021! 👋 It looks like this PR isn't linked to any issue. If this PR is for one of the issues assigned to you as part of a Wave, please link it to ensure your contribution is tracked properly. You can do this by adding a keyword to the PR description (e.g.,
|
Collaborator
|
@D240021 pls resolve conflicts |
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.
Issue
Closes #48
Summary
This work delivers a mobile-first dashboard with offline-capable core flows, local persistence (IndexedDB via Dexie), automatic sync when connectivity returns, and PWA support (service worker + web app manifest). The goal is to let farmers view progress, vault balances, and AI-related content without a network connection, with data reconciled when back online.
What was implemented
Progressive Web App (PWA)
@ducanh2912/next-pwa(Workbox under the hood) innext.config.ts.public/manifest.jsonandpublic/icons/icon.svgfor installability and theming.fallbacks.documentto/offlineso navigation has a precached offline fallback when both network and cache miss.devandbuildscripts use--webpackso the PWA plugin (webpack-based) runs correctly.npm run build+npm run startto test the full PWA.Local storage & IndexedDB (Dexie)
dexiewith a dedicated database (harvest-finance-offline) storing:Synchronization
POST /api/v1/sync: server-side merge with last-write-wins using per-resource timestamps (seasonalTipsAt,vaultsAt,aiAt), persisting merged state under the Next.js app’sdata/directory (file-backed; suitable to replace with PostgreSQL/Supabase/Nest later).pushSync()runs when the app detects online again (useOfflineSync+useOnlineStatus).Mobile-oriented UI (dashboard area)
DashboardShell: mobile header, touch-friendly targets, safe-area padding, slide-out navigation drawer wired to the menu button (previously non-functional on small screens).OfflineIndicator: clear online/offline status for users.Feature wiring
VaultCard; loads/saves default vault list to IndexedDB for offline viewing; deposit/withdraw modals guard againstvault === nullduring SSR/prerender.Supporting / repo fixes (needed for a clean build)
app.module.tsand frontendportfolio/page.tsx.clsxandtailwind-merge(used bycn()).Card/Badgevariants,Stackgapvsspacing) and Stellar Freighter API usage (getPublicKey→getAddress).vault).How to verify
npm run build&&npm run startin the frontend.harvest-finance-offlinefor stored records./api/v1/syncrequests in the Network tab when sync runs.Out of scope / follow-ups
pushSync()covers “sync when connectivity is restored” for this codebase.