A self-hosted GitHub alternative built to run on Cloudflare Developer Platform. Built on top of Cloudflare Workers, Durable Objects.
[!WARNING] Gitflare is currently in very early development. Expect bugs and missing features.
Gitflare reimagines Git hosting with a fully serverless architecture. Here's how the pieces fit together:
┌─────────────────────────────────────────────────────────────────────┐
│ Git Client (You) │
│ git push / git pull / git clone │
└────────────────────────────────┬────────────────────────────────────┘
│ HTTPS
▼
┌─────────────────────────────────────────────────────────────────────┐
│ Cloudflare Workers (Edge) │
│ ┌───────────────────────────────────────────────────────────────┐ │
│ │ TanStack Start Application │ │
│ │ │ │
│ │ • Authentication & Authorization │ │
│ │ • HTTP Handlers for Git Smart Protocol │ │
│ │ - git-upload-pack (fetch/pull) │ │
│ │ - git-receive-pack (push) │ │
│ │ - Pkt-line protocol parsing │ │
│ │ - Packfile creation & transfer │ │
│ │ • Web UI │ │
│ └───────────────────────────────────────────────────────────────┘ │
└──────────────────┬────────────────────────────┬─────────────────────┘
│ │
│ Git Operations │ Metadata Queries
▼ ▼
┌──────────────────────────────────┐ ┌─────────────────────────────┐
│ Cloudflare Durable Objects │ │ Cloudflare D1 │
│ │ │ │
│ ┌────────────────────────────┐ │ │ • User Accounts │
│ │ Virtualized File System │ │ │ • Repository Metadata │
│ │ (Built on DO SQLite) │ │ │ • Issues & Comments │
│ │ │ │ │ • Real-time Subscriptions │
│ │ • Git Objects Storage │ │ └─────────────────────────────┘
│ │ • Packfile Operations │ │
│ └────────────────────────────┘ │
│ │
│ (One Durable Object per Repo) │
└──────────────────────────────────┘1. Git Protocol Handling
When you interact with a Gitflare repository using standard Git commands, the request hits HTTP handlers in the TanStack Start application. These handlers implement the Git Smart HTTP protocol, translating Git's wire protocol into operations that can be executed against the repository storage. The entire TanStack Start app runs on Cloudflare Workers, deployed globally at the edge for minimal latency.
2. Repository Data Storage
Git repository data including all objects (blobs, trees, commits, tags), references (branches, tags), and packfiles are stored in Cloudflare Durable Objects. Each repository gets its own isolated Durable Object instance with a virtualized file system built on top of Durable Object SQLite storage.
3. Metadata & Coordination
User data, repository metadata, issues, pull requests, and access control information live in Cloudflare D1. This separation allows the web interface to provide real-time reactive updates, efficient querying, and type-safe operations without impacting Git protocol performance. Cloudflare D1 also integrates with Better Auth to handle authentication seamlessly.
gitflare/
├── apps/
│ └── web/ # TanStack Start app deployed on Cloudflare Workers
│ # Contains Git Smart HTTP Protocol handlers, Durable
│ # Object implementations, Web UI, and routingTODO
Root Level:
pnpm dev - Start all applications in development mode (Turborepo)pnpm build - Build all applicationspnpm check - Run Biome linting and formatting checkspnpm check:fix - Run Biome and auto-fix issues (run this after making code changes)Web App (apps/web):
pnpm dev - Start the web development server (Vite)pnpm build - Build the web applicationpnpm serve - Preview production build locallypnpm deploy - Deploy to Cloudflare Workerspnpm cf-typegen - Generate TypeScript types for Cloudflare Workersgit checkout -b feature/my-featurepnpm check:fixgit commit -m 'Add my feature'git push origin feature/my-featureMIT
This project was created with Better-T-Stack, a modern TypeScript stack combining React, TanStack Start and more.
For issues and questions: