# burrr-ai/gitcask architecture

> Architecture diagram of the GitHub repository burrr-ai/gitcask, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-10). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/burrr-ai/gitcask
- Repository: https://github.com/burrr-ai/gitcask

## Overview

gitcask is a stateless Git hosting server backed by S3-compatible storage: Git clients and platform callers send requests to the server, which authenticates repository access, serves Git/JSON/LFS operations, and persists repository state as a WAL. The README documents CAS publication, cross-instance freshness, webhook delivery, maintenance, and independent repository initialization. Source excerpts show WAL publishing and synchronization, task management, and authentication internals; links for unsampled subsystems are limited to documented relationships.

Main entry points: [`crates/gitcask-server/src/web/mod.rs`](https://github.com/burrr-ai/gitcask/blob/main/crates/gitcask-server/src/web/mod.rs) (HTTP routing), [`crates/gitcask-wal/src/publish.rs`](https://github.com/burrr-ai/gitcask/blob/main/crates/gitcask-wal/src/publish.rs) (WAL publisher), [`crates/gitcask-server/src/ops.rs`](https://github.com/burrr-ai/gitcask/blob/main/crates/gitcask-server/src/ops.rs) (Maintenance operations), [`crates/gitcask-store/src/lib.rs`](https://github.com/burrr-ai/gitcask/blob/main/crates/gitcask-store/src/lib.rs) (Object store)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Request interfaces"]
  node_http_routes["HTTP routing<br/>[mod.rs]"]
  node_smart_git["Git HTTP<br/>[smart.rs]"]
  node_json_api["JSON API<br/>[commit.rs]"]
  node_lfs["LFS service<br/>[lfs.rs]"]
end

subgraph group_identity["Identity and access"]
  node_authentication["Authentication<br/>[auth.rs]"]
end

subgraph group_repository["Repository runtime"]
  node_repo_runtime["Repository access<br/>[repo.rs]"]
  node_git_engine["Git object engine<br/>[ingest.rs]"]
  node_repo_handle["Repository handle<br/>[handle.rs]"]
  node_wal_sync["Freshness and sync<br/>[sync.rs]"]
end

subgraph group_durability["WAL and storage"]
  node_store_api["Object store<br/>[lib.rs]"]
  node_s3_store[("S3 backend<br/>[s3.rs]")]
  node_memory_store[("Memory backend<br/>[memory.rs]")]
  node_wal_publish["WAL publisher<br/>[publish.rs]"]
  node_wal_state["Manifest state<br/>[state.rs]"]
  node_checkpoint["Checkpoints<br/>[checkpoint.rs]"]
end

subgraph group_operations["Operations and events"]
  node_maint_ops["Maintenance operations<br/>[ops.rs]"]
  node_gc["Garbage collection<br/>[gc.rs]"]
  node_maintenance["Maintenance runner<br/>[maintain.rs]"]
  node_task_manager["Background tasks<br/>[tasks.rs]"]
  node_progress["Task progress<br/>[progress.rs]"]
  node_event_bridge["Webhook bridge<br/>[bridge.rs]"]
  node_event_stream["Event stream<br/>[sse.rs]"]
end

subgraph group_tools["Administration tools"]
  node_cli["CLI commands<br/>[lib.rs]"]
  node_migration["Bulk migration<br/>[migrate.rs]"]
end

node_git_client(("Git clients"))
node_platform(("Platform callers"))
node_token_issuer(("Token issuer"))

node_git_client -->|"sends HTTP"| node_http_routes
node_platform -->|"calls API"| node_http_routes
node_http_routes -->|"authenticates"| node_authentication
node_http_routes -->|"routes Git"| node_smart_git
node_http_routes -->|"routes API"| node_json_api
node_http_routes -.->|"routes LFS"| node_lfs
node_authentication -->|"introspects tokens"| node_token_issuer
node_smart_git -->|"accesses repository"| node_repo_runtime
node_json_api -.->|"accesses repository"| node_repo_runtime
node_repo_runtime -.->|"opens repository"| node_repo_handle
node_repo_handle -->|"checks freshness"| node_wal_sync
node_wal_sync -->|"reads objects"| node_store_api
node_wal_sync -.->|"installs packs"| node_git_engine
node_smart_git -.->|"ingests packs"| node_git_engine
node_repo_handle -->|"publishes requests"| node_wal_publish
node_wal_publish -->|"writes CAS manifest"| node_store_api
node_wal_publish -->|"updates state"| node_wal_state
node_wal_publish -->|"triggers checkpoint"| node_checkpoint
node_store_api -.->|"stores persistently"| node_s3_store
node_store_api -->|"offers backend"| node_memory_store
node_platform -.->|"runs commands"| node_cli
node_cli -->|"runs migration"| node_migration
node_migration -.->|"imports repositories"| node_repo_runtime
node_platform -->|"starts operations"| node_maint_ops
node_maint_ops -->|"dispatches collection"| node_gc
node_maint_ops -->|"dispatches maintenance"| node_maintenance
node_maint_ops -.->|"starts tasks"| node_task_manager
node_task_manager -->|"reports progress"| node_progress
node_event_bridge -.->|"streams events"| node_event_stream
node_event_bridge -->|"delivers webhooks"| node_platform

click node_http_routes "https://github.com/burrr-ai/gitcask/blob/main/crates/gitcask-server/src/web/mod.rs"
click node_smart_git "https://github.com/burrr-ai/gitcask/blob/main/crates/gitcask-server/src/smart.rs"
click node_json_api "https://github.com/burrr-ai/gitcask/blob/main/crates/gitcask-server/src/web/api/commit.rs"
click node_lfs "https://github.com/burrr-ai/gitcask/blob/main/crates/gitcask-server/src/lfs.rs"
click node_authentication "https://github.com/burrr-ai/gitcask/blob/main/crates/gitcask-server/src/auth.rs"
click node_repo_runtime "https://github.com/burrr-ai/gitcask/blob/main/crates/gitcask-server/src/repo.rs"
click node_git_engine "https://github.com/burrr-ai/gitcask/blob/main/crates/gitcask-git/src/ingest.rs"
click node_repo_handle "https://github.com/burrr-ai/gitcask/blob/main/crates/gitcask-wal/src/handle.rs"
click node_wal_sync "https://github.com/burrr-ai/gitcask/blob/main/crates/gitcask-wal/src/sync.rs"
click node_store_api "https://github.com/burrr-ai/gitcask/blob/main/crates/gitcask-store/src/lib.rs"
click node_s3_store "https://github.com/burrr-ai/gitcask/blob/main/crates/gitcask-store/src/s3.rs"
click node_memory_store "https://github.com/burrr-ai/gitcask/blob/main/crates/gitcask-store/src/memory.rs"
click node_wal_publish "https://github.com/burrr-ai/gitcask/blob/main/crates/gitcask-wal/src/publish.rs"
click node_wal_state "https://github.com/burrr-ai/gitcask/blob/main/crates/gitcask-wal/src/state.rs"
click node_checkpoint "https://github.com/burrr-ai/gitcask/blob/main/crates/gitcask-wal/src/checkpoint.rs"
click node_maint_ops "https://github.com/burrr-ai/gitcask/blob/main/crates/gitcask-server/src/ops.rs"
click node_gc "https://github.com/burrr-ai/gitcask/blob/main/crates/gitcask-server/src/gc.rs"
click node_maintenance "https://github.com/burrr-ai/gitcask/blob/main/crates/gitcask-server/src/maintain.rs"
click node_task_manager "https://github.com/burrr-ai/gitcask/blob/main/crates/gitcask-wal/src/tasks.rs"
click node_progress "https://github.com/burrr-ai/gitcask/blob/main/crates/gitcask-wal/src/progress.rs"
click node_event_bridge "https://github.com/burrr-ai/gitcask/blob/main/crates/gitcask-server/src/bridge.rs"
click node_event_stream "https://github.com/burrr-ai/gitcask/blob/main/crates/gitcask-server/src/sse.rs"
click node_cli "https://github.com/burrr-ai/gitcask/blob/main/crates/gitcask-cli/src/lib.rs"
click node_migration "https://github.com/burrr-ai/gitcask/blob/main/crates/gitcask-cli/src/migrate.rs"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_http_routes,node_smart_git,node_json_api,node_lfs,node_git_client toneBlue
class node_authentication toneAmber
class node_repo_runtime,node_git_engine,node_repo_handle,node_wal_sync toneMint
class node_store_api,node_s3_store,node_memory_store,node_wal_publish,node_wal_state,node_checkpoint toneRose
class node_maint_ops,node_gc,node_maintenance,node_task_manager,node_progress,node_event_bridge,node_event_stream,node_platform,node_token_issuer toneIndigo
class node_cli,node_migration toneTeal
```

## Components

### Request interfaces

- [HTTP routing](https://github.com/burrr-ai/gitcask/blob/main/crates/gitcask-server/src/web/mod.rs): `crates/gitcask-server/src/web/mod.rs`
- [Git HTTP](https://github.com/burrr-ai/gitcask/blob/main/crates/gitcask-server/src/smart.rs): `crates/gitcask-server/src/smart.rs`
- [JSON API](https://github.com/burrr-ai/gitcask/blob/main/crates/gitcask-server/src/web/api/commit.rs): `crates/gitcask-server/src/web/api/commit.rs`
- [LFS service](https://github.com/burrr-ai/gitcask/blob/main/crates/gitcask-server/src/lfs.rs): `crates/gitcask-server/src/lfs.rs`

### Identity and access

- [Authentication](https://github.com/burrr-ai/gitcask/blob/main/crates/gitcask-server/src/auth.rs): `crates/gitcask-server/src/auth.rs`

### Repository runtime

- [Repository access](https://github.com/burrr-ai/gitcask/blob/main/crates/gitcask-server/src/repo.rs): `crates/gitcask-server/src/repo.rs`
- [Git object engine](https://github.com/burrr-ai/gitcask/blob/main/crates/gitcask-git/src/ingest.rs): `crates/gitcask-git/src/ingest.rs`
- [Repository handle](https://github.com/burrr-ai/gitcask/blob/main/crates/gitcask-wal/src/handle.rs): `crates/gitcask-wal/src/handle.rs`
- [Freshness and sync](https://github.com/burrr-ai/gitcask/blob/main/crates/gitcask-wal/src/sync.rs): `crates/gitcask-wal/src/sync.rs`

### WAL and storage

- [Object store](https://github.com/burrr-ai/gitcask/blob/main/crates/gitcask-store/src/lib.rs): `crates/gitcask-store/src/lib.rs`
- [S3 backend](https://github.com/burrr-ai/gitcask/blob/main/crates/gitcask-store/src/s3.rs): `crates/gitcask-store/src/s3.rs`
- [Memory backend](https://github.com/burrr-ai/gitcask/blob/main/crates/gitcask-store/src/memory.rs): `crates/gitcask-store/src/memory.rs`
- [WAL publisher](https://github.com/burrr-ai/gitcask/blob/main/crates/gitcask-wal/src/publish.rs): `crates/gitcask-wal/src/publish.rs`
- [Manifest state](https://github.com/burrr-ai/gitcask/blob/main/crates/gitcask-wal/src/state.rs): `crates/gitcask-wal/src/state.rs`
- [Checkpoints](https://github.com/burrr-ai/gitcask/blob/main/crates/gitcask-wal/src/checkpoint.rs): `crates/gitcask-wal/src/checkpoint.rs`

### Operations and events

- [Maintenance operations](https://github.com/burrr-ai/gitcask/blob/main/crates/gitcask-server/src/ops.rs): `crates/gitcask-server/src/ops.rs`
- [Garbage collection](https://github.com/burrr-ai/gitcask/blob/main/crates/gitcask-server/src/gc.rs): `crates/gitcask-server/src/gc.rs`
- [Maintenance runner](https://github.com/burrr-ai/gitcask/blob/main/crates/gitcask-server/src/maintain.rs): `crates/gitcask-server/src/maintain.rs`
- [Background tasks](https://github.com/burrr-ai/gitcask/blob/main/crates/gitcask-wal/src/tasks.rs): `crates/gitcask-wal/src/tasks.rs`
- [Task progress](https://github.com/burrr-ai/gitcask/blob/main/crates/gitcask-wal/src/progress.rs): `crates/gitcask-wal/src/progress.rs`
- [Webhook bridge](https://github.com/burrr-ai/gitcask/blob/main/crates/gitcask-server/src/bridge.rs): `crates/gitcask-server/src/bridge.rs`
- [Event stream](https://github.com/burrr-ai/gitcask/blob/main/crates/gitcask-server/src/sse.rs): `crates/gitcask-server/src/sse.rs`

### Administration tools

- [CLI commands](https://github.com/burrr-ai/gitcask/blob/main/crates/gitcask-cli/src/lib.rs): `crates/gitcask-cli/src/lib.rs`
- [Bulk migration](https://github.com/burrr-ai/gitcask/blob/main/crates/gitcask-cli/src/migrate.rs): `crates/gitcask-cli/src/migrate.rs`

### Other components

- **Git clients**
- **Platform callers**
- **Token issuer**

## Connections

- Git clients → HTTP routing: sends HTTP (evidence: `README.md`)
- Platform callers → HTTP routing: calls API (evidence: `README.md`)
- HTTP routing → Authentication: authenticates (evidence: `crates/gitcask-server/src/web/mod.rs`)
- HTTP routing → Git HTTP: routes Git (evidence: `README.md`)
- HTTP routing → JSON API: routes API (evidence: `README.md`)
- HTTP routing → LFS service: routes LFS (evidence: `README.md`)
- Authentication → Token issuer: introspects tokens (evidence: `crates/gitcask-server/src/auth.rs`)
- Git HTTP → Repository access: accesses repository (evidence: `crates/gitcask-server/src/smart.rs`)
- JSON API → Repository access: accesses repository (evidence: `README.md`)
- Repository access → Repository handle: opens repository (evidence: `README.md`)
- Repository handle → Freshness and sync: checks freshness (evidence: `crates/gitcask-wal/src/handle.rs`)
- Freshness and sync → Object store: reads objects (evidence: `crates/gitcask-wal/src/sync.rs`)
- Freshness and sync → Git object engine: installs packs (evidence: `README.md`)
- Git HTTP → Git object engine: ingests packs (evidence: `README.md`)
- Repository handle → WAL publisher: publishes requests (evidence: `crates/gitcask-wal/src/handle.rs`)
- WAL publisher → Object store: writes CAS manifest (evidence: `crates/gitcask-wal/src/publish.rs`)
- WAL publisher → Manifest state: updates state (evidence: `crates/gitcask-wal/src/publish.rs`)
- WAL publisher → Checkpoints: triggers checkpoint (evidence: `crates/gitcask-wal/src/publish.rs`)
- Object store → S3 backend: stores persistently (evidence: `README.md`)
- Object store → Memory backend: offers backend (evidence: `crates/gitcask-store/src/lib.rs`)
- Platform callers → CLI commands: runs commands (evidence: `README.md`)
- CLI commands → Bulk migration: runs migration (evidence: `crates/gitcask-cli/src/lib.rs`)
- Bulk migration → Repository access: imports repositories (evidence: `crates/gitcask-cli/src/migrate.rs`)
- Platform callers → Maintenance operations: starts operations
- Maintenance operations → Garbage collection: dispatches collection (evidence: `crates/gitcask-server/src/ops.rs`)
- Maintenance operations → Maintenance runner: dispatches maintenance (evidence: `crates/gitcask-server/src/ops.rs`)
- Maintenance operations → Background tasks: starts tasks
- Background tasks → Task progress: reports progress (evidence: `crates/gitcask-wal/src/tasks.rs`)
- Webhook bridge → Event stream: streams events (evidence: `README.md`)
- Webhook bridge → Platform callers: delivers webhooks (evidence: `README.md`)
