gitdiagram icon indicating copy to clipboard operation
gitdiagram copied to clipboard

API

Open janwilmake opened this issue 9 months ago • 2 comments

I'm working on an API for you guys to allow devs to integrate with it...

https://github.com/janwilmake/forgithub.diagram

Happy to talk send me a DM on X

janwilmake avatar Feb 19 '25 08:02 janwilmake

Update:

  • added frontend
  • added api docs
  • total LOC reduction: 9.5x

Possible improvements:

  • add monetisation using https://sponsorflare.com
  • use cloudflare browser rendering to expose /owner/repo/image.svg as well as /owner/repo/image.png (do something similar to https://github.com/alfonsusac/mermaid-ssr)
  • use https://uithub.com/openapi.html to retrieve the tree instead of the github api (to bypass the ratelimit)

janwilmake avatar Feb 19 '25 10:02 janwilmake

Update:

  • Added cache-control with stale-while-revalidate and max-age, so it's easy to refresh with a query param
  • Added browser rendered png endpoint, e.g.

Sometimes though I'm getting invalid syntax, e.g.: https://diagram.forgithub.com/ahmedkhaleel2004/gitdiagram

I would like to know, maybe I've used some incorrect settings? e.g. what mermaid version are you using, and which LLM?

janwilmake avatar Feb 19 '25 15:02 janwilmake