Skip to content

Feature: Add referral program — share SYNCRO and earn perks #185

@Calebux

Description

@Calebux

Description

Word-of-mouth is the most effective growth channel for tools like SYNCRO. A referral program lets existing users invite friends and earn rewards (extended free tier, premium features, credits), while giving referred users an incentive to join.

Feature Scope

Referral System

Each user gets a unique referral link

https://syncro.app/ref/abc123

Referral Tracking

CREATE TABLE referrals (
  id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
  referrer_user_id UUID REFERENCES profiles(id),
  referred_user_id UUID REFERENCES profiles(id),
  referral_code TEXT NOT NULL,
  status TEXT DEFAULT 'pending', -- pending, signed_up, converted
  signed_up_at TIMESTAMPTZ,
  converted_at TIMESTAMPTZ,
  reward_granted BOOLEAN DEFAULT FALSE,
  created_at TIMESTAMPTZ DEFAULT NOW()
);

ALTER TABLE profiles ADD COLUMN referral_code TEXT UNIQUE;
ALTER TABLE profiles ADD COLUMN referred_by UUID REFERENCES profiles(id);

Referral Flow

  1. User A shares their referral link
  2. User B opens the link → referral code saved in cookie/localStorage
  3. User B signs up → referred_by set to User A's ID
  4. When User B adds their first subscription ("converted") → trigger reward

Rewards (configurable)

  • Referrer: 1 month free premium per successful referral
  • Referred: 14-day free trial extended to 30 days

UI Components

Share Panel (in settings or dashboard)

Invite friends to SYNCRO
━━━━━━━━━━━━━━━━━━━━━━━
Your referral link:
https://syncro.app/ref/abc123   [Copy]

[Share on Twitter]  [Share on WhatsApp]  [Copy Link]

You've referred: 3 friends
Rewards earned: 2 months free premium

Backend Endpoints

GET  /api/referrals/stats     — referral count, conversions, rewards
POST /api/referrals/validate  — validate referral code at signup
GET  /api/referrals/code      — get user's referral code (generate if missing)

Acceptance Criteria

  • Unique referral code generated per user
  • Referral tracked from signup through first conversion
  • Rewards automatically granted on conversion
  • Share panel in dashboard settings
  • Social share buttons with pre-filled message
  • Referral stats page showing earnings

Metadata

Metadata

Assignees

No one assigned

    Labels

    BackendStellar WaveIssues in the Stellar wave programenhancementNew feature or requestfrontendClient/frontend related

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions