Skip to content

Build a real-time rewards visualization module consuming guildpass-core reward/streak data #340

Description

@Lakes41

Difficulty: Expert
Type: feature

Background
The README lists "rewards visualization" among the intentionally deferred features, while guildpass-core's data model already includes badges (placeholder) and outbox event types that a reward/streak engine would emit if implemented there.

Problem
Even once guildpass-core can compute rewards/streaks (a related deferred capability there), this frontend has no visualization surface for members to see their own reward history/streaks or for admins to see community-wide reward distribution — and no defined contract for how this frontend would consume that data live.

Expected outcome
A member-facing "My Rewards" view shows streak status and reward/badge history with live updates as new rewards are earned, and an admin-facing "Community Rewards" view shows aggregate distribution, both built against a clearly documented (and mock-implemented) API contract this frontend expects from guildpass-core.

Suggested implementation

  • Document the expected guildpass-core endpoints (e.g., GET /v1/members/:address/rewards, GET /v1/community/rewards/summary) in a new docs/rewards-contract.md, aligned with the outbox event types already documented there if a reward engine is later built to emit them.
  • Implement full mock support in lib/api/mock.ts: seeded streak/reward history for members, and aggregate summary data for the admin view.
  • Build the member "My Rewards" page (streak visualization, badge/reward timeline) and the admin "Community Rewards" page (distribution chart, top contributors).
  • For "live updates," implement a polling-based refresh (React Query's refetchInterval) as the practical, incrementally-adoptable approach, documenting how a future push-based mechanism (SSE/WebSockets) could replace it once guildpass-core supports it.
  • Ensure the module is additive and doesn't assume guildpass-core's reward engine exists yet — live-mode calls should degrade gracefully (clear "not yet available" state) if the backend doesn't implement the documented contract.

Acceptance criteria

  • Both member and admin reward views fully function in mock mode
  • API contract documented clearly enough for independent backend implementation
  • Live mode degrades gracefully (no hard crash) if the backend doesn't yet support the contract
  • Data refreshes periodically without requiring a manual page reload

Likely affected files/directories

  • app/rewards/ (new, member + admin views)
  • lib/api/mock.ts, lib/api/live.ts, lib/api/types.ts
  • docs/rewards-contract.md (new)

Metadata

Metadata

Labels

GrantFox OSSGrantFox Open Source Sponsorship program tagMaybe RewardedIssue may qualify for a reward upon successful completion per campaign rulesOfficial Campaign | FWC26Official FWC26 campaign issue — eligible for campaign scoring and rewardsexpertExpert difficulty tasks requiring deep expertise and architectural decision-makingfeatureNew feature, enhancement, or functional addition

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions