# Task: Gamification (Stats & Badges) ## Objective Implement a stats engine and badge system to reward user engagement. ## Steps - [x] **Stats Engine**: - [x] Create service to calculate "Times Played" for songs. - [x] Create service to calculate "Gap" (shows since last played). - [x] Expose stats via `Song` and `Show` API responses. - [x] **Badges**: - [x] Create `Badge` model (name, icon, description). - [x] Create `UserBadge` model (user_id, badge_id, awarded_at). - [x] Implement logic to award badges (e.g., "First Review", "10 Shows Attended"). - [x] **Frontend**: - [x] Display Song Stats on Song Detail page. - [x] Display User Badges on Profile page. ## Acceptance Criteria - Song page shows "Times Played" and "Gap". - User profile displays earned badges.