Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2026 rowkav09

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
42 changes: 42 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,25 @@

# GitHub Profile Stats

> 🚀 Free, open-source GitHub stats card generator — embed beautiful, real-time stats in your profile README with a single line of Markdown. No tokens needed.

Beautiful, dynamically generated stats cards for your GitHub profile README. Just paste one line and your stats are always up to date — no setup, no tokens, no deployment needed.

**[ghstats.dev](https://ghstats.dev)**

[![Example Card](https://ghstats.dev/api/card?username=octocat&theme=tokyonight)](https://github.com/rowkav09/GitHub-profile-stats)

## Why GitHub Profile Stats?

- ✅ **Free & open source** — no cost, no hidden limits, MIT licensed
- 🔑 **No GitHub token required** — just your username
- 📊 **13 live stats** — stars, commits, PRs, issues, streak, weekly activity, and more
- 🎨 **12 built-in themes** — Default, Tokyo Night, Dracula, Nord, and more
- 🖼️ **SVG output** — crisp at any size, works everywhere Markdown or HTML images are supported
- ⚡ **Edge-cached** — fast responses refreshed every 30 minutes
- 🛠️ **Fully customisable** — override colours, hide stats, change border radius
- 🌍 **Works anywhere** — GitHub, GitLab, Notion, any Markdown-supported platform

## How to Use

### 1. Create your profile README (if you don't have one)
Expand Down Expand Up @@ -143,6 +156,35 @@ Add them to your own README:
![Visits](https://ghstats.dev/api/visits)
```

## FAQ

**How do I add stats to my GitHub profile?**
Create a public repo named after your GitHub username, add a `README.md`, and paste `![GitHub Stats](https://ghstats.dev/api/card?username=YOUR_USERNAME)` into it. Your stats card will appear on your profile instantly.

**Do I need a GitHub token?**
No. GitHub Profile Stats uses the public GitHub GraphQL API without any token. Just provide your username.

**How often do stats update?**
Cards are edge-cached and refresh every 30 minutes, so your stats are always near real-time.

**Can I customize the colors?**
Yes! Use URL parameters like `bg`, `text`, `title_color`, `icon_color`, and `border_color` to override any colour, or choose from 12 built-in themes.

**Is this free?**
Completely free and open source under the MIT license. No sign-up, no API key, no cost.

## Contributing

Contributions are welcome! If you have ideas for new themes, stats, or features, feel free to [open an issue](https://github.com/rowkav09/GitHub-profile-stats/issues) or submit a pull request.

1. Fork the repo
2. Create a feature branch (`git checkout -b feat/my-feature`)
3. Commit your changes and open a PR

## Support

If you find this project useful, please consider giving it a ⭐ on [GitHub](https://github.com/rowkav09/GitHub-profile-stats) — it helps others discover it!

## License

MIT
28 changes: 27 additions & 1 deletion next.config.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,30 @@
/** @type {import('next').NextConfig} */
const nextConfig = {};
const nextConfig = {
async headers() {
return [
{
source: "/(.*)",
headers: [
{
key: "X-DNS-Prefetch-Control",
value: "on",
},
{
key: "X-Frame-Options",
value: "SAMEORIGIN",
},
{
key: "X-Content-Type-Options",
value: "nosniff",
},
{
key: "Referrer-Policy",
value: "strict-origin-when-cross-origin",
},
],
},
];
},
};

export default nextConfig;
8 changes: 0 additions & 8 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

97 changes: 95 additions & 2 deletions src/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,114 @@ import { Analytics } from "@vercel/analytics/next";
import "./globals.css";

export const metadata: Metadata = {
title: "GitHub Profile Stats",
metadataBase: new URL("https://ghstats.dev"),
title: {
default:
"GitHub Profile Stats — Beautiful Stats Cards for Your README",
template: "%s | GitHub Profile Stats",
},
description:
"Generate beautiful, embeddable GitHub stats cards for your README.",
"Generate beautiful, dynamically generated GitHub stats cards for your profile README. 13 stats, 12 themes, fully customizable SVG cards — just paste one line. No tokens, no setup, no deployment needed. Free and open source.",
keywords: [
"github stats",
"github profile stats",
"github readme stats",
"github stats card",
"github profile readme",
"readme stats generator",
"github contribution stats",
"github streak stats",
"svg stats card",
"developer stats",
"github activity",
"open source",
"github readme generator",
"profile readme",
"github stats badge",
],
authors: [{ name: "rowkav09", url: "https://github.com/rowkav09" }],
creator: "rowkav09",
publisher: "rowkav09",
openGraph: {
title:
"GitHub Profile Stats — Beautiful Stats Cards for Your README",
description:
"Generate beautiful, dynamically generated GitHub stats cards for your profile README. 13 stats, 12 themes, fully customizable SVG cards — just paste one line. No tokens, no setup, no deployment needed. Free and open source.",
url: "https://ghstats.dev",
siteName: "GitHub Profile Stats",
type: "website",
locale: "en_US",
images: [
{
url: "/opengraph-image",
width: 1200,
height: 630,
alt: "GitHub Profile Stats — Beautiful Stats Cards for Your README",
},
],
},
twitter: {
card: "summary_large_image",
title:
"GitHub Profile Stats — Beautiful Stats Cards for Your README",
description:
"Generate beautiful, dynamically generated GitHub stats cards for your profile README. 13 stats, 12 themes, fully customizable SVG cards — just paste one line. No tokens, no setup, no deployment needed. Free and open source.",
images: ["/opengraph-image"],
creator: "@rowkav09",
},
alternates: {
canonical: "https://ghstats.dev",
},
robots: {
index: true,
follow: true,
googleBot: {
index: true,
follow: true,
"max-video-preview": -1,
"max-image-preview": "large",
"max-snippet": -1,
},
},
icons: {
icon: "https://github.com/rowkav09.png",
},
};

const jsonLd = {
"@context": "https://schema.org",
"@type": "WebApplication",
name: "GitHub Profile Stats",
description:
"Generate beautiful, dynamically generated GitHub stats cards for your profile README. 13 stats, 12 themes, fully customizable SVG cards — just paste one line. No tokens, no setup, no deployment needed. Free and open source.",
url: "https://ghstats.dev",
applicationCategory: "DeveloperApplication",
operatingSystem: "All",
offers: {
"@type": "Offer",
price: "0",
priceCurrency: "USD",
},
author: {
"@type": "Person",
name: "rowkav09",
url: "https://github.com/rowkav09",
},
};

export default function RootLayout({
children,
}: {
children: React.ReactNode;
}) {
return (
<html lang="en">
<head>
<script
type="application/ld+json"
dangerouslySetInnerHTML={{ __html: JSON.stringify(jsonLd) }}
/>
</head>
<body className="bg-[#0d1117] text-[#c9d1d9] antialiased">
{children}
<Analytics />
Expand Down
71 changes: 71 additions & 0 deletions src/app/opengraph-image.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
import { ImageResponse } from "next/og";

export const runtime = "edge";
export const alt =
"GitHub Profile Stats — Beautiful Stats Cards for Your README";
export const size = { width: 1200, height: 630 };
export const contentType = "image/png";

export default async function Image() {
return new ImageResponse(
(
<div
style={{
background:
"linear-gradient(135deg, #0d1117 0%, #161b22 50%, #0d1117 100%)",
width: "100%",
height: "100%",
display: "flex",
flexDirection: "column",
alignItems: "center",
justifyContent: "center",
fontFamily: "sans-serif",
}}
>
<div
style={{
display: "flex",
alignItems: "center",
gap: "16px",
marginBottom: "24px",
}}
>
<svg width="64" height="64" viewBox="0 0 16 16" fill="#58a6ff">
<path d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0016 8c0-4.42-3.58-8-8-8z" />
</svg>
</div>
<div
style={{
fontSize: 56,
fontWeight: 800,
color: "#ffffff",
marginBottom: "16px",
textAlign: "center",
}}
>
GitHub Profile Stats
</div>
<div
style={{
fontSize: 24,
color: "#8b949e",
textAlign: "center",
maxWidth: "700px",
}}
>
Beautiful stats cards for your README — just paste one line
</div>
<div
style={{
fontSize: 20,
color: "#58a6ff",
marginTop: "32px",
}}
>
ghstats.dev
</div>
</div>
),
{ ...size }
);
}
14 changes: 14 additions & 0 deletions src/app/robots.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import type { MetadataRoute } from "next";

export default function robots(): MetadataRoute.Robots {
return {
rules: [
{
userAgent: "*",
allow: "/",
disallow: ["/api/card", "/api/badge", "/api/visits"],
},
],
sitemap: "https://ghstats.dev/sitemap.xml",
};
}
Loading