MCPcopy Index your code
hub / github.com/ez4o/github-contribution-graph

github.com/ez4o/github-contribution-graph @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow
24 symbols 67 edges 20 files 0 documented · 0%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

[

Contributors]contributors-url [Forks]forks-url [Stargazers]stars-url [MIT License]license-url [Issues]issues-url [Issues Closed

]issues-closed-url

github-contribution-graph

<a href="https://github.com/ez4o/github-contribution-graph#usage"><strong>Explore Usage »</strong></a>






<a href="https://github.com/ez4o/github-contribution-graph/issues">Report Bug</a>
·
<a href="https://github.com/ez4o/github-contribution-graph/issues">Request Feature</a>

Table of Contents

  1. About The Project
  2. Getting Started
  3. Deploy Your Own Server
  4. Roadmap
  5. Contributing
  6. License
  7. Acknowledgments
  8. Contact

About The Project

screenshot

GitHub-Contribution-Graph is an awesome tool for dynamically generating contribution graphs that show your GitHub contributions.

It can be used anywhere, you can download the image, share the link, or paste the link in any markdown file, and it will render the image directly on the website.

(back to top)

Getting Started

Usage

https://github-contribution-graph.ez4o.com/?username=[YOUR_GITHUB_USERNAME]&last_n_days=[DAYS_YOU_WANT_TO_SHOW]&img_url=[ENCODED_IMAGE_URL]

Parameters

Parameter Necessity Description Default Value
username Required Your GitHub username. None
last_n_days Optional The n days to show on the chart. 0 < n < 365 7
img_url Optional Background image. Use url encode tool like https://www.urlencoder.org/. A Cat Image

:warning: If you are using large last_n_days or large image file: The response time may be very long!

Example

Assume we want:

  • username = wst24365888
  • last_n_days = 10
  • img_url = https://image.cache.storm.mg/media/image/2021/03/05/20210305-031458_U22011_M676060_ca39.gif

Remember to encode it: https%3A%2F%2Fimage.cache.storm.mg%2Fmedia%2Fimage%2F2021%2F03%2F05%2F20210305-031458_U22011_M676060_ca39.gif

Then, we get:

  • https://github-contribution-graph.ez4o.com/?username=wst24365888&last_n_days=10&img_url=https%3A%2F%2Fimage.cache.storm.mg%2Fmedia%2Fimage%2F2021%2F03%2F05%2F20210305-031458_U22011_M676060_ca39.gif

And yeah! GitHub-Contribution-Graph actually supports gif!

gif-example

(back to top)

Deploy Your Own Server

These are some instructions on setting up your project locally, just follow these simple steps.

Prerequisites

Installation

  1. Clone the repo.

sh git clone https://github.com/ez4o/github-contribution-graph.git cd github-contribution-graph

  1. Install npm packages.

sh pnpm i

  1. Install Go modules.

sh go get -u

  1. Fill in the GitHub token inside the configuration.

sh cp config.json.example config.json

Generate Dist-SSR

  1. Use release command, and it will generate dist-ssr/ with a executable file inside.

sh make release-windows

or

sh make release-linux

  1. Get dist-ssr/, and you can deploy it anywhere!

When execute, GitHub-Contribution-Graph will use port 8686 and 8687.

(back to top)

Roadmap

  • [x] Customize Background Image
  • [x] CSS Animation (actually, it's a SMIL animation lol)
  • [x] New Parameter: last_n_days
  • [ ] More Patameters...

See the open issues for a full list of proposed features (and known issues).

(back to top)

Contributing

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feat/amazing-feature)
  3. Commit your Changes with Conventional Commits
  4. Push to the Branch (git push origin feat/amazing-feature)
  5. Open a Pull Request

(back to top)

License

Distributed under the MIT License. See LICENSE for more information.

(back to top)

Acknowledgments

(back to top)

Contact

Author

Project Link

(back to top)

Extension points exported contracts — how you extend this code

ContributionEntry (Interface)
(no doc)
src/client/model/contribution_entry.ts

Core symbols most depended-on inside this repo

sendSVG
called by 3
src/server/server.go
GetContributionOfLastNDays
called by 2
src/server/model/github_data.go
handleSVGInBackground
called by 1
src/server/server.go
handleSVG
called by 1
src/server/server.go
Start
called by 1
src/server/server.go
GetEntry
called by 1
src/server/model/github_data.go
CompressGif
called by 1
src/server/util/compress_gif.go
ConvertImgToWebp
called by 1
src/server/util/convert_img_to_webp.go

Shape

Function 8
Struct 8
Method 7
Interface 1

Languages

Go96%
TypeScript4%

Modules by API surface

src/server/server.go6 symbols
src/server/model/github_data.go4 symbols
main.go2 symbols
src/server/util/hydrate_contribution_data.go1 symbols
src/server/util/get_request_params.go1 symbols
src/server/util/get_contribution_data.go1 symbols
src/server/util/get_base64_from_img_url.go1 symbols
src/server/util/convert_img_to_webp.go1 symbols
src/server/util/compress_gif.go1 symbols
src/server/model/template_data.go1 symbols
src/server/model/request_params.go1 symbols
src/server/model/image.go1 symbols

For agents

$ claude mcp add github-contribution-graph \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact