# automationxperts/mediagit architecture

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

- Interactive diagram: https://gitdiagram.com/automationxperts/mediagit
- Repository: https://github.com/automationxperts/mediagit

## Overview

Mediagit is a local-only browser extension that scans media links rendered in a supported repository folder and presents them in a dedicated gallery. The user opens the toolbar popup, starts a one-time scan, and views the resulting snapshot in the gallery; settings customize the gallery and can restore it on return. Provider parsers handle GitHub, GitLab, Bitbucket, and Gitea, with shared media validation. Gallery interactions and snapshot-storage wiring are documented but the gallery and popup implementations were not excerpted, so those connections cite the README; no API or server is involved.

Main entry points: [`src/gallery/index.ts`](https://github.com/automationxperts/mediagit/blob/main/src/gallery/index.ts) (Media gallery), [`src/providers/index.ts`](https://github.com/automationxperts/mediagit/blob/main/src/providers/index.ts) (Provider dispatch), [`src/settings/index.ts`](https://github.com/automationxperts/mediagit/blob/main/src/settings/index.ts) (Settings page), [`src/shared/media.ts`](https://github.com/automationxperts/mediagit/blob/main/src/shared/media.ts) (Media validation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_scan["Scan and providers"]
  node_popup["Toolbar popup<br/>[index.ts]"]
  node_scanner["Page scanner<br/>[scan.ts]"]
  node_dispatch["Provider dispatch<br/>[index.ts]"]
  node_github["GitHub parser<br/>[github.ts]"]
  node_gitlab["GitLab parser<br/>[gitlab.ts]"]
  node_bitbucket["Bitbucket parser<br/>[bitbucket.ts]"]
  node_gitea["Gitea parser<br/>[gitea.ts]"]
end

subgraph group_gallery["Gallery experience"]
  node_gallery["Media gallery<br/>[index.ts]"]
  node_session[("Session snapshots")]
end

subgraph group_preferences["Preferences and branding"]
  node_settingsui["Settings page<br/>[index.ts]"]
  node_preferencesdata["Preference storage<br/>[settings.ts]"]
  node_branding["Project branding<br/>[branding.ts]"]
end

subgraph group_shared["Shared logic"]
  node_pagination["Page windows<br/>[pagination.ts]"]
  node_slideshow["Slideshow navigation<br/>[slideshow.ts]"]
  node_media["Media validation<br/>[media.ts]"]
end

node_user(("User"))

node_user -->|"opens"| node_popup
node_popup -->|"injects scan"| node_scanner
node_scanner -->|"parses page"| node_dispatch
node_dispatch -->|"routes to"| node_github
node_dispatch -->|"routes to"| node_gitlab
node_dispatch -->|"routes to"| node_bitbucket
node_dispatch -->|"routes to"| node_gitea
node_github -->|"creates entries"| node_media
node_gitlab -->|"creates entries"| node_media
node_bitbucket -->|"creates entries"| node_media
node_gitea -->|"creates entries"| node_media
node_scanner -->|"stores snapshot"| node_session
node_popup -->|"opens tab"| node_gallery
node_session -->|"loads snapshot"| node_gallery
node_user -->|"views media"| node_gallery
node_gallery -->|"calculates pages"| node_pagination
node_gallery -->|"navigates slides"| node_slideshow
node_user -->|"opens settings"| node_settingsui
node_settingsui -->|"reads and writes"| node_preferencesdata
node_settingsui -->|"renders branding"| node_branding
node_settingsui -->|"returns to gallery"| node_gallery
node_gallery -->|"uses preferences"| node_preferencesdata

click node_popup "https://github.com/automationxperts/mediagit/blob/main/src/popup/index.ts"
click node_scanner "https://github.com/automationxperts/mediagit/blob/main/src/content/scan.ts"
click node_dispatch "https://github.com/automationxperts/mediagit/blob/main/src/providers/index.ts"
click node_github "https://github.com/automationxperts/mediagit/blob/main/src/providers/github.ts"
click node_gitlab "https://github.com/automationxperts/mediagit/blob/main/src/providers/gitlab.ts"
click node_bitbucket "https://github.com/automationxperts/mediagit/blob/main/src/providers/bitbucket.ts"
click node_gitea "https://github.com/automationxperts/mediagit/blob/main/src/providers/gitea.ts"
click node_gallery "https://github.com/automationxperts/mediagit/blob/main/src/gallery/index.ts"
click node_pagination "https://github.com/automationxperts/mediagit/blob/main/src/shared/pagination.ts"
click node_slideshow "https://github.com/automationxperts/mediagit/blob/main/src/shared/slideshow.ts"
click node_media "https://github.com/automationxperts/mediagit/blob/main/src/shared/media.ts"
click node_settingsui "https://github.com/automationxperts/mediagit/blob/main/src/settings/index.ts"
click node_preferencesdata "https://github.com/automationxperts/mediagit/blob/main/src/shared/settings.ts"
click node_branding "https://github.com/automationxperts/mediagit/blob/main/src/shared/branding.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_scanner,node_dispatch,node_github,node_gitlab,node_bitbucket,node_gitea,node_user toneBlue
class node_gallery,node_session toneAmber
class node_settingsui,node_preferencesdata,node_branding toneMint
class node_pagination,node_slideshow,node_media toneRose
```

## Components

### Scan and providers

- [Toolbar popup](https://github.com/automationxperts/mediagit/blob/main/src/popup/index.ts): `src/popup/index.ts`
- [Page scanner](https://github.com/automationxperts/mediagit/blob/main/src/content/scan.ts): `src/content/scan.ts`
- [Provider dispatch](https://github.com/automationxperts/mediagit/blob/main/src/providers/index.ts): `src/providers/index.ts`
- [GitHub parser](https://github.com/automationxperts/mediagit/blob/main/src/providers/github.ts): `src/providers/github.ts`
- [GitLab parser](https://github.com/automationxperts/mediagit/blob/main/src/providers/gitlab.ts): `src/providers/gitlab.ts`
- [Bitbucket parser](https://github.com/automationxperts/mediagit/blob/main/src/providers/bitbucket.ts): `src/providers/bitbucket.ts`
- [Gitea parser](https://github.com/automationxperts/mediagit/blob/main/src/providers/gitea.ts): `src/providers/gitea.ts`

### Gallery experience

- [Media gallery](https://github.com/automationxperts/mediagit/blob/main/src/gallery/index.ts): `src/gallery/index.ts`
- **Session snapshots**

### Preferences and branding

- [Settings page](https://github.com/automationxperts/mediagit/blob/main/src/settings/index.ts): `src/settings/index.ts`
- [Preference storage](https://github.com/automationxperts/mediagit/blob/main/src/shared/settings.ts): `src/shared/settings.ts`
- [Project branding](https://github.com/automationxperts/mediagit/blob/main/src/shared/branding.ts): `src/shared/branding.ts`

### Shared logic

- [Page windows](https://github.com/automationxperts/mediagit/blob/main/src/shared/pagination.ts): `src/shared/pagination.ts`
- [Slideshow navigation](https://github.com/automationxperts/mediagit/blob/main/src/shared/slideshow.ts): `src/shared/slideshow.ts`
- [Media validation](https://github.com/automationxperts/mediagit/blob/main/src/shared/media.ts): `src/shared/media.ts`

### Other components

- **User**

## Connections

- User → Toolbar popup: opens (evidence: `README.md`)
- Toolbar popup → Page scanner: injects scan (evidence: `README.md`)
- Page scanner → Provider dispatch: parses page (evidence: `src/content/scan.ts`)
- Provider dispatch → GitHub parser: routes to (evidence: `src/providers/index.ts`)
- Provider dispatch → GitLab parser: routes to (evidence: `src/providers/index.ts`)
- Provider dispatch → Bitbucket parser: routes to (evidence: `src/providers/index.ts`)
- Provider dispatch → Gitea parser: routes to (evidence: `src/providers/index.ts`)
- GitHub parser → Media validation: creates entries (evidence: `src/providers/github.ts`)
- GitLab parser → Media validation: creates entries (evidence: `src/providers/gitlab.ts`)
- Bitbucket parser → Media validation: creates entries (evidence: `src/providers/bitbucket.ts`)
- Gitea parser → Media validation: creates entries
- Page scanner → Session snapshots: stores snapshot (evidence: `README.md`)
- Toolbar popup → Media gallery: opens tab (evidence: `README.md`)
- Session snapshots → Media gallery: loads snapshot (evidence: `README.md`)
- User → Media gallery: views media (evidence: `README.md`)
- Media gallery → Page windows: calculates pages (evidence: `README.md`)
- Media gallery → Slideshow navigation: navigates slides (evidence: `README.md`)
- User → Settings page: opens settings (evidence: `README.md`)
- Settings page → Preference storage: reads and writes (evidence: `src/settings/index.ts`)
- Settings page → Project branding: renders branding (evidence: `src/settings/index.ts`)
- Settings page → Media gallery: returns to gallery (evidence: `README.md`)
- Media gallery → Preference storage: uses preferences (evidence: `README.md`)
