feat: add XP gamification system#1525
Open
weiwei-gitch wants to merge 1 commit into
Open
Conversation
- Add xp, level, streak, lastActivityDate, xpHistory fields to User model - Create backend/utils/xpUtils.js with XP values, level thresholds, streak logic - Award XP on task completion in taskController (priority-based + streak bonuses) - New GET /api/xp endpoint via xpController + xpRoutes - Expose xp/level/streak in all authController user payloads - Add frontend/src/utils/xpUtils.js with getLevelInfo() helper - Add XPContext (global XP state, triggerXPReward, toast management) - Add XPToast component (animated floating +XP notification) - Add XPProgressBar component (compact for Dashboard, full for Profile) - Wire XPProvider into main.jsx, XPToast into App.jsx - useTasks: fire triggerXPReward after successful task completion - Dashboard: XPProgressBar compact card in stats row - Profile: XP & Progress card with level, progress bar, streak, recent history - Analytics: Total XP metric card in key metrics grid
Owner
|
resolve conflicts |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Implements a full XP (Experience Points) gamification system for DailyForge. Users now earn XP for completing tasks based on priority, maintain daily streaks for consistency bonuses, and progress through 10 levels. XP is displayed on the Dashboard, Profile, and Analytics pages with animated toast notifications on reward.
Related Issue
Closes #1179
Changes Made
Checklist
Notes for Reviewers