Skip to content

Frontend Integration: Fetch Dashboard Data from Backend API #177#189

Merged
ogazboiz merged 1 commit intoLabsCrypt:mainfrom
CMI-James-OD:codex/dashboard-api-streams-177
Feb 26, 2026
Merged

Frontend Integration: Fetch Dashboard Data from Backend API #177#189
ogazboiz merged 1 commit intoLabsCrypt:mainfrom
CMI-James-OD:codex/dashboard-api-streams-177

Conversation

@CMI-James
Copy link
Copy Markdown
Contributor

Description

Update the User Dashboard to fetch active and incoming streams from backend endpoints (GET /api/v1/streams), replacing mock/local-only behavior.

Closes #177

Changes proposed

What were you told to do?

I was asked to update the dashboard so it fetches user stream data from the merged backend API endpoint (GET /api/v1/streams) for outgoing and incoming streams, instead of relying on mock data.

What did I do?

Reworked dashboard stream data source to backend API

  • Updated frontend/lib/dashboard.ts to fetch streams from backend API for:
    • outgoing streams (sender=<publicKey>)
    • incoming streams (recipient=<publicKey>)
  • Added endpoint candidate resolution so frontend works with /api/v1/streams while remaining compatible with local /v1/streams setups.
  • Removed stale mock dashboard constants and centralized numeric/address mapping helpers.

Mapped backend stream payloads into dashboard-friendly structures

  • Converted backend stream amounts into display units.
  • Generated outgoing/incoming lists and recent activity from API responses.
  • Computed dashboard aggregates (totalSent, totalReceived, totalValueLocked, activeStreamsCount) from fetched streams.

Connected dashboard UI to live API data

  • Updated frontend/components/dashboard/dashboard-view.tsx to fetch snapshot data on wallet/session key load.
  • Added loading and error states for overview and incoming tabs.
  • Wired incoming tab to pass API-backed incomingStreams into IncomingStreams component.

Check List (Check all the applicable boxes)

  • My code follows the code style of this project.
  • This PR does not contain plagiarized content.
  • The title and description of the PR is clear and explains the approach.
  • I am making a pull request against the main branch (left side).
  • My commit messages styles matches our requested structure.
  • My code additions will fail neither code linting checks nor unit test.
  • I am only making changes to files I was requested to.

Screenshots / Testing Evidence

Validated with:

git commit hook (lint-staged) executed successfully:
- npm run lint --workspace=frontend --

@ogazboiz ogazboiz merged commit 258f5c3 into LabsCrypt:main Feb 26, 2026
0 of 3 checks passed
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 Integration: Fetch Dashboard Data from Backend API

2 participants