Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
54c23d8
feat: publish the documentation and the card wizard from one Astro site
marcalexiei Aug 16, 2026
a91bef3
fix failing deployment due to missing md files
martin-mfg Aug 18, 2026
2c8419c
docs(advanced_documentation): fix incorrect github action link
marcalexiei Aug 18, 2026
05538de
docs: split the Advanced Customization page into focused pages
marcalexiei Aug 19, 2026
ae21ab5
chore(frontend): use caret ranges for astro and starlight
marcalexiei Aug 19, 2026
743c84c
chore(frontend): replace deprecated rollupOptions with rolldownOptions
marcalexiei Aug 19, 2026
1e20e81
chore(frontend): drop redundant DOM.Iterable lib
marcalexiei Aug 19, 2026
1f6755c
docs(contributing): link the published docs instead of the markdown s…
marcalexiei Aug 19, 2026
38401f6
fix(frontend): make the delete modal backdrop dim the whole page
marcalexiei Aug 19, 2026
cfc85a5
fix(frontend): restore the favicon, touch icon and web manifest
marcalexiei Aug 19, 2026
bda98b3
docs(customization): scope the caching note to the public deployment
marcalexiei Aug 19, 2026
338eeed
docs(theming): stop showing GitHub-only theme switching as a live exa…
marcalexiei Aug 19, 2026
7bdf536
docs(aligning-cards): render the examples side by side
marcalexiei Aug 19, 2026
bc40152
chore: move the theme readme generator to the repo-level scripts folder
marcalexiei Aug 19, 2026
568e501
Merge remote-tracking branch 'origin/master' into docs-frontend-astro
martin-mfg Aug 20, 2026
be05cde
fix(frontend): remove `/advanced_documentation` redirect
marcalexiei Aug 20, 2026
fb099ab
rework documentation a bit
martin-mfg Aug 21, 2026
328880e
docs: make the card previews follow the site theme
marcalexiei Aug 21, 2026
83fbd47
replace theming notes
martin-mfg Aug 22, 2026
0cccbe7
docs: reference cards by relative `/api` urls
marcalexiei Aug 22, 2026
2a9b89b
fix(backend): send the site root to the docs instead of GitHub
marcalexiei Aug 22, 2026
4fd3277
fix docs urls
martin-mfg Aug 23, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 19 additions & 4 deletions .github/CONTRIBUTING.md
Comment thread
martin-mfg marked this conversation as resolved.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,22 @@ pnpm run build:packages
pnpm run dev:frontend
```

The easiest way to run and test the project is to deploy it to Vercel as described in the [deployment guide](../docs/deploy.md).
### Backend server

The wizard renders its previews in the browser, but the docs reference cards by
root-relative path (`/api?username=...`), so those images only load with the backend running:

```bash
pnpm run dev:backend # card endpoints on :9000, proxied by the frontend dev server
```

It needs a [Personal Access Token](https://github-stats-extended.vercel.app/frontend/docs/deploy/#first-step-get-your-personal-access-token-pat) in `apps/backend/.env` (the SQL database is optional):

```
PAT_1=your_token_here
```

You can also deploy to Vercel and test there, as described in the [deployment guide](https://github-stats-extended.vercel.app/frontend/docs/deploy/).

## Tests

Expand Down Expand Up @@ -46,13 +61,13 @@ Never edit the generated files by hand — change the `.graphql` file and regene

## Themes Contribution

We have stopped the addition of new themes to decrease maintenance efforts. If you are considering contributing your theme just because you are using it personally, then instead of adding it to our theme collection, you can use card [customization options](../docs/advanced_documentation.md#customization).
We have stopped the addition of new themes to decrease maintenance efforts. If you are considering contributing your theme just because you are using it personally, then instead of adding it to our theme collection, you can use card [customization options](https://github-stats-extended.vercel.app/frontend/docs/customization/common-options/).

## Translations Contribution

GitHub-Stats-Extended supports multiple languages. If we are missing your language, you can contribute it! You can check the currently supported languages [here](../docs/advanced_documentation.md#available-locales).
GitHub-Stats-Extended supports multiple languages. If we are missing your language, you can contribute it! You can check the currently supported languages [here](https://github-stats-extended.vercel.app/frontend/docs/customization/locales/).

To contribute your language you need to edit the [backend/src/translations.js](../backend/src/translations.js) file and add a new property to each object where the key is the language code in [ISO 639-1 standard](https://www.andiamo.co.uk/resources/iso-language-codes/) and the value is the translated string.
To contribute your language you need to edit the [packages/core/src/translations.ts](../packages/core/src/translations.ts) file and add a new property to each object where the key is the language code in [ISO 639-1 standard](https://www.andiamo.co.uk/resources/iso-language-codes/) and the value is the translated string.

## Any contributions you make will be under the MIT Software License

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/generate-theme-readme.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
uses: ./.github/actions/install-dependencies

- name: Generate readme
run: pnpm --filter ./packages/core/ run generate-theme-readme
run: pnpm run generate-theme-readme

- name: Create Pull Request if themes README has changed
uses: peter-evans/create-pull-request@5f6978faf089d4d20b00c7766989d076bb2fc7f1 # v8.1.1
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ apps/backend/vercel_token
apps/backend-copy

apps/frontend/.env
# Astro's generated types and content store
apps/frontend/.astro


.turbo
Expand Down
32 changes: 11 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,30 +5,26 @@
<a href="https://github-stats-extended.vercel.app/api?username=anuraghazra"><img src="https://github-stats-extended.vercel.app/api?username=anuraghazra"></a>
</div>

This project is the [extended, actively maintained successor](docs/fork.md) of [github-readme-stats](https://github.com/anuraghazra/github-readme-stats). It generates [various stats cards](#card-types), e.g. about your GitHub contributions, your top languages, etc. You can [customize](#advanced-customization) the cards via multiple parameters.
GitHub-Stats-Extended is the [extended, actively maintained successor](https://github-stats-extended.vercel.app/frontend/docs/fork/) of [github-readme-stats](https://github.com/anuraghazra/github-readme-stats). It generates [various stats cards](#card-types) about your GitHub contributions, your top languages and more. You can [customize](#documentation) the cards via multiple parameters.

## Table of Contents

- [Quick Start](#quick-start)
- [Migration from github-readme-stats](#migration-from-github-readme-stats)
- [Card Types](#card-types)
- [Advanced Customization](#advanced-customization)
- [Run It Yourself](#run-it-yourself)
- [Documentation](#documentation)
- [Acknowledgements](#acknowledgements)
- [Contributing](#contributing)

## Quick Start

- Copy and paste this into your markdown:
```markdown
[![Anurag's GitHub stats](https://github-stats-extended.vercel.app/api?username=anuraghazra)](https://github.com/stats-organization/github-stats-extended)
```
- Change the `?username=` value to your GitHub username.
- Done!
Copy and paste this into your markdown, then change the `?username=` value to your GitHub username:

---
```md
[![Anurag's GitHub stats](https://github-stats-extended.vercel.app/api?username=anuraghazra)](https://github.com/stats-organization/github-stats-extended)
```

As more comfortable alternative, use the [GitHub-Stats-Extended Wizard](https://github-stats-extended.vercel.app/frontend) to create your custom stats card. Copy the generated markdown code and paste it into your [GitHub profile README](https://docs.github.com/en/account-and-profile/how-tos/profile-customization/managing-your-profile-readme#adding-a-profile-readme). Done!
As a more comfortable alternative, use the [card wizard](https://github-stats-extended.vercel.app/frontend) to configure your card visually. Then copy the generated markdown into your [GitHub profile README](https://docs.github.com/en/account-and-profile/how-tos/profile-customization/managing-your-profile-readme#adding-a-profile-readme).

## Migration from github-readme-stats

Expand All @@ -39,7 +35,7 @@ To migrate from [github-readme-stats](https://github.com/anuraghazra/github-read
+ https://github-stats-extended.vercel.app/api?username=octocat&theme=radical
```

GitHub-Stats-Extended aims to be fully compatible with github-readme-stats. For more details see [Compatibility Notes](docs/fork.md#compatibility-notes).
GitHub-Stats-Extended aims to be fully compatible with github-readme-stats. For details see [Compatibility Notes](https://github-stats-extended.vercel.app/frontend/docs/fork/#compatibility-notes).

## Card Types

Expand Down Expand Up @@ -67,19 +63,13 @@ GitHub-Stats-Extended aims to be fully compatible with github-readme-stats. For

[![Anurag's GitHub stats](https://github-stats-extended.vercel.app/api/?username=anuraghazra&show_icons=true&theme=calm&rank_icon=github&include_all_commits=true&custom_title=Anurag's+Stats&disable_animations=true&number_format=long&show=prs_merged_percentage,prs_reviewed)](https://github-stats-extended.vercel.app/api/?username=anuraghazra&show_icons=true&theme=calm&rank_icon=github&include_all_commits=true&custom_title=Anurag's+Stats&disable_animations=true&number_format=long&show=prs_merged_percentage,prs_reviewed)

## Advanced Customization

The [GitHub-Stats-Extended Wizard](https://github-stats-extended.vercel.app/frontend) offers some essential customization options. For more advanced customization check out the [advanced documentation](docs/advanced_documentation.md).

## Run It Yourself

If you want to run GitHub-Stats-Extended on your own, there are two main deployment options: you can use [github-readme-stats-action](https://github.com/stats-organization/github-readme-stats-action) to generate cards in your own GitHub Actions workflow. Or you can self-host GitHub-Stats-Extended on Vercel.
## Documentation

See [Run It Yourself](docs/deploy.md) for detailed instructions.
The [card wizard](https://github-stats-extended.vercel.app/frontend) offers some essential customization options. For more advanced customization and other project info check out the [documentation](https://github-stats-extended.vercel.app/frontend/docs/cards/stats/).

## Acknowledgements

This project is based on [github-readme-stats](https://github.com/anuraghazra/github-readme-stats). On top of that project's functionality GitHub-Stats-Extended adds several new features and improvements. See [Fork Information](docs/fork.md) for a list of changes. The frontend added to GitHub-Stats-Extended is based on [GitHub Trends](https://github.com/avgupta456/github-trends). Big thanks to [@anuraghazra](https://github.com/anuraghazra), [@avgupta456](https://github.com/avgupta456), [@rickstaa](https://github.com/rickstaa), [@qwerty541](https://github.com/qwerty541) and everyone else who worked on these projects! ❤️
This project is based on [github-readme-stats](https://github.com/anuraghazra/github-readme-stats). The card wizard is based on [GitHub Trends](https://github.com/avgupta456/github-trends). Big thanks to [@anuraghazra](https://github.com/anuraghazra), [@avgupta456](https://github.com/avgupta456), [@rickstaa](https://github.com/rickstaa), [@qwerty541](https://github.com/qwerty541) and everyone else who worked on these projects! ❤️

## Contributing

Expand Down
2 changes: 0 additions & 2 deletions apps/backend/.vercelignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,5 @@ coverage
scripts
tests
.env
**/*.md
**/*.svg
.eslintrc.json
codecov.yml
12 changes: 11 additions & 1 deletion apps/backend/express.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,17 @@ import router from "./router.js";

const app = express();

app.use(router);
app.use((req, res) => {
/*
* Vercel resolves `/api/pin/` to the same function as `/api/pin`, but the router matches the path exactly.
* Drop the trailing slash so local requests behave like deployed ones.
*/
const [pathname, query] = req.url.split("?", 2);
if (pathname !== "/" && pathname?.endsWith("/")) {
req.url = pathname.slice(0, -1) + (query === undefined ? "" : `?${query}`);
}
return router(req, res);
});

const port = process.env.PORT || process.env.port || 9000;
app.listen(port, "0.0.0.0", () => {
Expand Down
1 change: 1 addition & 0 deletions apps/backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"private": true,
"main": "index.js",
"scripts": {
"dev": "node --env-file-if-exists=.env express.js",
"test": "vitest",
"test:update:snapshot": "vitest -u",
"test:e2e": "vitest --config vitest.config.e2e.ts",
Expand Down
2 changes: 1 addition & 1 deletion apps/backend/vercel.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"redirects": [
{
"source": "/",
"destination": "https://github.com/stats-organization/github-stats-extended"
Comment thread
martin-mfg marked this conversation as resolved.
"destination": "/frontend/docs/"
}
]
}
126 changes: 126 additions & 0 deletions apps/frontend/astro.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
import path from "node:path";

import react from "@astrojs/react";
import starlight from "@astrojs/starlight";
import tailwindcss from "@tailwindcss/vite";
import { defineConfig, passthroughImageService } from "astro/config";
import starlightLinksValidator from "starlight-links-validator";

const base = "/frontend";

// `pnpm dev:backend` serves the card endpoints; override to point at another instance.
const BACKEND_ORIGIN = process.env.BACKEND_ORIGIN ?? "http://localhost:9000";

/*
* One app: Starlight serves the docs under `/frontend/docs`, and the card
* wizard is a page of the same site at `/frontend`.
*/
export default defineConfig({
site: "https://github-stats-extended.vercel.app",
base,
outDir: "./build",
// One screenshot; not worth a native image dependency.
image: { service: passthroughImageService() },
// Astro prefixes `base` onto the source but not the destination, hence it spelled out here.
redirects: {
// Sidebar group labels are not routes, so send them to the group's first page.
"/docs/cards": `${base}/docs/cards/stats/`,
"/docs/customization": `${base}/docs/customization/common-options/`,
},
integrations: [
react(),
starlight({
title: "GitHub Stats Extended",
description: "Dynamically generate GitHub stats for your READMEs.",
logo: { src: "./src/assets/appLogo64.png", alt: "" },
// Starlight defaults to a favicon.svg this project does not ship.
favicon: "/favicon.ico",
head: [
{
tag: "link",
attrs: { rel: "apple-touch-icon", href: `${base}/logo192.png` },
},
{
tag: "link",
attrs: { rel: "manifest", href: `${base}/manifest.json` },
},
{ tag: "meta", attrs: { name: "theme-color", content: "#000000" } },
],
social: [
{
icon: "github",
label: "GitHub",
href: "https://github.com/stats-organization/github-stats-extended",
},
],
plugins: [
starlightLinksValidator({
// The docs link to each other by site path, so a rename must fail the build.
// `/api` and `/frontend` are not part of the docs, so they don't have matching pages.
exclude: ["/api/**", "/frontend"],
}),
],
customCss: ["./src/styles/starlight-theme.css"],
components: { SiteTitle: "./src/components/SiteTitle.astro" },
sidebar: [
{ label: "Overview", slug: "docs" },
{
label: "Cards",
items: [
{ label: "Stats Card", slug: "docs/cards/stats" },
{ label: "Top Languages Card", slug: "docs/cards/top-languages" },
{ label: "Repo Pin Card", slug: "docs/cards/repo-pin" },
{ label: "Gist Pin Card", slug: "docs/cards/gist-pin" },
{ label: "WakaTime Card", slug: "docs/cards/wakatime" },
],
},
{
label: "Customization",
items: [
{
label: "Common Options",
slug: "docs/customization/common-options",
},
{ label: "Theming", slug: "docs/customization/theming" },
// Generated by packages/core scripts/generate-theme-readme.js.
{ label: "Available Themes", slug: "docs/customization/themes" },
{ label: "Locales", slug: "docs/customization/locales" },
{
label: "Aligning Cards",
slug: "docs/customization/aligning-cards",
},
],
},
{ label: "Demo Gallery", slug: "docs/demos" },
{ label: "Run It Yourself", slug: "docs/deploy" },
{ label: "Fork Information", slug: "docs/fork" },
],
}),
],
vite: {
plugins: [tailwindcss()],
/*
* On Vercel the same deployment serves `/api` and `/frontend`, so the docs can reference cards by root-relative path.
* Locally the two are separate servers, so forward `/api` to `pnpm dev:backend` to keep those paths working.
*/
server: { proxy: { "/api": BACKEND_ORIGIN } },
resolve: {
conditions: ["@stats/source"],
alias: [
{
find: "../fetchers/wakatime.js",
replacement: path.resolve(
import.meta.dirname,
"src/wakatime-override.ts",
),
},
],
},
// The backend code the wizard reuses imports `pg`, which never runs in the browser.
build: {
rolldownOptions: {
external: ["pg"],
},
},
},
});
Loading