Braineos now has badges: eight on Braineos, each with up to four tiers from Bronze to Platinum, a trophy case on every profile and a share card for each one. The same code runs CertBrain and Finance Brain, so the design had to work for three sites with different ideas of what is worth rewarding. Three decisions shaped it.
Definitions live in code, chosen per site
The catalog is one TypeScript file. Each badge has an id, its tiers, the events that can change it, and a progress() function that returns a number:
{ id : "streak" , kind : "tiered" , tiers : [ 7 , 30 , 100 , 365 ] , events : [ "attempt_recorded" ] , progress : ( ctx ) => ctx . currentStreak ( ) , }
Enter fullscreen mode
Exit fullscreen mode
Each site’s profile lists the badges it uses. Braineos has Tower Defense, deck creation and “studied by others”. CertBrain’s list, not switched on yet, swaps those for course and practice-readiness badges.…