mirror of
https://github.com/ShayManor/github-readme-stats.git
synced 2026-12-02 11:53:48 +05:30
feat(readme): replace hero widget image with composite widget example
This commit is contained in:
@@ -12,28 +12,19 @@ and earns you tags like `Backend`, `ML`, or `Founder #42`.
|
|||||||

|

|
||||||
```
|
```
|
||||||
|
|
||||||

|
<img src="./assets/examples/composite-midnight.svg" width="420" alt="composite widget, midnight theme" />
|
||||||
|
|
||||||
<details>
|
<details>
|
||||||
<summary>Table of contents (click to show)</summary>
|
<summary>Table of contents (click to expand)</summary>
|
||||||
|
|
||||||
- [Quick start](#quick-start)
|
- [Quick start](#quick-start)
|
||||||
- [The composite widget](#the-composite-widget)
|
|
||||||
- [Individual widgets](#individual-widgets)
|
|
||||||
- [Grade](#grade)
|
|
||||||
- [Impact timeline](#impact-timeline)
|
|
||||||
- [Streaks](#streaks)
|
|
||||||
- [Top collaborators](#top-collaborators)
|
|
||||||
- [Recent focus](#recent-focus)
|
|
||||||
- [Languages](#languages)
|
|
||||||
- [Achievements](#achievements)
|
|
||||||
- [Themes](#themes)
|
- [Themes](#themes)
|
||||||
- [Customization via query parameters](#customization-via-query-parameters)
|
- [Individual widgets](#individual-widgets)
|
||||||
|
- [Query parameter reference](#query-parameter-reference)
|
||||||
|
- [Auto-awarded tags](#auto-awarded-tags)
|
||||||
- [Refreshing your data](#refreshing-your-data)
|
- [Refreshing your data](#refreshing-your-data)
|
||||||
- [Status states](#status-states)
|
|
||||||
- [Self-hosting](#self-hosting)
|
|
||||||
- [Running tests](#running-tests)
|
|
||||||
- [FAQ](#faq)
|
- [FAQ](#faq)
|
||||||
|
- [Gallery](#gallery)
|
||||||
|
|
||||||
</details>
|
</details>
|
||||||
|
|
||||||
@@ -41,174 +32,55 @@ and earns you tags like `Backend`, `ML`, or `Founder #42`.
|
|||||||
|
|
||||||
## Quick start
|
## Quick start
|
||||||
|
|
||||||
1. Open <https://gh-stats.com/> in a browser.
|
1. Open <https://gh-stats.com/>.
|
||||||
2. **Sign in with GitHub** — this enrolls your username and makes you the
|
2. Sign in with GitHub. Signing in is how you prove ownership of the
|
||||||
owner of the widget. The editor (Workshop) is only accessible to the
|
username, and it unlocks the editor.
|
||||||
signed-in owner.
|
3. Pick a theme, reorder widgets, add any custom tags or achievements.
|
||||||
3. Pick a theme, reorder widgets, add custom tags and achievements.
|
4. Click **Generate**.
|
||||||
4. Click **Generate** — the SVG is built on the server and cached.
|
5. Paste this one line into your profile README:
|
||||||
5. Copy the one-liner into your profile README:
|
|
||||||
|
|
||||||
```md
|
```md
|
||||||

|

|
||||||
```
|
```
|
||||||
|
|
||||||
That's it. A 15-minute refresh cron picks up new GitHub activity, so the
|
The image URL is stable. Once it's in your README you can change
|
||||||
image stays current on its own.
|
themes, tags, or widget order in the editor at any time without
|
||||||
|
touching the markdown.
|
||||||
|
|
||||||
> [!NOTE]
|
> [!NOTE]
|
||||||
> The image URL is stable. Once it's in your README, you can change
|
> Only public GitHub activity is counted. Private repos, private
|
||||||
> themes, tags, or widget order in the Workshop without ever touching
|
> commit counts, and contributions to org-restricted repos are never
|
||||||
> the markdown again.
|
> visible to the fetcher.
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## The composite widget
|
|
||||||
|
|
||||||
The default URL returns a single composed card with every enabled widget
|
|
||||||
stacked in your chosen order.
|
|
||||||
|
|
||||||
Endpoint: `https://gh-stats.com/<username>`
|
|
||||||
|
|
||||||
```md
|
|
||||||

|
|
||||||
```
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
> [!WARNING]
|
|
||||||
> Only public GitHub activity is counted. Private commits, private
|
|
||||||
> repos, and organization-restricted contributions are not visible to
|
|
||||||
> the fetcher. This applies even on self-hosted deployments — the PAT
|
|
||||||
> only sees what GitHub's public GraphQL/REST endpoints expose.
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## Individual widgets
|
|
||||||
|
|
||||||
Don't want the full stack? Every widget is independently addressable at
|
|
||||||
`https://gh-stats.com/<username>/<widget>.svg`:
|
|
||||||
|
|
||||||
```md
|
|
||||||

|
|
||||||

|
|
||||||

|
|
||||||

|
|
||||||

|
|
||||||

|
|
||||||

|
|
||||||
```
|
|
||||||
|
|
||||||
Put two side-by-side with an HTML table (GitHub strips inline CSS, so a
|
|
||||||
table is the only reliable way):
|
|
||||||
|
|
||||||
```html
|
|
||||||
<table><tr>
|
|
||||||
<td><img src="https://gh-stats.com/YOUR_USERNAME/grade.svg"/></td>
|
|
||||||
<td><img src="https://gh-stats.com/YOUR_USERNAME/languages.svg"/></td>
|
|
||||||
</tr></table>
|
|
||||||
```
|
|
||||||
|
|
||||||
### Grade
|
|
||||||
|
|
||||||
Overall score (0–100), letter grade (S / A / B / C / D / F), and your
|
|
||||||
top role tags. The grade is a weighted blend of commit volume, review
|
|
||||||
activity, recent authorship, and language breadth — see
|
|
||||||
`generator/src/scoring.py` for the exact formula.
|
|
||||||
|
|
||||||
```md
|
|
||||||

|
|
||||||
```
|
|
||||||
|
|
||||||
### Impact timeline
|
|
||||||
|
|
||||||
A smooth contribution curve over the last 6 months, drawn against a
|
|
||||||
faint grid. Nice on its own, or sitting above a languages card.
|
|
||||||
|
|
||||||
```md
|
|
||||||

|
|
||||||
```
|
|
||||||
|
|
||||||
### Streaks
|
|
||||||
|
|
||||||
Current and longest contribution streak, with a small spark chart.
|
|
||||||
|
|
||||||
```md
|
|
||||||

|
|
||||||
```
|
|
||||||
|
|
||||||
### Top collaborators
|
|
||||||
|
|
||||||
Avatars, shared-repo count, and commit bars for the people you work
|
|
||||||
with most. We filter out huge OSS projects (configurable via
|
|
||||||
`COLLABORATOR_MAX_REPO_SIZE`) so your drive-by PR to `react` doesn't
|
|
||||||
put the React team on your card.
|
|
||||||
|
|
||||||
```md
|
|
||||||

|
|
||||||
```
|
|
||||||
|
|
||||||
### Recent focus
|
|
||||||
|
|
||||||
What you've actually been working on lately, grouped by topic/language
|
|
||||||
cluster.
|
|
||||||
|
|
||||||
```md
|
|
||||||

|
|
||||||
```
|
|
||||||
|
|
||||||
### Languages
|
|
||||||
|
|
||||||
Your language mix, weighted by bytes in **repos you authored** (forks
|
|
||||||
where you haven't contributed meaningfully are ignored). Hide noise
|
|
||||||
like `HTML` or `Makefile` with the `hide` parameter.
|
|
||||||
|
|
||||||
```md
|
|
||||||

|
|
||||||
```
|
|
||||||
|
|
||||||
### Achievements
|
|
||||||
|
|
||||||
Up to 10 hand-entered lines — hackathons, talks, awards, certifications.
|
|
||||||
Each line has an icon (`trophy`, `medal`, `star`, `hackathon`), a
|
|
||||||
title, a subtitle, and an optional date.
|
|
||||||
|
|
||||||
```md
|
|
||||||

|
|
||||||
```
|
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## Themes
|
## Themes
|
||||||
|
|
||||||
Pass `?theme=<name>` or pick one in the Workshop. Five built-ins:
|
Pass `?theme=<name>` on the URL, or pick one in the editor.
|
||||||
|
|
||||||
| Theme | Tone |
|
| Theme | Preview |
|
||||||
|---|---|
|
|---|---|
|
||||||
| `midnight` *(default)* | dark, soft blue accents |
|
| `midnight` (default) | <img src="./assets/examples/composite-midnight.svg" width="280" /> |
|
||||||
| `onyx` | deep black, neon violet |
|
| `onyx` | <img src="./assets/examples/composite-onyx.svg" width="280" /> |
|
||||||
| `nord` | muted pastel on slate |
|
| `nord` | <img src="./assets/examples/composite-nord.svg" width="280" /> |
|
||||||
| `clean` | white, understated |
|
| `clean` | <img src="./assets/examples/composite-clean.svg" width="280" /> |
|
||||||
| `paper` | warm off-white |
|
| `paper` | <img src="./assets/examples/composite-paper.svg" width="280" /> |
|
||||||
|
|
||||||
```md
|
```md
|
||||||

|

|
||||||

|
|
||||||

|
|
||||||

|
|
||||||
```
|
```
|
||||||
|
|
||||||
### Dark / light auto-switching
|
### Auto-switching for dark and light mode
|
||||||
|
|
||||||
Use GitHub's built-in theme context suffixes to serve a different image
|
Add GitHub's theme suffix to serve a different image to dark vs. light
|
||||||
to viewers on dark vs. light GitHub:
|
viewers:
|
||||||
|
|
||||||
```md
|
```md
|
||||||

|

|
||||||

|

|
||||||
```
|
```
|
||||||
|
|
||||||
Or with `<picture>` for precise `prefers-color-scheme` control:
|
Or use `<picture>` for precise `prefers-color-scheme` control:
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<picture>
|
<picture>
|
||||||
@@ -222,215 +94,272 @@ Or with `<picture>` for precise `prefers-color-scheme` control:
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## Customization via query parameters
|
## Individual widgets
|
||||||
|
|
||||||
Every widget URL accepts query parameters. They let you override the
|
Every widget is independently addressable at
|
||||||
owner's saved settings on a per-embed basis **without re-enrolling or
|
`https://gh-stats.com/<username>/<widget>.svg`. Embed one, two, or all
|
||||||
signing in** — useful when someone else wants to embed your widget
|
of them.
|
||||||
with different options. Nothing is persisted; the owner's widget is
|
|
||||||
unaffected.
|
### Grade
|
||||||
|
|
||||||
|
Overall score (0 to 100), letter grade, and your top role tags.
|
||||||
|
|
||||||
|
<img src="./assets/examples/grade.svg" width="380" alt="grade widget" />
|
||||||
|
|
||||||
|
```md
|
||||||
|

|
||||||
|
```
|
||||||
|
|
||||||
|
### Impact
|
||||||
|
|
||||||
|
Your contribution volume over the last 6 months, drawn as a smooth area
|
||||||
|
chart.
|
||||||
|
|
||||||
|
<img src="./assets/examples/impact.svg" width="380" alt="impact widget" />
|
||||||
|
|
||||||
|
```md
|
||||||
|

|
||||||
|
```
|
||||||
|
|
||||||
|
### Streaks
|
||||||
|
|
||||||
|
Current and longest contribution streaks.
|
||||||
|
|
||||||
|
<img src="./assets/examples/streaks.svg" width="380" alt="streaks widget" />
|
||||||
|
|
||||||
|
```md
|
||||||
|

|
||||||
|
```
|
||||||
|
|
||||||
|
### Top collaborators
|
||||||
|
|
||||||
|
The people you actually work with, filtered down to repos of a
|
||||||
|
reasonable size so a drive-by PR to `react` does not put the React team
|
||||||
|
on your card.
|
||||||
|
|
||||||
|
<img src="./assets/examples/collaborators.svg" width="380" alt="collaborators widget" />
|
||||||
|
|
||||||
|
```md
|
||||||
|

|
||||||
|
```
|
||||||
|
|
||||||
|
### Recent focus
|
||||||
|
|
||||||
|
What you have actually been working on lately, grouped by topic.
|
||||||
|
|
||||||
|
<img src="./assets/examples/focus.svg" width="380" alt="focus widget" />
|
||||||
|
|
||||||
|
```md
|
||||||
|

|
||||||
|
```
|
||||||
|
|
||||||
|
### Languages
|
||||||
|
|
||||||
|
Your language mix, weighted by bytes in repos you authored. Forks with
|
||||||
|
no meaningful contribution are ignored.
|
||||||
|
|
||||||
|
<img src="./assets/examples/languages.svg" width="380" alt="languages widget" />
|
||||||
|
|
||||||
|
```md
|
||||||
|

|
||||||
|
```
|
||||||
|
|
||||||
|
### Achievements
|
||||||
|
|
||||||
|
Hand-entered lines for hackathons, talks, awards, and certifications.
|
||||||
|
|
||||||
|
<img src="./assets/examples/achievements.svg" width="380" alt="achievements widget" />
|
||||||
|
|
||||||
|
```md
|
||||||
|

|
||||||
|
```
|
||||||
|
|
||||||
|
### Side by side
|
||||||
|
|
||||||
|
GitHub strips inline CSS, so an HTML table is the simplest way to put
|
||||||
|
two widgets next to each other.
|
||||||
|
|
||||||
|
```html
|
||||||
|
<table><tr>
|
||||||
|
<td><img src="https://gh-stats.com/YOUR_USERNAME/grade.svg" /></td>
|
||||||
|
<td><img src="https://gh-stats.com/YOUR_USERNAME/languages.svg" /></td>
|
||||||
|
</tr></table>
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Query parameter reference
|
||||||
|
|
||||||
|
Every URL accepts query parameters. They override the owner's saved
|
||||||
|
settings on a per-embed basis, so viewers can tweak the look without
|
||||||
|
changing anything the owner has stored.
|
||||||
|
|
||||||
|
Values with special characters must be URL-encoded: `#a78bfa` becomes
|
||||||
|
`%23a78bfa`, a space becomes `%20`.
|
||||||
|
|
||||||
### Common parameters
|
### Common parameters
|
||||||
|
|
||||||
| Parameter | Description | Type | Example |
|
| Parameter | What it does | Example |
|
||||||
|---|---|---|---|
|
|---|---|---|
|
||||||
| `theme` | Built-in theme name. | enum | `?theme=onyx` |
|
| `theme` | Built-in theme name. | `?theme=onyx` |
|
||||||
| `widgets` | Which widgets to render (composite only). | csv | `?widgets=grade,languages` |
|
| `widgets` | Which widgets to show on the composite card. | `?widgets=grade,streaks,languages` |
|
||||||
| `order` | Render order (composite only). | csv | `?order=grade,streaks,impact` |
|
| `order` | Render order on the composite card. | `?order=grade,streaks,languages` |
|
||||||
| `hide` | Languages to exclude from the languages widget. | csv | `?hide=HTML,CSS,Makefile` |
|
| `hide` | Languages to exclude from the languages widget. | `?hide=HTML,CSS,Makefile` |
|
||||||
| `tags` | Extra custom role tags to merge into the grade widget. | csv | `?tags=ML,Systems` |
|
| `tags` | Extra custom role tags on the grade widget. | `?tags=ML,Systems` |
|
||||||
| `ach` | Achievements list as url-safe base64(json). | string | see below |
|
|
||||||
|
|
||||||
> [!NOTE]
|
|
||||||
> Values with special characters must be URL-encoded. `#a78bfa` becomes
|
|
||||||
> `%23a78bfa`; `Jupyter Notebook` becomes `Jupyter%20Notebook`.
|
|
||||||
|
|
||||||
### Per-widget parameters
|
### Per-widget parameters
|
||||||
|
|
||||||
Use dot notation: `<widget>.<key>=<value>`.
|
Use dot notation: `<widget>.<key>=<value>`.
|
||||||
|
|
||||||
| Parameter | Description | Type | Default |
|
| Parameter | What it does | Type | Default |
|
||||||
|---|---|---|---|
|
|---|---|---|---|
|
||||||
| `grade.max_tags` | Max role tags shown on the grade card (1–20). | int | all tags |
|
| `grade.max_tags` | Max role tags shown (1 to 20). | int | all tags |
|
||||||
| `impact.line_color` | Accent color for the contribution curve. | hex color | theme accent |
|
| `impact.line_color` | Accent color for the area curve. | hex color | theme accent |
|
||||||
| `streaks.color` | Accent color for the streak bars. | hex color | theme green |
|
| `streaks.color` | Accent color for the current-streak text. | hex color | theme accent |
|
||||||
| `collaborators.max_count` | Max collaborators shown (1–10). | int | `5` |
|
| `collaborators.max_count` | Max collaborators shown (1 to 10). | int | 5 |
|
||||||
| `collaborators.bar_color` | Accent color for the commit bars. | hex color | theme accent |
|
| `collaborators.bar_color` | Accent color for the commit bars. | hex color | theme accent |
|
||||||
| `focus.max_categories` | Max focus clusters shown (1–10). | int | `6` |
|
| `focus.max_categories` | Max focus clusters shown (1 to 10). | int | 6 |
|
||||||
| `languages.max_languages` | Max languages shown (1–10). | int | `5` |
|
| `languages.max_languages` | Max languages shown (1 to 10). | int | 5 |
|
||||||
| `achievements.max_items` | Max achievement rows shown (1–10). | int | `5` |
|
| `achievements.max_items` | Max achievement rows shown (1 to 10). | int | 5 |
|
||||||
|
|
||||||
Example combining several overrides:
|
---
|
||||||
|
|
||||||
```md
|
## Auto-awarded tags
|
||||||

|
|
||||||
```
|
|
||||||
|
|
||||||
### Auto-awarded tags
|
Some tags on the grade card are earned from real activity. No query
|
||||||
|
parameter will add them if you have not earned them:
|
||||||
|
|
||||||
Some tags on the grade card are earned from real activity — no query
|
- `Founder #N` is your enrollment number, fixed when you first sign in.
|
||||||
parameter will add them if you haven't earned them:
|
|
||||||
|
|
||||||
- `Founder #N` — one of the first N users to enroll. Your number is
|
|
||||||
fixed at enrollment and never changes.
|
|
||||||
- Role tags like `Backend`, `Frontend`, `ML`, `Mobile`, `DevOps`,
|
- Role tags like `Backend`, `Frontend`, `ML`, `Mobile`, `DevOps`,
|
||||||
`Cloud`, `Systems`, `Database`, `Security` — derived from your
|
`Cloud`, `Systems`, `Database`, `Security` are derived from your
|
||||||
language mix and repo topics. The mapping lives in
|
language mix and repo topics.
|
||||||
`generator/src/config.py` (`TAG_LANGUAGE_MAP`, `TAG_TOPIC_MAP`).
|
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## Refreshing your data
|
## Refreshing your data
|
||||||
|
|
||||||
The refresh cron re-pulls GitHub data every **15 minutes**, so new
|
The refresh cron re-pulls GitHub data every 15 minutes, so new commits
|
||||||
commits typically appear in your widget within that window. GitHub's
|
usually appear in your widget within that window. GitHub's image CDN
|
||||||
image CDN may add another minute or two of staleness on top.
|
may add another minute or two on top.
|
||||||
|
|
||||||
If you need an immediate update (e.g. right after merging something
|
If you need an immediate update (for example right after merging
|
||||||
big), click **Refresh now** in the Workshop. This is a **one-shot per
|
something big), click **Refresh now** in the editor. It is a one-shot
|
||||||
account** — use it when it matters.
|
per account, so save it for when it matters.
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## Status states
|
|
||||||
|
|
||||||
The SVG endpoint advertises its state via the `X-Widget-Status`
|
|
||||||
response header, and the edge cache uses it to decide whether to cache:
|
|
||||||
|
|
||||||
| Status | Meaning | What the viewer sees |
|
|
||||||
|---|---|---|
|
|
||||||
| `ready` | Built and cached | the real widget |
|
|
||||||
| `building` | Enrolled, first render in progress | a placeholder card |
|
|
||||||
| `rate_limited` | Daily enrollment cap hit | a placeholder card |
|
|
||||||
| `not_found` | GitHub username doesn't exist | a 404-style card |
|
|
||||||
|
|
||||||
GitHub caches images aggressively; a just-enrolled widget may show the
|
|
||||||
placeholder for a minute or two before the real image propagates. This
|
|
||||||
is normal — no action needed on your side.
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## Self-hosting
|
|
||||||
|
|
||||||
If you want your own instance, it runs as three Python services plus a
|
|
||||||
Vite+React SPA served by the generator. You'll need a GitHub Personal
|
|
||||||
Access Token (classic, `read:user` + `repo:public_repo` is enough) and,
|
|
||||||
for OAuth-based enrollment, a GitHub OAuth App.
|
|
||||||
|
|
||||||
```bash
|
|
||||||
# 1) fetcher — owns the PAT, talks to GitHub (port 5001)
|
|
||||||
cd fetcher && pip install -r requirements.txt
|
|
||||||
FETCHER_INTERNAL_TOKEN=dev GITHUB_PAT=<your-pat> python -m src.api &
|
|
||||||
|
|
||||||
# 2) generator — API + worker + refresh cron (port 5002)
|
|
||||||
cd ../generator && pip install -r requirements.txt
|
|
||||||
export FETCHER_URL=http://localhost:5001
|
|
||||||
export FETCHER_INTERNAL_TOKEN=dev
|
|
||||||
export GH_OAUTH_CLIENT_ID=<client-id>
|
|
||||||
export GH_OAUTH_CLIENT_SECRET=<client-secret>
|
|
||||||
python -m src.api &
|
|
||||||
python -m src.worker &
|
|
||||||
python -m src.cron &
|
|
||||||
|
|
||||||
# 3) edge — cache-first SVG proxy (put this behind your domain) (port 5003)
|
|
||||||
cd ../edge && pip install -r requirements.txt
|
|
||||||
GENERATOR_URL=http://localhost:5002 python -m src.api &
|
|
||||||
|
|
||||||
# 4) frontend (dev only — production builds are baked into the generator image)
|
|
||||||
cd ../generator/frontend && npm install && npm run dev
|
|
||||||
```
|
|
||||||
|
|
||||||
Each service is independent: a Dockerfile, `requirements.txt`, and
|
|
||||||
`pytest.ini` sit in its directory. The generator image bundles the
|
|
||||||
pre-built frontend, so a production deploy is `edge → generator →
|
|
||||||
fetcher` with one domain pointed at edge.
|
|
||||||
|
|
||||||
### Capacity knobs
|
|
||||||
|
|
||||||
Sensible defaults out of the box; all overridable via env:
|
|
||||||
|
|
||||||
| Env | Default | What it bounds |
|
|
||||||
|---|---|---|
|
|
||||||
| `GENERATE_CONCURRENCY` | `2` | Simultaneous SVG renders |
|
|
||||||
| `PREFETCH_MAX_WORKERS` | `2` | Background prefetch threads |
|
|
||||||
| `PENDING_JOB_QUEUE_CAP` | `200` | Build-queue depth before new enrolls 429 |
|
|
||||||
| `ENROLLMENT_DAILY_CAP` | `50` | New users per day |
|
|
||||||
| `RATE_LIMIT_READ_MAX` | `3000` per 60s | Per-IP README embeds |
|
|
||||||
| `RATE_LIMIT_MUTATE_MAX` | `120` per 60s | Per-IP settings edits / generates |
|
|
||||||
| `RATE_LIMIT_ENROLL_MAX` | `60` per 300s | Per-IP new enrollments |
|
|
||||||
| `EDGE_RATE_LIMIT_MAX` | `3000` per 60s | Per-IP at the edge |
|
|
||||||
|
|
||||||
### Required env for OAuth
|
|
||||||
|
|
||||||
| Env | Description |
|
|
||||||
|---|---|
|
|
||||||
| `GH_OAUTH_CLIENT_ID` | GitHub OAuth App client ID |
|
|
||||||
| `GH_OAUTH_CLIENT_SECRET` | GitHub OAuth App client secret |
|
|
||||||
| `GH_OAUTH_REDIRECT_URI` | Callback URL, e.g. `https://gh-stats.com/api/auth/github/callback` |
|
|
||||||
| `GENERATOR_SECRET_KEY` | Flask session signing key (`python -c 'import secrets;print(secrets.token_hex(32))'`) |
|
|
||||||
| `ALLOWED_ORIGINS` | Comma-separated origin allow-list for mutate routes |
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## Running tests
|
|
||||||
|
|
||||||
Each service is self-contained:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
(cd fetcher && pytest) && (cd generator && pytest) && (cd edge && pytest)
|
|
||||||
```
|
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## FAQ
|
## FAQ
|
||||||
|
|
||||||
**Can I use a private GitHub account?**
|
**Can I use a private GitHub account?**
|
||||||
No. The fetcher only reads public activity. Private repos, private
|
No. The service only reads public activity. Private repos, private
|
||||||
commit counts, and org-restricted contributions are never included —
|
commit counts, and contributions to org-restricted repos are not
|
||||||
even on a self-hosted instance, since the public GitHub API doesn't
|
visible to GitHub's public API, so they are never part of the widget.
|
||||||
expose them.
|
|
||||||
|
|
||||||
**How fresh is the data?**
|
**How fresh is the data?**
|
||||||
Every 15 minutes via the refresh cron. You can also click **Refresh
|
Every 15 minutes, automatically. You can also click **Refresh now**
|
||||||
now** in the Workshop once per account for an immediate update.
|
once per account for an immediate update.
|
||||||
|
|
||||||
**How do I edit my widget?**
|
**How do I edit my widget?**
|
||||||
Sign in with GitHub at <https://gh-stats.com/>. Only the GitHub account
|
Sign in with GitHub at <https://gh-stats.com/>. Only the account whose
|
||||||
that owns the username can edit that widget's settings. There is no
|
login matches the username can edit that widget's settings.
|
||||||
other edit path — the Workshop's mutate routes require both a valid
|
|
||||||
session cookie and a matching login.
|
|
||||||
|
|
||||||
**Someone else's username is already showing on the site — can I claim it?**
|
|
||||||
Yes. Enrollment happens implicitly on first GitHub sign-in: the first
|
|
||||||
time the owner of a username signs in, their settings row is created
|
|
||||||
(or taken over, if it was auto-enrolled by a previous viewer). No
|
|
||||||
manual claim step is needed.
|
|
||||||
|
|
||||||
**Can I change the widget without re-embedding?**
|
**Can I change the widget without re-embedding?**
|
||||||
Yes. The image URL is stable. Edit settings in the Workshop, click
|
Yes. The image URL is stable. Edit in the editor, click **Generate**,
|
||||||
**Generate**, and the next fetch serves the new version. GitHub's
|
and the next fetch serves the new version. GitHub's image cache may
|
||||||
image cache may delay propagation by a few minutes.
|
delay propagation by a few minutes.
|
||||||
|
|
||||||
**Can I embed someone else's widget with my own theme / filters?**
|
**Can I embed someone else's widget with my own theme or filters?**
|
||||||
Yes — use [query parameters](#customization-via-query-parameters). The
|
Yes, use the [query parameters](#query-parameter-reference). The
|
||||||
owner's stored settings are unaffected; the override render is
|
owner's saved settings are not affected.
|
||||||
computed on demand and cached briefly.
|
|
||||||
|
|
||||||
**I'm getting a placeholder card. What's wrong?**
|
**I am getting a placeholder card. What is wrong?**
|
||||||
Check the `X-Widget-Status` header on the response (`curl -I
|
`building` means the first render is still in progress, give it a
|
||||||
https://gh-stats.com/<username>`). `building` means first render is in
|
minute. `not_found` means GitHub does not know that username.
|
||||||
progress — wait a minute. `rate_limited` means the daily enrollment
|
|
||||||
cap was hit — try tomorrow. `not_found` means GitHub doesn't know
|
|
||||||
that username.
|
|
||||||
|
|
||||||
**Why does my `Languages` card look wrong?**
|
**Why does my languages card look wrong?**
|
||||||
The languages widget only counts repos you authored, weighted by
|
It counts bytes in repos you authored. Forks with little commit
|
||||||
bytes. Forks where you haven't made enough commits are excluded (see
|
activity are dropped. Add `?hide=HTML,CSS,Makefile` if generated files
|
||||||
`FORK_MIN_COMMITS`). Add `?hide=HTML,CSS,Makefile` if stock-generated
|
dominate the breakdown.
|
||||||
files are dominating the breakdown.
|
|
||||||
|
|
||||||
**Does the public instance work for high-traffic profiles?**
|
**Can I reorder widgets?**
|
||||||
It's best-effort. The public instance at `gh-stats.com` runs on a
|
Yes, either in the editor (drag and drop) or by passing
|
||||||
single mini PC, and the capacity knobs above are tuned for that. If
|
`?widgets=...&order=...` on the URL.
|
||||||
your profile gets heavy traffic, self-host — the edge cache in front
|
|
||||||
of the generator scales the read path almost for free.
|
---
|
||||||
|
|
||||||
|
## Gallery
|
||||||
|
|
||||||
|
### Composite themes
|
||||||
|
|
||||||
|
<table>
|
||||||
|
<tr>
|
||||||
|
<td align="center"><b>midnight</b><br/><img src="./assets/examples/composite-midnight.svg" width="260" /></td>
|
||||||
|
<td align="center"><b>onyx</b><br/><img src="./assets/examples/composite-onyx.svg" width="260" /></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td align="center"><b>nord</b><br/><img src="./assets/examples/composite-nord.svg" width="260" /></td>
|
||||||
|
<td align="center"><b>clean</b><br/><img src="./assets/examples/composite-clean.svg" width="260" /></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td align="center"><b>paper</b><br/><img src="./assets/examples/composite-paper.svg" width="260" /></td>
|
||||||
|
<td align="center"><b>custom (onyx, 3 widgets)</b><br/><img src="./assets/examples/composite-custom.svg" width="260" /></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
### Single-widget examples
|
||||||
|
|
||||||
|
<table>
|
||||||
|
<tr>
|
||||||
|
<td align="center"><b>Grade</b><br/><img src="./assets/examples/grade.svg" width="320" /></td>
|
||||||
|
<td align="center"><b>Grade (max_tags=3)</b><br/><img src="./assets/examples/grade-compact.svg" width="320" /></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td align="center"><b>Impact</b><br/><img src="./assets/examples/impact.svg" width="320" /></td>
|
||||||
|
<td align="center"><b>Impact (purple line)</b><br/><img src="./assets/examples/impact-purple.svg" width="320" /></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td align="center"><b>Streaks</b><br/><img src="./assets/examples/streaks.svg" width="320" /></td>
|
||||||
|
<td align="center"><b>Streaks (green)</b><br/><img src="./assets/examples/streaks-green.svg" width="320" /></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td align="center"><b>Languages</b><br/><img src="./assets/examples/languages.svg" width="320" /></td>
|
||||||
|
<td align="center"><b>Languages (hide Shell, Dockerfile)</b><br/><img src="./assets/examples/languages-hide.svg" width="320" /></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td align="center"><b>Collaborators</b><br/><img src="./assets/examples/collaborators.svg" width="320" /></td>
|
||||||
|
<td align="center"><b>Focus</b><br/><img src="./assets/examples/focus.svg" width="320" /></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td align="center"><b>Achievements</b><br/><img src="./assets/examples/achievements.svg" width="320" /></td>
|
||||||
|
<td></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
### Mix and match
|
||||||
|
|
||||||
|
Embed two widgets side by side with an HTML table:
|
||||||
|
|
||||||
|
```html
|
||||||
|
<table><tr>
|
||||||
|
<td><img src="https://gh-stats.com/YOUR_USERNAME/grade.svg" /></td>
|
||||||
|
<td><img src="https://gh-stats.com/YOUR_USERNAME/languages.svg" /></td>
|
||||||
|
</tr></table>
|
||||||
|
```
|
||||||
|
|
||||||
|
Stack a custom composite with only three widgets:
|
||||||
|
|
||||||
|
```md
|
||||||
|

|
||||||
|
```
|
||||||
|
|
||||||
|
Recolor the impact line:
|
||||||
|
|
||||||
|
```md
|
||||||
|

|
||||||
|
```
|
||||||
|
|
||||||
|
Hide noisy languages:
|
||||||
|
|
||||||
|
```md
|
||||||
|

|
||||||
|
```
|
||||||
|
|||||||
Reference in New Issue
Block a user