MCPcopy Index your code
hub / github.com/caarlos0/starcharts

github.com/caarlos0/starcharts @v1.11.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release v1.11.0 ↗ · + Follow
154 symbols 512 edges 37 files 32 documented · 21%
What it actually does AI analysis from the code graph — generated when you open this
loading…
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:

  1. Auto Detection: First requests the first page of GitHub API data and parses the Link Header to get total page count
  2. Mode Switching:
  3. When total pages ≤ maxSamplePages (default 15 pages, ~1500 stars), fetches all data
  4. When total pages > maxSamplePages, automatically switches to sampling mode
  5. Uniform Sampling: Evenly selects sample points across all pages to ensure coverage of the complete star growth timeline
  6. Data Point Extraction: Extracts the timestamp and corresponding star count from the first Stargazer of each sampled page
  7. 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)
GITHUB_PAGE_SIZE 100 Number of stars per page
GITHUB_MAX_SAMPLE_PAGES 15 Max sample pages (triggers sampling mode when exceeded)
GITHUB_MAX_RATE_LIMIT_USAGE 80 API Rate Limit usage threshold percentage
LISTEN 127.0.0.1:3000 Server listen address

Example

starcharts stargazers over time

Extension points exported contracts — how you extend this code

Core symbols most depended-on inside this repo

Shape

Method 64
Function 61
Struct 24
Interface 3
FuncType 1
TypeAlias 1

Languages

Go99%
TypeScript1%

Modules by API surface

internal/roundrobin/roudrobin.go14 symbols
internal/chart/box.go13 symbols
internal/chart/svg/path.go11 symbols
internal/chart/math.go11 symbols
internal/github/stars.go10 symbols
internal/roundrobin/roundrobin_test.go8 symbols
internal/github/github.go8 symbols
internal/chart/svg/tag_builder.go8 symbols
internal/cache/cache.go7 symbols
internal/chart/helpers.go6 symbols
internal/chart/series.go5 symbols
controller/helpers.go5 symbols

For agents

$ claude mcp add starcharts \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page