netlify / explorers

https://explorers.netlify.com/
MIT License
261 stars 40 forks source link

User Issue Achievement Reward Workflow #466

Closed bencodezen closed 3 years ago

bencodezen commented 3 years ago

Desired User Flow

  1. The user watches the last video in a mission
  2. Explorers sends a video-completed event to Activity Hub
  3. Activity Hub fires an event because we wrote data to Activity Hub
  4. A webhook runs to determine whether the user has completed a mission
  5. If yes, the webhook writes an achievent object to the Activity Hub database
  6. When Activity Hub gets new achievement data written, it fires another webhook
  7. The next webhook checks to see if the achievement unlocks a reward
  8. If yes, the webhook writes reward data to the rewards database
  9. Now Explorers can query the /achievements endpoint to get a list of achievements and rewards from Activity Hub
  10. On querying, a third function fires to determine whether a given reward has been claimed

Scheme and flow: https://miro.com/app/board/o9J_lWmoARA=/

Work to enable the above

What happens every time: