# pomber/git-history architecture

> Architecture diagram of the GitHub repository pomber/git-history, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-06-09). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/pomber/git-history
- Repository: https://github.com/pomber/git-history

## Overview

##### Project type and purpose
- This is an open-source, multi-interface “Git History” tool that lets you browse file history in any Git repo.
- It ships as:
- A Single Page Application (SPA) served on GitHistory.xyz (built with React + CRACO + Netlify)
- A command-line interface (CLI) for local repos (Node.js scripts under cli/)
- A VS Code extension (vscode-ext/)

##### File structure
- Top-level folders:
- src/ – the core library of UI components, animations, and “git-providers” modules
- public/ – static assets for the SPA
- cli/ – Node.js CLI commands and a local‐server entrypoint
- vscode-ext/ – the VS Code extension code and tests
- .storybook/ – story definitions for UI components
- Root files: craco.config.js (CRA override), netlify.toml (deploy config), travis.yml, package.json, readme.md
- Shared code lives in src/, especially src/git-providers/ which implements fetchers for GitHub/GitLab/Bitbucket/local.

##### Extract insights from the README
- The SPA fronts any Git host by rewriting URLs to github.githistory.xyz, then fetches commits via corresponding provider modules.
- The CLI and VS Code extension reuse the same provider logic to read local repositories.
- No database—data flows live from Git hosts or local repo to UI.

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "SPA Frontend (React App)"
        A1["public/index.html"]:::frontend
        A2["public/manifest.json"]:::frontend
        A3["src/index.js"]:::frontend
        A4["src/app.js"]:::frontend
        A5["craco.config.js"]:::frontend
        A6["netlify.toml"]:::frontend
    end

    subgraph "CLI Tool"
        B1["cli/cli.js"]:::frontend
        B2["cli/git.js"]:::frontend
        B3["cli/server.js"]:::frontend
        B4["cli/package.json"]:::frontend
    end

    subgraph "VS Code Extension"
        C1["vscode-ext/extension.js"]:::frontend
        C2["vscode-ext/git.js"]:::frontend
        C3["vscode-ext/package.json"]:::frontend
        C4["vscode-ext/test/extension.test.js"]:::frontend
    end

    subgraph "Core Library - UI Components"
        D1["src/airframe/"]:::core
        D2["src/animation.js"]:::core
        D3["src/comment-box.css"]:::core
        D4["src/scroller.js"]:::core
        D5["src/slide.js"]:::core
        D6["src/use-spring.js"]:::core
        D7["src/history.js"]:::core
        D8["src/index.js"]:::core
        D9["src/utils.js"]:::core
    end

    subgraph "Core Library - Git-Providers"
        E1["src/git-providers/providers.js"]:::core
        E2["src/git-providers/sources.js"]:::core
        E3["src/git-providers/github-provider.js"]:::core
        E4["src/git-providers/gitlab-provider.js"]:::core
        E5["src/git-providers/bitbucket-provider.js"]:::core
        E6["src/git-providers/cli-provider.js"]:::core
        E7["src/git-providers/vscode-provider.js"]:::core
        E8["src/git-providers/github-commit-fetcher.js"]:::core
        E9["src/git-providers/gitlab-commit-fetcher.js"]:::core
        E10["src/git-providers/bitbucket-commit-fetcher.js"]:::core
        E11["src/git-providers/cli-commit-fetcher.js"]:::core
        E12["src/git-providers/differ.js"]:::core
        E13["src/git-providers/tokenizer.js"]:::core
        E14["src/git-providers/versioner.js"]:::core
        E15["src/git-providers/versioner.worker.js"]:::core
    end

    subgraph "External Git Services"
        GH["GitHub API"]:::external
        GL["GitLab API"]:::external
        BB["Bitbucket API"]:::external
        LFS["Local Git Repository"]:::external
    end

    subgraph "Build & Deployment"
        F1["craco.config.js"]:::deploy
        F2["netlify.toml"]:::deploy
        F3[".travis.yml"]:::deploy
        F4["package.json"]:::deploy
        G1["Storybook (.storybook/)"]:::deploy
    end

    %% Client to Core connections
    A3 -->|"imports"| D8
    A4 -->|"renders UI"| D2
    B1 -->|"uses"| D8
    C1 -->|"uses"| D8

    %% Core UI to Providers
    D8 -->|"loads providers"| E1

    %% Providers to Backends
    E1 -->|"HTTP API"| GH
    E1 -->|"HTTP API"| GL
    E1 -->|"HTTP API"| BB
    E6 -->|"spawn git process"| LFS
    E7 -->|"spawn git process"| LFS

    %% Build & Deploy flows
    F1 -->|"build pipeline"| A1
    F1 -->|"configure CRA"| A3
    F2 -->|"deploy assets"| A1
    F3 -->|"CI triggers"| F1
    F3 -->|"CI tests"| G1
    G1 -->|"docs read"| D1

    %% Click Events for SPA
    click A1 "https://github.com/pomber/git-history/blob/master/public/index.html"
    click A2 "https://github.com/pomber/git-history/blob/master/public/manifest.json"
    click A3 "https://github.com/pomber/git-history/blob/master/src/index.js"
    click A4 "https://github.com/pomber/git-history/blob/master/src/app.js"
    click A5 "https://github.com/pomber/git-history/blob/master/craco.config.js"
    click A6 "https://github.com/pomber/git-history/blob/master/netlify.toml"

    %% Click Events for CLI
    click B1 "https://github.com/pomber/git-history/blob/master/cli/cli.js"
    click B2 "https://github.com/pomber/git-history/blob/master/cli/git.js"
    click B3 "https://github.com/pomber/git-history/blob/master/cli/server.js"
    click B4 "https://github.com/pomber/git-history/blob/master/cli/package.json"

    %% Click Events for VS Code Extension
    click C1 "https://github.com/pomber/git-history/blob/master/vscode-ext/extension.js"
    click C2 "https://github.com/pomber/git-history/blob/master/vscode-ext/git.js"
    click C3 "https://github.com/pomber/git-history/blob/master/vscode-ext/package.json"
    click C4 "https://github.com/pomber/git-history/blob/master/vscode-ext/test/extension.test.js"

    %% Click Events for Core UI
    click D1 "https://github.com/pomber/git-history/tree/master/src/airframe/"
    click D2 "https://github.com/pomber/git-history/blob/master/src/animation.js"
    click D3 "https://github.com/pomber/git-history/blob/master/src/comment-box.css"
    click D4 "https://github.com/pomber/git-history/blob/master/src/scroller.js"
    click D5 "https://github.com/pomber/git-history/blob/master/src/slide.js"
    click D6 "https://github.com/pomber/git-history/blob/master/src/use-spring.js"
    click D7 "https://github.com/pomber/git-history/blob/master/src/history.js"
    click D8 "https://github.com/pomber/git-history/blob/master/src/index.js"
    click D9 "https://github.com/pomber/git-history/blob/master/src/utils.js"

    %% Click Events for Git-Providers
    click E1 "https://github.com/pomber/git-history/blob/master/src/git-providers/providers.js"
    click E2 "https://github.com/pomber/git-history/blob/master/src/git-providers/sources.js"
    click E3 "https://github.com/pomber/git-history/blob/master/src/git-providers/github-provider.js"
    click E4 "https://github.com/pomber/git-history/blob/master/src/git-providers/gitlab-provider.js"
    click E5 "https://github.com/pomber/git-history/blob/master/src/git-providers/bitbucket-provider.js"
    click E6 "https://github.com/pomber/git-history/blob/master/src/git-providers/cli-provider.js"
    click E7 "https://github.com/pomber/git-history/blob/master/src/git-providers/vscode-provider.js"
    click E8 "https://github.com/pomber/git-history/blob/master/src/git-providers/github-commit-fetcher.js"
    click E9 "https://github.com/pomber/git-history/blob/master/src/git-providers/gitlab-commit-fetcher.js"
    click E10 "https://github.com/pomber/git-history/blob/master/src/git-providers/bitbucket-commit-fetcher.js"
    click E11 "https://github.com/pomber/git-history/blob/master/src/git-providers/cli-commit-fetcher.js"
    click E12 "https://github.com/pomber/git-history/blob/master/src/git-providers/differ.js"
    click E13 "https://github.com/pomber/git-history/blob/master/src/git-providers/tokenizer.js"
    click E14 "https://github.com/pomber/git-history/blob/master/src/git-providers/versioner.js"
    click E15 "https://github.com/pomber/git-history/blob/master/src/git-providers/versioner.worker.js"

    %% Click Events for Build & Deployment
    click F1 "https://github.com/pomber/git-history/blob/master/craco.config.js"
    click F2 "https://github.com/pomber/git-history/blob/master/netlify.toml"
    click F3 "https://github.com/pomber/git-history/blob/master/.travis.yml"
    click F4 "https://github.com/pomber/git-history/blob/master/package.json"
    click G1 "https://github.com/pomber/git-history/blob/master/.storybook/config.js"

    classDef frontend fill:#D0E8FF,stroke:#0366d6,color:#0366d6
    classDef core fill:#E6FFED,stroke:#28a745,color:#28a745
    classDef external fill:#FFF5E6,stroke:#D69D00,color:#D69D00
    classDef deploy fill:#E1E4E8,stroke:#6a737d,color:#6a737d
```
