Frontend: Wire Profile page to real API data #4

Closed
opened 2026-04-26 08:15:02 +00:00 by TopherMayor · 0 comments
Owner

Summary

Replace the hardcoded mockUser and mockComparisons in src/app/(main)/profile/page.tsx with real API calls.

Implementation

  1. Fetch user info from auth session (Better Auth client)
  2. Replace mockComparisons with fetch to GET /api/user/comparisons
  3. Replace stats with fetch to GET /api/user/stats
  4. Add loading skeletons for stats cards and comparison grid
  5. Add "not signed in" state — redirect to sign-in or show CTA
  6. Keep empty state — "No comparisons yet" with Create button

Files

  • Modify: src/app/(main)/profile/page.tsx
  • Depends on: API endpoints from issue #2

Acceptance Criteria

  • Profile shows real user data from auth session
  • Stats cards show real counts
  • Comparison grid shows user's actual comparisons
  • Unauthenticated users see sign-in prompt
  • Empty state works when user has no comparisons
## Summary Replace the hardcoded `mockUser` and `mockComparisons` in `src/app/(main)/profile/page.tsx` with real API calls. ## Implementation 1. **Fetch user info** from auth session (Better Auth client) 2. **Replace mockComparisons** with fetch to `GET /api/user/comparisons` 3. **Replace stats** with fetch to `GET /api/user/stats` 4. **Add loading skeletons** for stats cards and comparison grid 5. **Add "not signed in" state** — redirect to sign-in or show CTA 6. **Keep empty state** — "No comparisons yet" with Create button ## Files - Modify: `src/app/(main)/profile/page.tsx` - Depends on: API endpoints from issue #2 ## Acceptance Criteria - [ ] Profile shows real user data from auth session - [ ] Stats cards show real counts - [ ] Comparison grid shows user's actual comparisons - [ ] Unauthenticated users see sign-in prompt - [ ] Empty state works when user has no comparisons
TopherMayor added this to the v0.2 - Feed & Profile milestone 2026-04-26 08:15:02 +00:00
TopherMayor added the featurefrontend labels 2026-04-26 08:15:02 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: TopherMayor/comparaison#4