How I Fixed GitHub's 14 Days Repo Traffic Graph

7 hours ago 2

Max Shen

If you are an open-source maintainer sharing projects on GitHub, you are probably familiar with Github’s repository traffic graph that looks like this:

At first glance, this feature looks useful, but its limitation is clear: it only shows the past 14 days of your repo’s traffic data, making it hard to track long-term trends.

While searching for solutions, I realized that many developers face similar challenges. This issue is widely discussed, particularly in a GitHub thread: Track traffic to GitHub repo longer than 14 days #399.

Within the discussion, I came across a GitHub action that fetches traffic data and stores it in a CSV file, also generating a PDF report:

Now I can view my traffic data more than 14 days, which is a significant improvement.

However, its chart clarity and user interface is pretty bad, and it adds the complexity of setup and accessibility.

This is because, as a GitHub action, I have to manually setup the workflow file. Also, the output being in PDF format made it less accessible and harder to interact with.

After reflecting on these experiences, I listed out what my ideal tool would look like:

  1. Data access extending beyond 14 days
  2. Intuitive and beautiful chart design
  3. Simple setup

I keep searching tools like this but none of them meets all the requirements. So I decided to build my own!

After few months of working, I finally finished my own tool called Repohistory. Here are some screenshots:

Here’s the approach I took to fulfill all the requirements.

Showing data more than 14 days

It fetches traffic data with GitHub API and stores them in Supabase. This runs every day as a cron job to keep the data up to date.

Intuitive & beautiful chart design

I redesign the whole chart in a modern way and built them with shadcn/ui and Recharts.

Easy to setup

I integrates GitHub Apps into Repohistory, so that user only need to sign in and select the repos they want to track, then it is good to go.

In additional to tracking repo traffic data, I also add some features to make Repohistory even more useful.

Star history chart

The first one is the repo star history chart. It allows us to see the growth of this repo:

I also add a button to generate sharable image which you can use inside your repo README.md:

Release download chart

The other feature is a chart to show your releases overtime with the total downlaod count on each. Here’s an example from neovim/neovim:

Thank you for sticking with me on this ongoing journey of developing a tool to fix GitHub’s repo traffic graph! It’s been a challenging yet enjoyable experience.

However the journey doesn’t end here. I’m continually working on developing and adding some exciting new features to Repohistory. If you’re interested in this evolving project, feel free to check it out and stay updated on GitHub!

Read Entire Article