An extensible, high-performance API server built with Next.js that generates dynamic, customizable SVG statistics cards for your GitHub profile README. Features interactive telemetry components, language spectrum charts, contribution streak tracking, customizable themes, modular card layouts, and built-in server-side caching.
Example: See below
Click the button below to deploy your own instance directly to Vercel. Vercel will clone this repo straight into your GitHub account, prompt you for the GITHUB_TOKEN environment variable, and deploy-no manual forking required.
During setup Vercel will:
- Ask you to sign in / connect GitHub
- Create a new repo in your account with this code
- Prompt you for
GITHUB_TOKEN(see Getting a token below) - Deploy it
- Click Fork at the top of this repo on GitHub
- Go to vercel.com/new and import your fork
- Before deploying, expand Environment Variables and add
GITHUB_TOKEN - Click Deploy
Both options end up in the same place - pick whichever flow you prefer.
<img
src="https://your-app.vercel.app/?username=GITHUB_USERNAME"
alt="GitHub stats"
/>Just open the URL in a browser β it's a valid standalone image.
Customize your stats card by passing query parameters directly in the URL:
https://your-domain.com/?username=GITHUB_USERNAME&theme=signal-lab&hide_header=false
| Query Value | Layout / Type | Description |
|---|---|---|
signal-lab (Default) |
Full Dashboard | High-tech cyberpunk telemetry dashboard |
dracula |
Full Dashboard | Dracula color palette |
nord |
Full Dashboard | Arctic, north-bluish Nord color palette |
matrix |
Full Dashboard | Terminal green matrix theme |
cyberpunk |
Full Dashboard | Neon blue and magenta palette |
compact |
Compact Card | Sleek single-card summary with metric pillars |
compact-dracula |
Compact Card | Compact with Dracula color pallet |
compact-nord |
Compact Card | Compact with Nord color pallet |
grid |
Modern Grid | Card-based grid layout with progress indicators |
grid-cyber |
Modern Grid | Grid with Cyberpunk color pallet |
languages |
Single Card | Dedicated Top Languages bar & breakdown chart |
stats |
Single Card | Dedicated core GitHub statistics card |
streak |
Single Card | Dedicated contribution streak & flame counter |
See the how different themes look in the Example section.
| Parameter | Type | Default | Description |
|---|---|---|---|
username |
string |
Required | Your GitHub username |
theme |
string |
signal-lab |
Visual theme or specialized card variant |
hide_header |
boolean |
false |
Set to true or 1 to hide the top avatar/profile header |
- Node.js: 18.x or higher
- GitHub Personal Access Token (PAT): Requires
read:userandrepopermissions to query the GitHub GraphQL API.
git clone https://github.com/tajultonim/fancy-github-stats.git
cd fancy-github-stats
npm installCreate a .env.local file in the project root:
GITHUB_TOKEN=your_github_personal_access_token_herenpm run devOpen http://localhost:3000/?username=YOUR_USERNAME in your browser to test the SVG output.
The card reads your GitHub data via GraphQL, which needs a token.
- Go to GitHub β Settings β Developer settings β Personal access tokens β Tokens (Classic), or follow this link
- Click Generate new token > Generate new token (Classic)
- Put a note as you please
- Under Select Scopes, select
repo,read:user,user:email - Generate the token and copy it - you won't see it again
Paste it into the
GITHUB_TOKENfield when prompted by the deploy flow or add it in your Vercel project's Settings β Environment Variables if deploying from a repo.
This project uses the Strategy Pattern to separate API routing, GitHub GraphQL data fetching, and SVG layout rendering.
βββ app/
β βββ route.js # Main API controller (handles /?username=...)
βββ lib/
β βββ github.js # GraphQL client, cache, and metrics computation
β βββ layouts/
β βββ registry.js # Central layout and theme resolver engine
β βββ signalLab.js # Dual-column telemetry dashboard
β βββ compact.js # Compact card layout
β βββ modernGrid.js # Grid card layout
β βββ singleLanguage.js # Language card
β βββ singleStats.js # Stats card
β βββ singleStreak.js # Streak card
- Open the target layout file (e.g.,
lib/layouts/compact.js). - Add your new palette under the
palettesobject:
myTheme: {
bg: "#1a1a1a",
card: "#262626",
border: "#404040",
textPrimary: "#ffffff",
textSecondary: "#a3a3a3",
accent: "#3b82f6",
}- Register the theme alias in
lib/layouts/registry.js:
"compact-custom": { layout: "compact", palette: "myTheme" }- Create a new layout file under
lib/layouts/myNewLayout.js. - Implement the strategy interface:
export const myNewLayout = {
palettes: {
default: {
/* colors */
},
},
render(stats, colors, options = {}) {
// Return SVG string
},
};- Export and register it in
lib/layouts/registry.js.
signal-lab, 2.dracula
nord, 4.matrix
cyberpunk
compact, 2.compact-dracula
compact-nord
grid, 5.grid-cyber
stats, 2.languages
streak
Copyright Β© 2026 Tajul Tonim
This project is licensed under the GNU General Public License v3.0. See the LICENSE file for details.