Skip to content

fix: fetch real GitHub contribution data for heatmap instead of Math.random() (#185)#259

Merged
indresh404 merged 2 commits into
indresh404:mainfrom
5hivam123:fix/heatmap-real-github-data
Jun 3, 2026
Merged

fix: fetch real GitHub contribution data for heatmap instead of Math.random() (#185)#259
indresh404 merged 2 commits into
indresh404:mainfrom
5hivam123:fix/heatmap-real-github-data

Conversation

@5hivam123
Copy link
Copy Markdown
Contributor

Description

Replaced static Math.random() generated heatmap data with real
GitHub contribution data fetched from GitHub Contributions API
using the logged-in user's githubUsername.

Changes:

  • Removed static heatmapCells array using Math.random()
  • Added useState for heatmapCells initialized to empty
  • Added useEffect to fetch real contribution data from
    github-contributions-api.jogruber.de using githubUsername
  • Mapped real contribution counts to heatmap color levels (0-4)

Related Issue

Fixes #185

Type of Change

  • Bug fix (non-breaking change which fixes an issue)

Screenshots / Videos (if applicable)

[Add screenshot of Dashboard showing real GitHub heatmap data]

Testing Done

  • Visual verification on local dev server (http://localhost:5173)
  • Heatmap now shows consistent data on refresh ✅
  • Heatmap reflects real GitHub contributions ✅
  • Falls back gracefully if API fails ✅
  • No console errors or warnings

Checklist

  • My code follows the style guidelines of this project.
  • I have performed a self-review of my own code.
  • My changes generate no new warnings or console errors.

Contributor Declaration

  • I confirm that this contribution is made under the rules of NSoC 2026.
  • I confirm that I have been assigned the related issue by a maintainer before opening this PR.
  • I have read the Contributing Guidelines and Code of Conduct.

@5hivam123 5hivam123 requested a review from indresh404 as a code owner June 3, 2026 13:27
@vercel
Copy link
Copy Markdown

vercel Bot commented Jun 3, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
ranker-hub Ready Ready Preview, Comment Jun 3, 2026 1:37pm

@github-actions github-actions Bot added backend Backend/Firebase related changes bug Something isn't working documentation Improvements or additions to documentation enhancement New feature or request frontend Frontend related changes (HTML/CSS/JS/React) gssoc GirlScript Summer of Code gssoc26 GirlScript Summer of Code 2026 nsoc NSoC NSoC'26 NSoC 2026 pending-review PR is pending review labels Jun 3, 2026
@indresh404 indresh404 merged commit 43eb9f6 into indresh404:main Jun 3, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend Backend/Firebase related changes bug Something isn't working documentation Improvements or additions to documentation enhancement New feature or request frontend Frontend related changes (HTML/CSS/JS/React) gssoc GirlScript Summer of Code gssoc26 GirlScript Summer of Code 2026 level3 nsoc NSoC NSoC'26 NSoC 2026 pending-review PR is pending review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: [Bug]: Git Contribution Heatmap uses random static data instead of real GitHub data

2 participants