DEV Community

Cover image for How I fixed GitHub's repo traffic insights 🛠️ 📊
Max Shen for Repohistory

Posted on • Updated on • Originally published at

How I fixed GitHub's repo traffic insights 🛠️ 📊

Start of the journey

If you are a developer sharing projects on GitHub, you are probably familiar with Github's repository traffic insights that looks like this:


This feature, while useful, has its limitations. The most notable issues include a 14-day limit on data retention and a chart that can be confusing due to different scales for each type of data.

While looking 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.

Exploring alternatives

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

Now the first problem is solved! I can view my traffic data more than 14 days, which is a significant improvement.

However, it doesn't solve the issues of chart clarity and user interface at all, and it adds the complexity of setup and accessibility.

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

Crafting my own solution

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

  1. Data access extending beyond 14 days
  2. Intuitive chart design
  3. Enhanced user interface
  4. Simple setup and accessibility

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:

screenshot of Repohistory

Here's the approach I took to fulfill all the 4 requirements.

Showing data more than 14 days

It fetches traffic data with GitHub API and stores them in Supabase. This is run on the first intsallation and also twice a day with cron job to keep the data up to date.

Intuitive chart design

I replace the line chart with stacked bar chart that make more sense for data because unique views is a part of the total views.

Enhanced UI

I redesign the whole UI in a modern way and built them with chart.js, NextUI and Tailwind CSS.

Easy to setup and access

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

Going forward

Thank you for sticking with me on this ongoing journey of developing a tool to fix GitHub's repo traffic insights! 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!

Star ⭐ on GitHub

Top comments (0)