Skip to content

frontend: Replace LocalStorage Mock Store Fallbacks with Live Backend API Integration #1032

Description

@ONEONUORA

Problem Description

The frontend relies heavily on frontend/lib/mockStore.ts to simulate plan creation, plan listing, and KYC status using browser localStorage. When connected to a live backend service, pages such as /asset-owner/plans, /asset-owner/plans/[planId], and /asset-owner/plans/claim should query the Axum backend API endpoints instead of reading from localStorage.

Missing Functionality & Specs

  • Refactor useApiQuery and plan context providers to call /api/plans, /api/plans/{id}, and /api/kyc/status from the backend service.
  • Provide proper fallback/demo toggles via environment variable (NEXT_PUBLIC_USE_MOCK_DATA=true/false).
  • Implement robust error states, loading skeletons, and automatic data revalidation when connected to backend API endpoints.
  • Ensure authentication headers (JWT or Ed25519 signature headers) are attached when fetching protected resources.

Affected Files

  • frontend/lib/mockStore.ts
  • frontend/hooks/useApiQuery.ts
  • frontend/app/asset-owner/plans/page.tsx
  • frontend/app/asset-owner/plans/[planId]/page.tsx

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

GrantFox OSSIssue tracked in GrantFox OSSMaybe RewardedIssue may be eligible for a GrantFox rewardThird CampaignCampaign: Third Campaign

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions