Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: prototype of referral system in console #142

Open
wants to merge 27 commits into
base: main
Choose a base branch
from

Conversation

travis
Copy link
Member

@travis travis commented Oct 25, 2024

Summary

This PR spikes out a referral system that stores data in Cloudflare's D1. It allows anonymous or logged-in users to create referral codes associated with their email addresses, and records the referral code a user used to sign up for an account. It does not implement the discounts and other rewards associated with the referral system - these are expected to be handled manually in the first released version and implemented as automated systems later, so are a non-goal of this PR.

Referrals service

The referrals service has been extracted to its own worker:

storacha/referrals-service#1

User Experience

The UX is just about dialed in - need to do a pass on the copy and some minor layout stuff, but if you have any thoughts on the big picture now is a great time to chime in!

Screenshot 2024-11-05 at 4 01 18 PM Screenshot 2024-11-05 at 4 00 10 PM Screenshot 2024-11-05 at 4 00 20 PM Screenshot 2024-11-05 at 5 57 42 PM

TODOs

  • document referrals system development process
  • document referrals system design
  • integrate designs from UX designer

use server actions for now
server actions are confusing and weren't working properly
@travis travis marked this pull request as draft October 25, 2024 10:26
Copy link
Contributor

github-actions bot commented Oct 25, 2024

Website preview 🔗✨

build log

also record refcode in the plan gate, too
extracted from original implementation in #142
travis added a commit to storacha/referrals-service that referenced this pull request Nov 8, 2024
extracted from original implementation in storacha/console#142
travis added a commit to storacha/referrals-service that referenced this pull request Nov 8, 2024
extracted from original implementation in storacha/console#142
travis added a commit to storacha/referrals-service that referenced this pull request Nov 8, 2024
extracted from original implementation in storacha/console#142
@travis travis marked this pull request as ready for review November 8, 2024 00:59
bugfixes, autogenerate refcode when possible
for some reason the UI isn't updating in the preview env - I suspect this is because we haven't told SWR it needs to refresh and its refresh behavior is more liberal in development
I was thinking the state would be shared between invocations of the hook and that's just not the case! I'd need to introduce a context to get it to work the way I expected. DOH.

move to an argument passing style because that's easier than introducing a context, for now
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.

1 participant