Badge System
Badges are permanent achievements that recognize your accomplishments in CodeJam. Each badge commemorates a specific milestone or skill mastery.Badge Schema
Badges are stored in theuser_badges table:
convex/schema.ts
Each badge is uniquely identified by a
badgeId string. The unlockedAt timestamp records when you earned it.Available Badges
CodeJam features multiple badge categories, each with unique unlock conditions.Badge Metadata
Badge definitions are managed server-side:convex/users.ts
Badge Gallery
Hello World Master
Badge ID:
hello-worldComplete your first challenge and join the CodeJam community.5 Day Streak
Badge ID:
streak-5Maintain activity for 5 consecutive days. Consistency is key!Bug Hunter
Badge ID:
bug-hunterExcel at finding and fixing syntax errors in code challenges.Algo Architect
Badge ID:
algo-architectMaster algorithmic challenges and optimize for performance.CSS Wizard
Badge ID:
css-wizardDemonstrate mastery of CSS layouts and styling.Unlocking Badges
Badges are awarded automatically when you meet specific criteria.Award Badge Mutation
TheawardBadge mutation grants badges:
convex/users.ts
Badges can only be unlocked once per user. The system prevents duplicate awards.
Unlock Conditions
hello-world
hello-world
“Hello World” MasterUnlock by: Completing your first code challenge
- Awarded on first successful challenge completion
- Welcomes new players to the platform
- Gateway badge for all users
streak-5
streak-5
5 Day StreakUnlock by: Maintaining activity for 5 consecutive days
- Tracked via
user.streak >= 5 - Requires daily activity (XP earning)
- Resets if you miss a day
bug-hunter
bug-hunter
Bug HunterUnlock by: Excelling at syntax error challenges
- Complete Syntax Smasher with perfect objectives
- Fix errors quickly and accurately
- Demonstrates debugging proficiency
algo-architect
algo-architect
Algo ArchitectUnlock by: Mastering algorithmic challenges
- Complete Algo Arena (Expert difficulty)
- Meet memory complexity requirements
- Pass all unit tests
css-wizard
css-wizard
CSS WizardUnlock by: Achieving CSS Combat mastery
- Complete CSS Combat with perfect layout matching
- Demonstrate flexbox and grid expertise
- Advanced CSS skills validated
Displaying Badges
Badges appear throughout the platform to showcase your achievements.Recent Badges Query
The dashboard displays your latest badges:convex/users.ts
This query returns the 3 most recently unlocked badges, sorted by
unlockedAt timestamp.Badge Display Components
Badges enhance multiple UI areas:Dashboard Widget
Shows your latest 3 badges with icons and titles
Profile Page
Full badge collection with unlock timestamps
Leaderboard
Badge highlights next to player names
Activity Feed
Real-time badge unlock notifications
Badge Icons
Each badge uses a distinct icon for visual recognition:Achievement Tracking
Monitor your progress toward locked badges:Progress Indicators
Badge Notifications
When you unlock a badge, the system may trigger notifications:Example Flow
Badge Rarity
Some badges are harder to earn than others:- Common
- Uncommon
- Rare
- Epic
Easy to unlock
- Hello World Master
- First-time completion badges
- Low barrier to entry
Future Badges
More badges are planned for future releases:Social Achievements
- Friend milestones
- Battle victories
- Collaboration badges
Mastery Badges
- Language-specific expertise
- Challenge speed records
- Perfect score runs
Campaign Progress
- Tier completion
- Boss defeats
- Campaign milestones
Special Events
- Seasonal badges
- Limited-time challenges
- Community events
Badge Strategy
Streak Protection
Streak Protection
Protect your 5-day streak
- Set daily reminders
- Complete at least one challenge per day
- Check-in before UTC day rollover
Challenge Mastery
Challenge Mastery
Target specific badge challenges
- Practice Syntax Smasher for Bug Hunter
- Master CSS Combat for CSS Wizard
- Optimize Algo Arena for Algo Architect
Completion Focus
Completion Focus
Prioritize badge-granting objectives
- Perfect runs over speed
- All objectives completed
- High-quality submissions
Next Steps
Progression
Learn about XP, levels, and streaks
Challenges
Explore challenges that unlock badges
Leaderboard
See who has the most badges
User API
Badge queries and mutations reference