-
Notifications
You must be signed in to change notification settings - Fork 47
Description
Feature Description
Replace mock profile statistics (contributions, pull requests, issues closed, stars) with real-time data fetched from GitHub API. Currently, the profile page shows hardcoded numbers that don't reflect actual user activity.
Problem Statement
The profile page displays mock statistics (149 contributions, 86 PRs, 53 issues closed, 128 stars) that are the same for all users. This provides no real value and misleads users about their actual GitHub activity. Users expect to see their genuine contribution metrics.
Proposed Solution
Backend:
- Create new endpoint: GET /api/v1/github/stats/{username}
- Fetch real data from GitHub API:
- Total contributions (from GraphQL API)
- Pull requests count (search API: author:username type:pr)
- Issues closed (search API: author:username type:issue is:closed)
- Total stars received (sum stars from user's repos)
- Cache results for 1 hour to avoid rate limits
- Return structured JSON with all stats
Frontend:
- Update profile page to fetch from new endpoint
- Replace mock data in mockData.stats object
- Add loading skeleton while fetching
- Handle errors gracefully (show "Unable to load stats")
API Endpoints to use:
GET https://api.github.com/users/{username}/repos
GET https://api.github.com/search/issues?q=author:{username}+type:pr
GET https://api.github.com/search/issues?q=author:{username}+type:issue+is:closed
Component
Frontend
Alternative Solutions
No response
Additional Context
Current mock data location: frontend/app/profile/page.tsx line ~70
stats: {
contributions: 149,
pullRequests: 86,
issuesClosed: 53,
stars: 128,
}GitHub API rate limits: 5000 requests/hour (authenticated), so caching is essential.
Reference: GitHub's own profile stats implementation