Free, simple, fast interactive diagrams for any GitHub repository
See the codeTurn any public or private GitHub repository into an interactive architecture diagram in seconds.
You can also replace hub with diagram in a GitHub URL to open its diagram.
Sponsor slot: Reach developers while they are actively exploring codebases. Sponsor GitDiagram.
AI_PROVIDERThere is no separate FastAPI implementation, Postgres database, or Neon runtime.
Vercel serves both the UI and the generation endpoints:
/api/generate/cost estimates a run after bounded GitHub ingestion, same-origin and rate limited./api/generate/stream streams Server-Sent Events for explanation and graph progress./api/generate/cancel records authenticated, same-origin cancellation signals./api/diagram-state reads and writes the persisted result contract./api/healthz provides a lightweight deployment health check.Long-running generation uses a 300-second Vercel function budget with a shorter application deadline so quota reconciliation and persistence still have time to finish. Requests use explicit upstream deadlines, retries, structured logs, heartbeats, and distributed cancellation rather than process-local state.
The default managed OpenAI pipeline uses one GPT-5.6 Sol request at low reasoning to produce a source-grounded graph and short streamed overview. Graphs are validated and compiled deterministically; Luna is called for a repair only when structural validation requires it. Managed GPT-5.6 requests explicitly use Fast mode (service_tier: "priority"); estimates include its premium, and final costs use the model and tier actually served. User-supplied keys retain standard service and their configured model. Explicit model overrides and OpenRouter retain the two-stage pipeline. Output token estimates reserve quota but do not cap provider output.
The same Next.js application can also build into a minimal, non-root standalone Docker image for Railway. No Railway service, source connection, or Railway domain is kept live. The checked-in Dockerfile and railway.json are a cold recovery recipe that can recreate the full application later without reviving a second backend implementation. See docs/deployment-failover.md.
The full Mermaid parser remains in the test suite as a compiler contract test. It is deliberately not loaded into the production generation function, keeping the server bundle small without weakening diagram validation or browser safety.
Select Private Repos in the header and provide a fine-grained GitHub personal access token that can read the target repository. The token is sent only with the relevant same-origin request and is never embedded in public diagram links.
For exact prerequisites and environment details, see docs/dev-setup.md.
git clone https://github.com/ahmedkhaleel2004/gitdiagram.git
cd gitdiagram
bun install
cp .env.example .env
bun run dev
Open http://localhost:3000.
At minimum, configure R2, Upstash, and one AI provider in .env. A GitHub PAT or GitHub App is optional but strongly recommended for higher GitHub API limits.
Run the complete local gate before opening a pull request:
bun run lint
bun run typecheck
bun run test
bun run build
Contributions are welcome. Please open an issue or pull request with a focused description and verification notes.
Inspired by Romain Courtois's Gitingest.
TypeScript
96.5%
CSS
2.6%
Free, simple, fast interactive diagrams for any GitHub repository
See the codeTurn any public or private GitHub repository into an interactive architecture diagram in seconds.
You can also replace hub with diagram in a GitHub URL to open its diagram.
Sponsor slot: Reach developers while they are actively exploring codebases. Sponsor GitDiagram.
AI_PROVIDERThere is no separate FastAPI implementation, Postgres database, or Neon runtime.
Vercel serves both the UI and the generation endpoints:
/api/generate/cost estimates a run after bounded GitHub ingestion, same-origin and rate limited./api/generate/stream streams Server-Sent Events for explanation and graph progress./api/generate/cancel records authenticated, same-origin cancellation signals./api/diagram-state reads and writes the persisted result contract./api/healthz provides a lightweight deployment health check.Long-running generation uses a 300-second Vercel function budget with a shorter application deadline so quota reconciliation and persistence still have time to finish. Requests use explicit upstream deadlines, retries, structured logs, heartbeats, and distributed cancellation rather than process-local state.
The default managed OpenAI pipeline uses one GPT-5.6 Sol request at low reasoning to produce a source-grounded graph and short streamed overview. Graphs are validated and compiled deterministically; Luna is called for a repair only when structural validation requires it. Managed GPT-5.6 requests explicitly use Fast mode (service_tier: "priority"); estimates include its premium, and final costs use the model and tier actually served. User-supplied keys retain standard service and their configured model. Explicit model overrides and OpenRouter retain the two-stage pipeline. Output token estimates reserve quota but do not cap provider output.
The same Next.js application can also build into a minimal, non-root standalone Docker image for Railway. No Railway service, source connection, or Railway domain is kept live. The checked-in Dockerfile and railway.json are a cold recovery recipe that can recreate the full application later without reviving a second backend implementation. See docs/deployment-failover.md.
The full Mermaid parser remains in the test suite as a compiler contract test. It is deliberately not loaded into the production generation function, keeping the server bundle small without weakening diagram validation or browser safety.
Select Private Repos in the header and provide a fine-grained GitHub personal access token that can read the target repository. The token is sent only with the relevant same-origin request and is never embedded in public diagram links.
For exact prerequisites and environment details, see docs/dev-setup.md.
git clone https://github.com/ahmedkhaleel2004/gitdiagram.git
cd gitdiagram
bun install
cp .env.example .env
bun run dev
Open http://localhost:3000.
At minimum, configure R2, Upstash, and one AI provider in .env. A GitHub PAT or GitHub App is optional but strongly recommended for higher GitHub API limits.
Run the complete local gate before opening a pull request:
bun run lint
bun run typecheck
bun run test
bun run build
Contributions are welcome. Please open an issue or pull request with a focused description and verification notes.
Inspired by Romain Courtois's Gitingest.
TypeScript
96.5%
CSS
2.6%