Skip to content

About

One-process GitHub-compatible git forge: git smart HTTP v2/v0, REST v3, GraphQL v4, MCP — make.fun github-core-clone-01 entry

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

github-core-clone-01-entry

A GitHub-compatible git forge in a single Node 22 process, with no runtime dependencies and no git binary. Built for the make.fun competition github-core-clone-01 ("Build a GitHub-compatible git forge").

What it serves

  • git smart HTTP at /{owner}/{repo}.git — info/refs, git-upload-pack (protocol v2 and v0) and git-receive-pack (v0). Pure-TypeScript git object model: blobs, trees, commits, tags, loose objects, packfile read (OFS/REF deltas, thin packs) and write, refs, shallow clones (deepen), fast-forward validation on push.
  • REST v3 under /api/v3 — root, meta, users, repos (create/list/get/ patch/delete, branches, refs, commits, contents, labels), issues and comments, pull requests (create/list/get/files, squash merge). JSON everywhere, X-GitHub-Request-Id on every reply, Bearer token auth.
  • GraphQL v4 at POST /api/graphql — repositories, issues, pull requests, search, node(id:), mutations (createIssue, closeIssue, createPullRequest, mergePullRequest, addComment), batch queries.
  • MCP at POST /mcp — streamable HTTP, server/discover and legacy initialize, tools/list, tools/call (create_repo, get_repo, create_issue, list_issues, get_issue, create_pull_request, merge_pull_request, list_pull_requests).
  • Health at GET /healthz → {"ok": true}.

State lives in memory (per repo: objects, refs, issues, pulls, labels). Timestamps are deterministic (a monotonic sequence clock), so object SHAs are stable across replays.

Run

MAKEFUN_SHOP_TOKEN=<token> node --experimental-strip-types main.ts

main.ts registers the service at $MAKEFUN_ENV_URL/register, binds an ephemeral port and long-polls /done. For local checks, start the app the same way and point the kit runner at it:

node --experimental-strip-types sdk/run.ts --url http://127.0.0.1:PORT --token "$TOKEN" [--perf] [--json]

Layout

  • main.ts — starter lifecycle (unchanged).
  • app.ts — the whole forge (HTTP plumbing, store, REST, GraphQL, MCP, git wire protocol).
  • package.json, tsconfig.json — Node 22, type stripping, no deps.
  • .makefun/owner.json — competition wallet.

License

MIT — see LICENSE.

About

One-process GitHub-compatible git forge: git smart HTTP v2/v0, REST v3, GraphQL v4, MCP — make.fun github-core-clone-01 entry

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages