Welcome to CodeQuest - the enhanced coding platform with a comprehensive gamification system! This system transforms learning to code into an engaging, rewarding experience with XP, levels, achievements, and collaborative features.
- Experience Points (XP): Earn XP for various activities
- Level Progression: Level up as you gain XP
- Progress Tracking: Visual progress bars and level indicators
- Streak System: Maintain daily activity streaks for bonus rewards
- Achievements: Unlock achievements for reaching milestones
- Badges: Collect rare badges based on your performance
- Progress Tracking: See your progress toward unlocking achievements
- Categories: Milestone, streak, contest, collaboration achievements
- Daily Problems: New coding challenge every day
- Bonus XP: Early completion rewards
- Streak Bonuses: Maintain daily challenge streaks
- Difficulty Variety: Easy, medium, and hard challenges
- Code Reviews: Review and rate other users' submissions
- Mentorship: Request help from experienced coders
- Study Groups: Create and join study groups
- Group Sessions: Schedule collaborative coding sessions
- Global Rankings: See how you rank against other users
- Multiple Timeframes: All-time, weekly, and monthly rankings
- Visual Rankings: Top 3 users highlighted with special styling
- Statistics: View platform-wide statistics and records
Run the gamification migration to set up the required tables:
cd server
node run_gamification_migration.jsThe gamification system is automatically integrated into the main server:
cd server
npm startThe gamification components are automatically included in the React app:
cd client
npm start- Problem Solved: 50 XP
- Daily Challenge: 50-75 XP (with bonus)
- Code Review: 10 XP
- Study Group Created: 50 XP
- Study Group Joined: 10 XP
- Achievement Unlocked: Varies (25-500 XP)
- Badge Earned: 25-250 XP (based on rarity)
- Level 1: 0 XP
- Level 2: 100 XP
- Level 3: 250 XP
- Level 4: 475 XP
- Level 5: 812 XP
- And so on... (exponential growth)
- First Steps: Solve your first problem (50 XP)
- Problem Solver: Solve 10 problems (100 XP)
- Code Master: Solve 50 problems (250 XP)
- Algorithm Expert: Solve 100 problems (500 XP)
- Streak Master: Maintain 7-day activity streak (200 XP)
- Contest Champion: Win your first contest (300 XP)
- Helper: Help 5 users with code reviews (150 XP)
- Mentor: Become a mentor to 3 users (400 XP)
- Study Group Leader: Create and lead a study group (200 XP)
- Daily Challenger: Complete 5 daily challenges (300 XP)
- Common: 25 XP reward
- Rare: 50 XP reward
- Epic: 100 XP reward
- Legendary: 250 XP reward
- Newcomer: Welcome to the platform
- Quick Learner: Level up within your first week
- Consistent: Maintain activity for 30 days
- Problem Crusher: Solve problems in 5 different languages
- Speed Demon: Solve a problem in under 5 minutes
- Perfect Score: Get 100% on a contest
- Community Pillar: Receive 50 helpful votes on reviews
- Code Guru: Reach level 50
- Submit reviews on other users' code submissions
- Rate submissions from 1-5 stars
- Earn XP for helpful reviews
- Vote on review helpfulness
- Request help from experienced coders
- Specify problem areas and request messages
- Track mentorship request status
- Complete mentorship sessions
- Create public or private study groups
- Set maximum member limits
- Schedule group coding sessions
- Collaborate on specific problems
The gamified dashboard is automatically integrated into the main dashboard, showing:
- Current level and XP progress
- Daily challenges
- Recent achievements
- Activity streaks
- Quick access to all gamification features
New navigation items include:
- Dashboard: Enhanced with gamification features
- Leaderboard: Gamified rankings and statistics
- Profile: XP and achievement tracking
All endpoints are prefixed with /api/gamification:
GET /stats- Get user gamification statsGET /leaderboard- Get global leaderboardGET /achievements- Get user achievementsGET /badges- Get user badgesGET /daily-challenge- Get current daily challengePOST /daily-challenge/:id/complete- Complete daily challengeGET /xp-history- Get XP transaction history
POST /code-reviews- Submit code reviewGET /submissions/:id/reviews- Get submission reviewsPOST /mentorship/request- Request mentorshipPOST /study-groups- Create study groupGET /study-groups- Get study groups
Modify reward amounts in gamificationService.js:
// Example: Change problem solved reward
const PROBLEM_SOLVED_XP = 75; // Default: 50Update achievement thresholds in the migration file:
-- Example: Change "Code Master" requirement
UPDATE achievements
SET requirement_value = 75
WHERE name = 'Code Master';Modify the XP calculation function:
calculateXPForLevel(level) {
// Custom formula here
return Math.floor(100 * Math.pow(1.8, level - 1));
}- Login/Register: Create an account to start earning XP
- Solve Problems: Earn XP for each solved problem
- Daily Challenges: Complete daily challenges for bonus XP
- Join Study Groups: Collaborate with other coders
- Review Code: Help others and earn XP
- Track Progress: Monitor your level and achievements
- Run Migration: Set up the database schema
- Start Services: Launch the backend and frontend
- Test Features: Verify all gamification features work
- Customize: Adjust XP rewards and achievement requirements
- Monitor: Track user engagement and system performance
The gamification system provides valuable insights:
- User Engagement: Track daily active users and retention
- Learning Progress: Monitor problem-solving patterns
- Collaboration Metrics: Measure community interaction
- Achievement Distribution: Understand user motivation
Potential additions to the gamification system:
- Seasonal Events: Special challenges and rewards
- Team Competitions: Group-based contests
- Skill Trees: Specialized learning paths
- Social Features: Friend systems and challenges
- Mobile App: Dedicated mobile experience
- AI Recommendations: Personalized challenge suggestions
- XP not updating: Check database connection and service logs
- Achievements not unlocking: Verify achievement requirements and user progress
- Daily challenges not appearing: Check challenge creation and date logic
- Leaderboard not loading: Verify database queries and user data
Enable debug logging in the gamification service:
// In gamificationService.js
const DEBUG = true;
if (DEBUG) {
console.log('XP transaction:', { userId, xpAmount, transactionType });
}- Database Schema: See
server/database/migrations/002_gamification_system.sql - Service Implementation: Review
server/services/gamificationService.js - API Routes: Check
server/routes/gamification.js - Frontend Components: Explore
client/src/components/GamifiedDashboard.tsx
To contribute to the gamification system:
- Fork the repository
- Create a feature branch
- Implement your changes
- Add tests and documentation
- Submit a pull request
This gamification system is part of the competitive programming platform and follows the same license terms.
Happy Coding! 🎉
Transform your learning journey with gamification and make coding fun, engaging, and rewarding!