# coderamp-labs/gitingest-extension architecture

> Architecture diagram of the GitHub repository coderamp-labs/gitingest-extension, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-29). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/coderamp-labs/gitingest-extension
- Repository: https://github.com/coderamp-labs/gitingest-extension

## Overview

GitIngest Extension adds a repository-page action to GitHub that sends the repository to a GitIngest service for prompt-friendly codebase ingestion. Users can configure the service URL and whether the result opens in a new window; the content script keeps the action in sync with GitHub’s changing page. The README also describes the service’s extract format and file, size, and token statistics; service-side processing is outside this repository. Wiring is based on the sampled entrypoints, so unsampled service internals are not represented.

Main entry points: [`entrypoints/content/git-ingest-button.ts`](https://github.com/coderamp-labs/gitingest-extension/blob/main/entrypoints/content/git-ingest-button.ts) (Ingest button), [`entrypoints/content/index.ts`](https://github.com/coderamp-labs/gitingest-extension/blob/main/entrypoints/content/index.ts) (Content script), [`entrypoints/popup/App.tsx`](https://github.com/coderamp-labs/gitingest-extension/blob/main/entrypoints/popup/App.tsx) (Settings popup), [`entrypoints/content/page-observer.ts`](https://github.com/coderamp-labs/gitingest-extension/blob/main/entrypoints/content/page-observer.ts) (Page observer)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_settings["Extension settings"]
  node_popup["Settings popup<br/>[App.tsx]"]
  node_storage[("Sync settings storage")]
end

subgraph group_github["GitHub integration"]
  node_github_page["GitHub repository page"]
  node_content["Content script<br/>[index.ts]"]
  node_observer["Page observer<br/>[page-observer.ts]"]
  node_button["Ingest button"]
end

subgraph group_ingest["Ingest destination"]
  node_service["GitIngest service"]
end

node_user(("User"))

node_user -->|"opens"| node_popup
node_popup -->|"reads settings"| node_storage
node_popup -->|"saves settings"| node_storage
node_user -->|"visits repository"| node_github_page
node_github_page -->|"runs on match"| node_content
node_content -->|"registers callback"| node_observer
node_observer -->|"notifies changes"| node_content
node_content -->|"creates and inserts"| node_button
node_button -->|"reads preferences"| node_storage
node_storage -->|"notifies URL changes"| node_button
node_user -->|"clicks link"| node_button
node_button -->|"navigates to repository ingest"| node_service

click node_popup "https://github.com/coderamp-labs/gitingest-extension/blob/main/entrypoints/popup/App.tsx"
click node_content "https://github.com/coderamp-labs/gitingest-extension/blob/main/entrypoints/content/index.ts"
click node_observer "https://github.com/coderamp-labs/gitingest-extension/blob/main/entrypoints/content/page-observer.ts"
click node_button "https://github.com/coderamp-labs/gitingest-extension/blob/main/entrypoints/content/git-ingest-button.ts"

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_popup,node_storage,node_user toneBlue
class node_github_page,node_content,node_observer,node_button toneAmber
class node_service toneMint
```

## Components

### Extension settings

- [Settings popup](https://github.com/coderamp-labs/gitingest-extension/blob/main/entrypoints/popup/App.tsx): `entrypoints/popup/App.tsx`
- **Sync settings storage**

### GitHub integration

- **GitHub repository page**
- [Content script](https://github.com/coderamp-labs/gitingest-extension/blob/main/entrypoints/content/index.ts): `entrypoints/content/index.ts`
- [Page observer](https://github.com/coderamp-labs/gitingest-extension/blob/main/entrypoints/content/page-observer.ts): `entrypoints/content/page-observer.ts`
- [Ingest button](https://github.com/coderamp-labs/gitingest-extension/blob/main/entrypoints/content/git-ingest-button.ts): `entrypoints/content/git-ingest-button.ts`

### Ingest destination

- **GitIngest service**

### Other components

- **User**

## Connections

- User → Settings popup: opens
- Settings popup → Sync settings storage: reads settings
- Settings popup → Sync settings storage: saves settings
- User → GitHub repository page: visits repository
- GitHub repository page → Content script: runs on match
- Content script → Page observer: registers callback
- Page observer → Content script: notifies changes
- Content script → Ingest button: creates and inserts
- Ingest button → Sync settings storage: reads preferences
- Sync settings storage → Ingest button: notifies URL changes
- User → Ingest button: clicks link
- Ingest button → GitIngest service: navigates to repository ingest
