Skip to content

About

Self-hosted serverless SVG API generating customizable live GitHub contribution streak cards for profile READMEs.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

4 stars

Watchers

0 watching

Forks

Latest commit

Β 

History

282 Commits

Folders and files

Repository files navigation

GitHub Streak Tracker

A self-hosted, zero-dependency serverless API that generates dynamic SVG streak cards for your GitHub profile README.

License: MIT Node.js 18+ Vercel Ready Made by SAPTARSHI-coder

GitHub Streak

πŸš€ Deploy Now Β· πŸ“– API Docs Β· 🎨 Templates Β· βš™οΈ Setup


Overview

GitHub Streak Tracker is a serverless API you deploy once on Vercel. It:

  1. Fetches your contribution data from GitHub's GraphQL API
  2. Calculates your current streak, longest streak, and total contributions
  3. Renders a fully custom SVG card β€” no external fonts, no dependencies, instant load

Drop the URL in your README.md and it updates live.


Features

  • 🎨 3 templates β€” Ember, Frost, Neon
  • 🌈 5 color palettes β€” Dark, Dracula, Catppuccin, Nord, Light + fully custom hex
  • πŸ“ 3 layouts β€” Row, Stacked, Hero
  • ✍️ 4 font stacks β€” Inter, JetBrains Mono, Space Grotesk, Mono
  • ⚑ In-memory cache β€” zero repeated API calls, 1-hour TTL
  • πŸ€– GitHub Actions automation β€” daily SVG commit, zero extra secrets
  • πŸ”’ Zero scopes β€” GitHub token needs no permissions for public data

Quick Start

1. Deploy to Vercel

Deploy with Vercel

Or manually:

git clone https://github.com/SAPTARSHI-coder/github-streak-tracker.git
# Import the repo on vercel.com/new

2. Add your GitHub Token

Vercel Dashboard β†’ Settings β†’ Environment Variables:

GITHUB_TOKEN = ghp_xxxxxxxxxxxx

Get a free token at github.com/settings/tokens β€” no scopes needed.

3. Embed in your README

![GitHub Streak](https://your-app.vercel.app/streak?username=YOUR_USERNAME)

API Parameters

Parameter Options Default Description
username your GitHub login β€” Required
template ember frost neon ember Card design
palette dark dracula catppuccin nord light custom dark Color theme
layout row stacked hero row Stat arrangement
font inter jetbrains spacegrotesk mono inter Font family
bg %23RRGGBB β€” Custom background (palette=custom only)
accent %23RRGGBB β€” Custom streak color (palette=custom only)
border %23RRGGBB β€” Custom border color (palette=custom only)

Note: URL-encode # as %23 in query strings.

Example URLs

# Frost template, Dracula palette, hero layout
/streak?username=SAPTARSHI-coder&template=frost&palette=dracula&layout=hero

# Neon template, JetBrains font
/streak?username=SAPTARSHI-coder&template=neon&font=jetbrains

# Custom colors
/streak?username=SAPTARSHI-coder&palette=custom&bg=%230d1117&accent=%23ff79c6&border=%236272a4

# Stacked layout, Nord palette
/streak?username=SAPTARSHI-coder&layout=stacked&palette=nord

Templates

ember frost neon
Background Dark gradient Navy flat Pure black
Accent Coral top bar Gradient fade bar Glowing border
Dividers Subtle lines Dashed accent Dark lines
Icons SVG paths SVG paths SVG paths + glow
Best with dark, dracula nord, catppuccin dracula, custom

GitHub Actions β€” Daily Auto-Update

The included workflow runs at 00:10 UTC daily. It regenerates streak.svg and commits it automatically β€” no extra secrets required.

One-time setup:

  1. Settings β†’ Actions β†’ General β†’ "Read and write permissions" β†’ Save
  2. Optionally set repository variables (Settings β†’ Secrets and variables β†’ Actions β†’ Variables):
Variable Default Example
STREAK_USERNAME repo owner SAPTARSHI-coder
STREAK_TEMPLATE ember neon
STREAK_PALETTE dark dracula
STREAK_LAYOUT row hero
STREAK_FONT inter jetbrains

Then embed the static SVG:

![GitHub Streak](https://raw.githubusercontent.com/SAPTARSHI-coder/github-streak-tracker/main/streak.svg)

Local Development

git clone https://github.com/SAPTARSHI-coder/github-streak-tracker.git
cd github-streak-tracker
npm install
cp .env.example .env        # add your GITHUB_TOKEN
npm run dev                 # starts on http://localhost:3000

# Test endpoints
curl http://localhost:3000/streak?username=SAPTARSHI-coder
curl http://localhost:3000/health

# Generate a local SVG file
node src/generate.js SAPTARSHI-coder streak.svg ember dark row

Project Structure

github-streak-tracker/
β”œβ”€β”€ api/
β”‚   β”œβ”€β”€ streak.js          ← Vercel serverless function (main endpoint)
β”‚   └── health.js          ← Health check
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ github.js          ← GitHub GraphQL API client
β”‚   β”œβ”€β”€ streak.js          ← Streak calculation engine
β”‚   β”œβ”€β”€ cache.js           ← In-memory TTL cache
β”‚   β”œβ”€β”€ server.js          ← Express dev server
β”‚   β”œβ”€β”€ generate.js        ← CLI for local/CI SVG generation
β”‚   β”œβ”€β”€ icons.js           ← SVG path icons (no emojis)
β”‚   └── templates/
β”‚       β”œβ”€β”€ index.js       ← Template registry
β”‚       β”œβ”€β”€ ember.js       ← Warm dark card
β”‚       β”œβ”€β”€ frost.js       ← Cool navy card
β”‚       └── neon.js        ← Neon glow card
β”œβ”€β”€ docs/                  ← Full documentation
β”œβ”€β”€ .github/
β”‚   β”œβ”€β”€ workflows/
β”‚   β”‚   └── update-streak.yml  ← Daily automation
β”‚   └── ISSUE_TEMPLATE/
β”œβ”€β”€ .env.example           ← Environment variable reference
β”œβ”€β”€ vercel.json            ← Vercel route config
└── package.json

Documentation

Doc Description
Setup Guide Prerequisites, install, local dev
API Reference Every parameter with examples
Templates & Palettes Design tokens, layouts
Deployment Vercel + GitHub Actions
How It Works Architecture & data flow
Contributing Add templates, palettes, PRs

License

MIT License with Attribution Requirement β€” see LICENSE.

You are free to use, fork, and modify this project. If you deploy it publicly or build on top of it, you must include a visible credit:

Based on GitHub Streak Tracker by SAPTARSHI SADHU


Made with β™₯ by SAPTARSHI SADHU

If this helped you, please consider ⭐ starring the repo β€” it means a lot!

About

Self-hosted serverless SVG API generating customizable live GitHub contribution streak cards for profile READMEs.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

4 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages