User Wrapped
User Wrapped creates a personalized year-in-code visualization for individual GitHub users, showcasing their coding activity, contributions, and achievements across all repositories.What Makes It Different
Unlike Repository Wrapped which focuses on a single repository, User Wrapped:- Aggregates data from all repositories a user contributed to
- Tracks personal coding patterns and habits
- Highlights individual achievements and milestones
- Shows contribution streaks and consistency
- Analyzes up to 15 most active repositories to optimize performance
Metrics Tracked
Overview Statistics
Total Commits
All commits made by the user during the year
Pull Requests
Total PRs created across all repositories
Issues
Issues opened by the user
Total Stars
Cumulative stars across all user repositories
Language Proficiency
Analyzes programming language usage across all repositories:- Aggregated byte count per language
- Percentage distribution
- Top languages ranked by usage
Activity Patterns
Hourly Activity
Tracks commits by hour (0-23) to identify:- Peak productivity hours
- Night owl coding sessions
- Work schedule patterns
Daily Activity
Commit distribution by day of week:- Monday through Sunday breakdown
- Weekday vs. weekend coding habits
- Identifies the most active day
Monthly Activity
Tracks the busiest month:Contribution Streaks
Streak tracking helps visualize coding consistency and dedication throughout the year.
- Longest Streak - Maximum consecutive days of activity
- Total Active Days - Total days with at least one commit/PR/issue
- Most Active Day - Single day with the most activity
Monthly Snapshots
Detailed breakdown for each month including:- Commits
- Pull requests merged
- Issues opened and closed
- Top 3 repositories worked on that month
- Repository name
- Commits, PRs, and issues per repo
Top Repositories
Highlights the user’s top 5 most active repositories:- Repository name and owner
- Description
- Star count
- Primary language
How to Generate User Wrapped
For authenticated users viewing their own wrapped, the system can access private repository data using their GitHub access token. Public users only see public repository data.
Data Collection Process
ThebuildUserWrapped method in lib/analytics.ts performs the following:
-
Fetch User Profile
- Basic profile information
- Follower count
- Public repository count
-
Retrieve Repository List
- All repositories the user owns or contributed to
- Filtered by creation/activity in the target year
-
Optimize for Performance
- Limits deep scanning to top 15 most active repositories
- Prevents rate limit issues for users with 100+ repositories
- Uses parallel batch processing
-
Aggregate Activity Data
For each repository:
- Languages used
- User’s commits (filtered by date range)
- User’s pull requests
- User’s issues
-
Calculate Derived Statistics
- Language totals across all repos
- Activity patterns (hourly, daily, monthly)
- Contribution streaks
- Most active periods
Visualization Slides
The User Wrapped story includes:Slide 0: Introduction
Welcomes the user with their avatar and username.Slide 1: Overview Stats
Displays total commits, PRs, issues, and repositories.Slide 2: Top Languages
Visualizes the user’s programming language distribution.Slide 3: Busiest Month
Highlights which month had the most activity.Slide 4: Monthly Cadence
Shows activity trends across all months (if data exists).Slide 5: Top Repositories
Spotlights the repositories where the user was most active.Slides 6-8: Activity Patterns
- Hourly activity heatmap
- Daily activity breakdown
- Contribution streak visualization
Slide 9: Share
Social sharing options and link copying.Implementation Reference
Caching
User Wrapped data is cached with the key pattern:API Endpoint
Access user wrapped via:/wrapped/user/octocat/2024
The user wrapped feature gracefully handles API errors and missing data, ensuring a resilient user experience even when some repositories are inaccessible.