Skip to content

added the component - #69

Merged
DevMuhdishaq merged 1 commit into
StelTade:mainfrom
nafsonig:feat/waitlist
Jun 21, 2026
Merged

added the component#69
DevMuhdishaq merged 1 commit into
StelTade:mainfrom
nafsonig:feat/waitlist

Conversation

@nafsonig

Copy link
Copy Markdown
Contributor

Update: I added a client referral UI component and wired it to the existing referral state/analytics.

  • Files added: src/app/(landing)/waitlist/components/ReferralProgram.tsx/waitlist/components/ReferralProgram.tsx#L1-L999)

  • What it does:

    • Displays the user's unique referral link and QR code (uses existing ReferralLink and QRCodeDisplay).
    • Shows referral count, calculated waitlist advancement (premium doubles per-referral credit).
    • Social share buttons: Twitter/X, Telegram, Discord, Email, Copy (calls trackShare to record shares).
    • Leaderboard UI (top 10) with masked/anonymous display names; attempts real-time updates via EventSource and falls back to a snapshot fetch.
    • Requests milestone notifications (example: free premium month at 5 referrals) by POSTing to /api/users/{userId}/notify-milestone when milestones are reached.
  • Redux integration: The component dispatches fetchDashboard(userId) and uses trackShare from referralSlice.ts.

  • Backend requirements (to meet DoD / Acceptance Criteria):

    • GET /api/referrals/leaderboard — returns current leaderboard snapshot (JSON { leaderboard: LeaderboardItem[] }).
    • GET /api/referrals/leaderboard/stream — SSE stream emitting leaderboard arrays for realtime updates.
    • POST /api/users/:userId/notify-milestone — sends milestone emails/notifications.
    • GET /api/users/:userId/dashboard — already referenced by the frontend (must return referralCode, successfulReferrals, totalReferrals, points, rank, referrals[]).
  • Next steps I can do (pick one):

    • Wire ReferralProgram into the post-signup/waitlist page and add route/UI placement.
    • Implement the server API endpoints (leaderboard, SSE, notify-milestone) and referral attribution logic.
    • Add unit / integration tests and a small e2e scenario for sharing + leaderboard update.

Which next step should I take?

Made changes.

Closes #62

@DevMuhdishaq
DevMuhdishaq merged commit 868d074 into StelTade:main Jun 21, 2026
0 of 2 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.

Create Waitlist Referral Program Component

2 participants