Skip to content
<Rojit />
4 min read· August 27, 2026

How I Built a Git Contribution Heatmap for My Portfolio

Personal projects on GitHub, work on GitLab — one heatmap couldn't show the full picture. Here's how @rojeets/git-stats merges both into a single contribution view.

Written by Rojit Pokharel — Full-Stack Web Developer & System Architect, Kathmandu, Nepal

Open SourceReactnpmGitHubGitLabPortfolio
How I Built a Git Contribution Heatmap for My Portfolio
$

I contribute to personal projects on GitHub and client work lives on GitLab. Every contribution heatmap I found only showed one platform — hiding half my actual activity. So I built @rojeets/git-stats, an npm package that merges both into a single view.

The Problem: Distributed Contributions

If you work across multiple Git platforms, your contribution history is split. A GitHub heatmap shows your open-source work. A GitLab heatmap shows your professional commits. Neither tells the full story.

  • Personal projects live on GitHub — the green squares stop there
  • Organization work lives on GitLab — invisible to your GitHub profile
  • No single heatmap shows your real coding activity across both

I wanted a centralized heatmap on my portfolio that merges both platforms into one view.

What @rojeets/git-stats Does

It fetches contribution calendars from GitHub and GitLab concurrently, merges them (summing counts on overlapping dates), and computes stats over the combined data.

typescript
import { getStats } from "@rojeets/git-stats";

const { merged, stats } = await getStats({
  github: "rojeets",
  gitlab: "rojeets"
});

console.log(stats);
// {
//   total: 1234,
//   currentStreak: 5,
//   longestStreak: 42,
//   bestDay: { date: "2025-06-01", count: 87 },
//   dailyAverage: 3.4
// }
Add It to Your Portfolio in 3 Lines

The package ships a React server component. Drop it in any Next.js page — no client-side JS, no API routes, no CORS issues:

bash
npm install @rojeets/git-stats
tsx
import { GitStats } from "@rojeets/git-stats";

export default function SkillsPage() {
  return (
    <GitStats
      github="your-username"
      gitlab="your-username"
    />
  );
}

The component fetches data on the server, renders the heatmap and stats, and sends zero JavaScript to the browser.

Customization

Override colors with CSS variables for dark themes:

css
.git-stats {
  --gs-text: #e5e5e5;
  --gs-text-secondary: #a3a3a3;
  --gs-bg: #18181b;
  --gs-border: #27272a;
  --gs-label: #a3a3a3;
}
Why This Matters for Portfolios

A contribution heatmap is visual proof of consistency. When a recruiter or client visits your portfolio, they see real activity — not a static screenshot. Merging GitHub and GitLab shows the full picture.

Links

Building a product like this?

I build production web applications end-to-end — custom code, real-time systems, and deployments. Let's discuss your project.

Get in Touch