Skip to content

Conversation

@SatyamPandey-07
Copy link
Contributor

@SatyamPandey-07 SatyamPandey-07 commented Jan 22, 2026

Summary

Introduces a dynamic achievement system and a weighted global leaderboard to gamify user engagement.

Changes

  • Models: Achievement (definitions) and UserAchievement (progress tracking).
  • Engine: AchievementService automatically processes every activity log to update progress and unlock badges.
  • Scoring: Implemented GrindScore algorithm (Hard=3x, Medium=2x, Easy=1x) for fair rankings.
  • Leaderboard: Aggregation pipelines for Global and Friends-only rankings with percentile calculation.
  • Seeding: Auto-seeds default achievements (Consistency, LeetCode, Hard Hitter tiers) on startup.
  • Real-time: Integrated WebSocket triggers for "Achievement Unlocked" notifications.

API Endpoints

Method Endpoint Description
GET /api/achievements List user's locked/unlocked badges
GET /api/leaderboard/global Global ranking with pagination
GET /api/leaderboard/friends Ranking among friends

Fixes #190

- Created Achievement and UserAchievement models- Implemented AchievementService for real-time progress tracking- Added logic for consistency, platform, and difficulty-based badges- Built LeaderboardService with GrindScore calculation and weighted ranking- Added REST APIs for achievements and leaderboards- Integrated achievement seeding on server start
@Yugenjr
Copy link
Owner

Yugenjr commented Jan 22, 2026

conflicts !!

@SatyamPandey-07
Copy link
Contributor Author

image resolved @Yugenjr sir

@SatyamPandey-07
Copy link
Contributor Author

No conflict here sir

@Yugenjr
Copy link
Owner

Yugenjr commented Jan 22, 2026

add some screenshots of the issue being solved please !

@SatyamPandey-07
Copy link
Contributor Author

image

@SatyamPandey-07
Copy link
Contributor Author

done @Yugenjr

1 similar comment
@SatyamPandey-07
Copy link
Contributor Author

done @Yugenjr

@SatyamPandey-07
Copy link
Contributor Author

review and merge it sir

@SatyamPandey-07
Copy link
Contributor Author

@Yugenjr

@SatyamPandey-07
Copy link
Contributor Author

@Yugenjr

@SatyamPandey-07
Copy link
Contributor Author

image

@SatyamPandey-07
Copy link
Contributor Author

No conflicts with base branch @Yugenjr

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.

[Feature] Implement Hierarchical Achievement Engine & Global Leaderboard Logic

2 participants