Skip to content

feat: replace mock data with live API calls - #36

Merged
collinsezedike merged 6 commits into
mainfrom
feat/purge-mock-data
May 10, 2026
Merged

feat: replace mock data with live API calls#36
collinsezedike merged 6 commits into
mainfrom
feat/purge-mock-data

Conversation

@collinsezedike

@collinsezedike collinsezedike commented May 9, 2026

Copy link
Copy Markdown
Collaborator

Closes #35

Summary

  • Wires VaultList and PortfolioSummary to live API via TanStack Query hooks (useVaults, usePositions)
  • Adds GET /api/v1/positions/:publicKey stub route to the Fastify API
  • Wraps the app in QueryClientProvider; deletes mockData.ts entirely
  • Adds Vite dev proxy (/api → localhost:3001) to eliminate CORS in development
  • Declares "type": "module" across API and shared packages to fix ESM top-level await errors
  • Replaces bare <p> empty states with a reusable EmptyState component (icon + title + description)

Test plan

  • pnpm dev starts both API and web without errors
  • GET /api/v1/vaults returns { vaults: [] } through the proxy
  • Vault list renders the empty state card (not a plain text string)
  • Connecting a wallet shows the portfolio empty state
  • Loading skeletons appear before data resolves
  • pnpm lint && pnpm typecheck && pnpm test all pass

@collinsezedike collinsezedike left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good progress. Mock data is fully gone. TanStack Query is wired correctly. The Vite proxy is a clean dev solution, and the empty states and skeletons are solid.

The only thing that needs fixing before this merges is the publicKey! assertion in usePositions which should be an explicit null guard instead. The unmatched position row rendering is also worth cleaning up. Raw vault IDs shouldn't reach the UI.

Everything else is nits.

Comment thread apps/web/src/hooks/usePositions.ts
Comment thread apps/web/src/components/dashboard/PortfolioSummary.tsx
Comment thread apps/web/src/lib/api.ts
Comment thread apps/web/src/hooks/usePositions.ts
@collinsezedike
collinsezedike merged commit 731b439 into main May 10, 2026
2 checks passed
@collinsezedike
collinsezedike deleted the feat/purge-mock-data branch May 10, 2026 16:40
@collinsezedike collinsezedike added enhancement New feature or request frontend Involves React components, Tailwind styling, or Next.js pages api Adds or modifies a REST endpoint in apps/api and removed enhancement New feature or request frontend Involves React components, Tailwind styling, or Next.js pages api Adds or modifies a REST endpoint in apps/api labels May 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Frontend] Replace mock data with live API calls

1 participant