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.
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.
After reflecting on these experiences, I listed out what my ideal tool would look like:
- Data access extending beyond 14 days
- Intuitive chart design
- Enhanced user interface
- 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:
Here's the approach I took to fulfill all the 4 requirements.
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.
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.
I redesign the whole UI in a modern way and built them with chart.js, NextUI and Tailwind CSS.
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.
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!