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
starcharts
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:
LinkHeader to get total page countmaxSamplePages(default 15 pages, ~1500 stars), fetches all datamaxSamplePages, automatically switches to sampling modeUsage
Then browse http://localhost:3000/me/myrepo .
Configuration
Configure via environment variables:
REDIS_URLredis://localhost:6379GITHUB_TOKENSGITHUB_PAGE_SIZE100GITHUB_MAX_SAMPLE_PAGES15GITHUB_MAX_RATE_LIMIT_USAGE80LISTEN127.0.0.1:3000Example