Add badges and achievements system #18

Open
opened 2024-01-14 14:23:56 -06:00 by jimmyb · 0 comments
Owner

MyVideoGameList needs a badges/achievements system so users can earn visible recognition for meaningful site activity such as building a game list, completing games, commenting, wishlisting games, and long-term membership.

The original issue listed many possible achievements across games, comments, reviews, blogs, forums, social accounts, favorites, and wishlists. In the current Laravel checkout, user profiles, game lists, profile comments, game comments, wishlists, profile stats, and social profile fields exist, while reviews, blogs, forums, favorites, and social account linking are still incomplete or future work. This issue tracks building the reusable badge foundation first, then wiring active badge rules to the content surfaces that currently exist.

Scope

  • Badge and user-earned-badge persistence.
  • Badge definitions, criteria metadata, display order, and enabled/disabled state.
  • Award logic for current Laravel activity sources.
  • Profile display for earned badges.
  • Optional user-facing all-badges page.
  • Admin or code-managed badge definitions, whichever fits the first implementation.
  • Future rule hooks for reviews, blogs, forums, favorites, social account linking, and other rebuilt features.

Acceptance Criteria

  • The app has a reusable badge model and a durable record of which users earned which badges.
  • Badge awarding is idempotent and does not grant duplicate earned badges.
  • Users can earn badges based on currently available data, including membership age, games added to list, completed games, concurrent playing count, profile comments left, game comments left, wishlisted games, and profile status setup.
  • Badge criteria ignore soft-deleted records where the underlying feature treats them as removed.
  • Earned badges are visible on public user profiles in a compact, readable section.
  • A user-facing badge index or profile badge page shows earned and unearned badges where practical.
  • Badge definitions include name, description, icon/visual class or asset, criteria key, threshold, and display order.
  • Future achievements for reviews, blogs, forums, favorites, and social account connections can be added without changing the earned-badge storage model.
  • Award checks can run after relevant user actions and through a backfill/recalculation command for existing users.
  • User-facing UI supports light/dark mode and follows existing Laravel/Tailwind site layout patterns.

Test Coverage Required

  • Feature/unit tests for badge definition loading and earned-badge persistence.
  • Tests confirming badge awards are idempotent and do not duplicate records.
  • Tests for game-list badges, including first game added, threshold counts, first completed game, completed-game thresholds, and concurrent playing thresholds.
  • Tests for profile comment, game comment, wishlist, membership-age, and profile-status badges.
  • Tests confirming soft-deleted game list, comment, and wishlist records do not count toward badges.
  • Feature tests confirming earned badges render on public user profiles.
  • Command tests for any badge recalculation/backfill command.
  • Regression tests confirming future unsupported achievement categories do not break badge rendering.
  • Tests should use Pest and focused feature coverage.
  • Run the focused affected tests, then run vendor/bin/pint --dirty before closing the issue.

Progress Checklist

  • Public user profile page exists
  • Game list persistence exists
  • Profile comment persistence exists
  • Game comment persistence exists
  • Wishlist persistence exists
  • User membership timestamps exist
  • Profile status/social profile fields exist
  • Add badge persistence and model
  • Add earned user badge persistence and relationships
  • Define initial badge catalog for currently supported activity sources
  • Add badge awarding service or action layer
  • Trigger badge checks from relevant user actions
  • Add badge recalculation/backfill command for existing users
  • Render earned badges on user profiles
  • Add optional user badge index/profile badge page
  • Prepare future rule hooks for reviews, blogs, forums, favorites, and social account linking
  • Add tests for criteria, awarding, idempotency, soft-delete filtering, profile display, and recalculation
  • Confirm the badges system can grow as legacy features are rebuilt
MyVideoGameList needs a badges/achievements system so users can earn visible recognition for meaningful site activity such as building a game list, completing games, commenting, wishlisting games, and long-term membership. The original issue listed many possible achievements across games, comments, reviews, blogs, forums, social accounts, favorites, and wishlists. In the current Laravel checkout, user profiles, game lists, profile comments, game comments, wishlists, profile stats, and social profile fields exist, while reviews, blogs, forums, favorites, and social account linking are still incomplete or future work. This issue tracks building the reusable badge foundation first, then wiring active badge rules to the content surfaces that currently exist. ## Scope - Badge and user-earned-badge persistence. - Badge definitions, criteria metadata, display order, and enabled/disabled state. - Award logic for current Laravel activity sources. - Profile display for earned badges. - Optional user-facing all-badges page. - Admin or code-managed badge definitions, whichever fits the first implementation. - Future rule hooks for reviews, blogs, forums, favorites, social account linking, and other rebuilt features. ## Acceptance Criteria - The app has a reusable badge model and a durable record of which users earned which badges. - Badge awarding is idempotent and does not grant duplicate earned badges. - Users can earn badges based on currently available data, including membership age, games added to list, completed games, concurrent playing count, profile comments left, game comments left, wishlisted games, and profile status setup. - Badge criteria ignore soft-deleted records where the underlying feature treats them as removed. - Earned badges are visible on public user profiles in a compact, readable section. - A user-facing badge index or profile badge page shows earned and unearned badges where practical. - Badge definitions include name, description, icon/visual class or asset, criteria key, threshold, and display order. - Future achievements for reviews, blogs, forums, favorites, and social account connections can be added without changing the earned-badge storage model. - Award checks can run after relevant user actions and through a backfill/recalculation command for existing users. - User-facing UI supports light/dark mode and follows existing Laravel/Tailwind site layout patterns. ## Test Coverage Required - Feature/unit tests for badge definition loading and earned-badge persistence. - Tests confirming badge awards are idempotent and do not duplicate records. - Tests for game-list badges, including first game added, threshold counts, first completed game, completed-game thresholds, and concurrent playing thresholds. - Tests for profile comment, game comment, wishlist, membership-age, and profile-status badges. - Tests confirming soft-deleted game list, comment, and wishlist records do not count toward badges. - Feature tests confirming earned badges render on public user profiles. - Command tests for any badge recalculation/backfill command. - Regression tests confirming future unsupported achievement categories do not break badge rendering. - Tests should use Pest and focused feature coverage. - Run the focused affected tests, then run `vendor/bin/pint --dirty` before closing the issue. ## Progress Checklist - [x] Public user profile page exists - [x] Game list persistence exists - [x] Profile comment persistence exists - [x] Game comment persistence exists - [x] Wishlist persistence exists - [x] User membership timestamps exist - [x] Profile status/social profile fields exist - [ ] Add badge persistence and model - [ ] Add earned user badge persistence and relationships - [ ] Define initial badge catalog for currently supported activity sources - [ ] Add badge awarding service or action layer - [ ] Trigger badge checks from relevant user actions - [ ] Add badge recalculation/backfill command for existing users - [ ] Render earned badges on user profiles - [ ] Add optional user badge index/profile badge page - [ ] Prepare future rule hooks for reviews, blogs, forums, favorites, and social account linking - [ ] Add tests for criteria, awarding, idempotency, soft-delete filtering, profile display, and recalculation - [ ] Confirm the badges system can grow as legacy features are rebuilt
Codex changed title from Add Badges System to Add badges and achievements system 2026-05-26 00:31:04 -05:00
Sign in to join this conversation.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
MyVideoGameList/myvideogamelist.com#18
No description provided.