caarlos0
starcharts
Go

Plot your repository stars over time.

Last updated Jul 1, 2026
1.4k
Stars
143
Forks
2
Issues
+1
Stars/day
Attention Score
77
Language breakdown
Go 77.1%
Go Template 10.0%
CSS 8.4%
JavaScript 4.5%
Files click to expand
README

starcharts

Build Status Coverage Status

Plot your repo stars over time!

Features

Smart Sampling Mode (Large Repository Optimization)

For large repositories with massive amounts of stars, this project uses Smart Sampling Mode to efficiently fetch star history data and render trend charts.

How it works:

  • Auto Detection: First requests the first page of GitHub API data and parses the Link Header to get total page count
  • Mode Switching:
- When total pages ≤ maxSamplePages (default 15 pages, ~1500 stars), fetches all data - When total pages > maxSamplePages, automatically switches to sampling mode
  • Uniform Sampling: Evenly selects sample points across all pages to ensure coverage of the complete star growth timeline
  • Data Point Extraction: Extracts the timestamp and corresponding star count from the first Stargazer of each sampled page
  • Trend Completion: Adds current time and total star count as the final data point to ensure the chart extends to the latest state

Usage

go run main.go

Then browse http://localhost:3000/me/myrepo .

Configuration

Configure via environment variables:

| Variable | Default | Description | |----------|---------|-------------| | REDIS_URL | redis://localhost:6379 | Redis cache URL | | GITHUB_TOKENS | - | GitHub API Token (supports multiple, comma-separated) | | GITHUBPAGESIZE | 100 | Number of stars per page | | GITHUBMAXSAMPLE_PAGES | 15 | Max sample pages (triggers sampling mode when exceeded) | | GITHUBMAXRATELIMITUSAGE | 80 | API Rate Limit usage threshold percentage | | LISTEN | 127.0.0.1:3000 | Server listen address |

Example

starcharts stargazers over time

🔗 More in this category

© 2026 GitRepoTrend · caarlos0/starcharts · Updated daily from GitHub