# tuturuleo/moxxy architecture

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

- Interactive diagram: https://gitdiagram.com/tuturuleo/moxxy
- Repository: https://github.com/tuturuleo/moxxy

## Overview

Moxxy is a Chrome extension for browsing open tab groups and bookmarks as rich cards. The main workflow loads Chrome sources into the app, parses page metadata and preset-defined fields, caches card data, and renders cards that support navigation, organization, duplicate handling, and downloaded marks. Settings and the card constructor configure parsing and presentation; the picker supports selecting page elements for presets. The source excerpts show only part of the runtime, so edges for documented but unsampled features cite the README, and uncertain wiring is omitted.

Main entry points: [`src/app/App.tsx`](https://github.com/tuturuleo/moxxy/blob/main/src/app/App.tsx) (App workflow), [`src/lib/parser.ts`](https://github.com/tuturuleo/moxxy/blob/main/src/lib/parser.ts) (Page parser), [`src/app/components/SettingsModal.tsx`](https://github.com/tuturuleo/moxxy/blob/main/src/app/components/SettingsModal.tsx) (Settings interface), [`src/app/components/Card.tsx`](https://github.com/tuturuleo/moxxy/blob/main/src/app/components/Card.tsx) (Card display)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Card browsing"]
  node_app["App workflow<br/>[App.tsx]"]
  node_card["Card display<br/>[Card.tsx]"]
  node_lightbox["Image lightbox<br/>[Lightbox.tsx]"]
  node_sidebar["Collection sidebar<br/>[Sidebar.tsx]"]
  node_layout["Card layout rules<br/>[layout.ts]"]
end

subgraph group_collection["Sources and organization"]
  node_sources["Tab and bookmark sources<br/>[sources.ts]"]
  node_bookmarks["Bookmark operations<br/>[bookmarks.ts]"]
  node_duplicates["Duplicate grouping<br/>[dupes.ts]"]
end

subgraph group_parsing["Parsing and persistence"]
  node_queue["Parse queue<br/>[queue.ts]"]
  node_parser["Page parser<br/>[parser.ts]"]
  node_extract["Metadata extraction<br/>[extract.ts]"]
  node_presets["Preset matching<br/>[presets.ts]"]
  node_carddb[("Card data store<br/>[db.ts]")]
  node_imagecache[("Image cache<br/>[imagecache.ts]")]
end

subgraph group_configuration["Configuration and updates"]
  node_constructor["Card constructor<br/>[Constructor.tsx]"]
  node_picker["Element picker<br/>[picker.ts]"]
  node_settingsui["Settings interface<br/>[SettingsModal.tsx]"]
  node_settings[("Settings storage<br/>[settings.ts]")]
  node_updates["Release checker<br/>[updates.ts]"]
end

node_user(("Extension user"))
node_chrome["Chrome APIs"]
node_webpages["Site pages"]
node_github["GitHub releases"]

node_user -->|"opens"| node_app
node_app -->|"loads and edits"| node_sources
node_sources -->|"queries tabs"| node_chrome
node_sources -->|"reads tree"| node_bookmarks
node_app -->|"enqueues parsing"| node_queue
node_queue -->|"dispatches jobs"| node_parser
node_app -->|"parses pages"| node_parser
node_parser -->|"extracts fields"| node_extract
node_parser -->|"matches preset"| node_presets
node_parser -->|"fetches page"| node_webpages
node_parser -->|"opens requested tab"| node_chrome
node_app -->|"stores card data"| node_carddb
node_imagecache -->|"uses IndexedDB"| node_carddb
node_app -->|"loads and saves"| node_settings
node_app -->|"groups duplicates"| node_duplicates
node_app -->|"renders cards"| node_card
node_card -->|"builds layout"| node_layout
node_card -->|"loads thumbnails"| node_imagecache
node_card -->|"opens gallery"| node_lightbox
node_app -->|"renders collections"| node_sidebar
node_sidebar -->|"shows source groups"| node_sources
node_sidebar -->|"shows duplicate view"| node_duplicates
node_user -->|"configures"| node_settingsui
node_settingsui -->|"opens constructor"| node_constructor
node_constructor -->|"tests preset"| node_parser
node_constructor -->|"previews card"| node_card
node_picker -.->|"saves preset"| node_settingsui
node_settingsui -->|"updates preferences"| node_settings
node_settingsui -->|"clears cache"| node_imagecache
node_settingsui -->|"checks releases"| node_updates
node_updates -->|"checks latest release"| node_github
node_user -->|"organizes items"| node_sources

click node_app "https://github.com/tuturuleo/moxxy/blob/main/src/app/App.tsx"
click node_card "https://github.com/tuturuleo/moxxy/blob/main/src/app/components/Card.tsx"
click node_lightbox "https://github.com/tuturuleo/moxxy/blob/main/src/app/components/Lightbox.tsx"
click node_sidebar "https://github.com/tuturuleo/moxxy/blob/main/src/app/components/Sidebar.tsx"
click node_sources "https://github.com/tuturuleo/moxxy/blob/main/src/lib/sources.ts"
click node_bookmarks "https://github.com/tuturuleo/moxxy/blob/main/src/lib/bookmarks.ts"
click node_duplicates "https://github.com/tuturuleo/moxxy/blob/main/src/lib/dupes.ts"
click node_queue "https://github.com/tuturuleo/moxxy/blob/main/src/lib/queue.ts"
click node_parser "https://github.com/tuturuleo/moxxy/blob/main/src/lib/parser.ts"
click node_extract "https://github.com/tuturuleo/moxxy/blob/main/src/lib/extract.ts"
click node_presets "https://github.com/tuturuleo/moxxy/blob/main/src/lib/presets.ts"
click node_carddb "https://github.com/tuturuleo/moxxy/blob/main/src/lib/db.ts"
click node_imagecache "https://github.com/tuturuleo/moxxy/blob/main/src/lib/imagecache.ts"
click node_constructor "https://github.com/tuturuleo/moxxy/blob/main/src/app/components/Constructor.tsx"
click node_picker "https://github.com/tuturuleo/moxxy/blob/main/src/picker/picker.ts"
click node_settingsui "https://github.com/tuturuleo/moxxy/blob/main/src/app/components/SettingsModal.tsx"
click node_settings "https://github.com/tuturuleo/moxxy/blob/main/src/lib/settings.ts"
click node_updates "https://github.com/tuturuleo/moxxy/blob/main/src/lib/updates.ts"
click node_layout "https://github.com/tuturuleo/moxxy/blob/main/src/lib/layout.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_app,node_card,node_lightbox,node_sidebar,node_layout,node_user toneBlue
class node_sources,node_bookmarks,node_duplicates toneAmber
class node_queue,node_parser,node_extract,node_presets,node_carddb,node_imagecache,node_chrome toneMint
class node_constructor,node_picker,node_settingsui,node_settings,node_updates toneRose
class node_webpages,node_github toneIndigo
```

## Components

### Card browsing

- [App workflow](https://github.com/tuturuleo/moxxy/blob/main/src/app/App.tsx): `src/app/App.tsx`
- [Card display](https://github.com/tuturuleo/moxxy/blob/main/src/app/components/Card.tsx): `src/app/components/Card.tsx`
- [Image lightbox](https://github.com/tuturuleo/moxxy/blob/main/src/app/components/Lightbox.tsx): `src/app/components/Lightbox.tsx`
- [Collection sidebar](https://github.com/tuturuleo/moxxy/blob/main/src/app/components/Sidebar.tsx): `src/app/components/Sidebar.tsx`
- [Card layout rules](https://github.com/tuturuleo/moxxy/blob/main/src/lib/layout.ts): `src/lib/layout.ts`

### Sources and organization

- [Tab and bookmark sources](https://github.com/tuturuleo/moxxy/blob/main/src/lib/sources.ts): `src/lib/sources.ts`
- [Bookmark operations](https://github.com/tuturuleo/moxxy/blob/main/src/lib/bookmarks.ts): `src/lib/bookmarks.ts`
- [Duplicate grouping](https://github.com/tuturuleo/moxxy/blob/main/src/lib/dupes.ts): `src/lib/dupes.ts`

### Parsing and persistence

- [Parse queue](https://github.com/tuturuleo/moxxy/blob/main/src/lib/queue.ts): `src/lib/queue.ts`
- [Page parser](https://github.com/tuturuleo/moxxy/blob/main/src/lib/parser.ts): `src/lib/parser.ts`
- [Metadata extraction](https://github.com/tuturuleo/moxxy/blob/main/src/lib/extract.ts): `src/lib/extract.ts`
- [Preset matching](https://github.com/tuturuleo/moxxy/blob/main/src/lib/presets.ts): `src/lib/presets.ts`
- [Card data store](https://github.com/tuturuleo/moxxy/blob/main/src/lib/db.ts): `src/lib/db.ts`
- [Image cache](https://github.com/tuturuleo/moxxy/blob/main/src/lib/imagecache.ts): `src/lib/imagecache.ts`

### Configuration and updates

- [Card constructor](https://github.com/tuturuleo/moxxy/blob/main/src/app/components/Constructor.tsx): `src/app/components/Constructor.tsx`
- [Element picker](https://github.com/tuturuleo/moxxy/blob/main/src/picker/picker.ts): `src/picker/picker.ts`
- [Settings interface](https://github.com/tuturuleo/moxxy/blob/main/src/app/components/SettingsModal.tsx): `src/app/components/SettingsModal.tsx`
- [Settings storage](https://github.com/tuturuleo/moxxy/blob/main/src/lib/settings.ts): `src/lib/settings.ts`
- [Release checker](https://github.com/tuturuleo/moxxy/blob/main/src/lib/updates.ts): `src/lib/updates.ts`

### Other components

- **Extension user**
- **Chrome APIs**
- **Site pages**
- **GitHub releases**

## Connections

- Extension user → App workflow: opens (evidence: `README.md`)
- App workflow → Tab and bookmark sources: loads and edits (evidence: `src/app/App.tsx`)
- Tab and bookmark sources → Chrome APIs: queries tabs (evidence: `src/lib/sources.ts`)
- Tab and bookmark sources → Bookmark operations: reads tree (evidence: `src/lib/sources.ts`)
- App workflow → Parse queue: enqueues parsing (evidence: `src/app/App.tsx`)
- Parse queue → Page parser: dispatches jobs (evidence: `README.md`)
- App workflow → Page parser: parses pages (evidence: `src/app/App.tsx`)
- Page parser → Metadata extraction: extracts fields (evidence: `src/lib/parser.ts`)
- Page parser → Preset matching: matches preset (evidence: `src/lib/parser.ts`)
- Page parser → Site pages: fetches page (evidence: `README.md`)
- Page parser → Chrome APIs: opens requested tab (evidence: `README.md`)
- App workflow → Card data store: stores card data (evidence: `src/app/App.tsx`)
- Image cache → Card data store: uses IndexedDB (evidence: `src/lib/imagecache.ts`)
- App workflow → Settings storage: loads and saves (evidence: `src/app/App.tsx`)
- App workflow → Duplicate grouping: groups duplicates (evidence: `src/app/App.tsx`)
- App workflow → Card display: renders cards (evidence: `README.md`)
- Card display → Card layout rules: builds layout (evidence: `src/app/components/Card.tsx`)
- Card display → Image cache: loads thumbnails (evidence: `src/app/components/Card.tsx`)
- Card display → Image lightbox: opens gallery (evidence: `README.md`)
- App workflow → Collection sidebar: renders collections (evidence: `src/app/App.tsx`)
- Collection sidebar → Tab and bookmark sources: shows source groups (evidence: `src/app/components/Sidebar.tsx`)
- Collection sidebar → Duplicate grouping: shows duplicate view (evidence: `src/app/components/Sidebar.tsx`)
- Extension user → Settings interface: configures (evidence: `README.md`)
- Settings interface → Card constructor: opens constructor (evidence: `src/app/components/SettingsModal.tsx`)
- Card constructor → Page parser: tests preset (evidence: `src/app/components/Constructor.tsx`)
- Card constructor → Card display: previews card (evidence: `src/app/components/Constructor.tsx`)
- Element picker → Settings interface: saves preset
- Settings interface → Settings storage: updates preferences (evidence: `README.md`)
- Settings interface → Image cache: clears cache (evidence: `src/app/components/SettingsModal.tsx`)
- Settings interface → Release checker: checks releases (evidence: `src/app/components/SettingsModal.tsx`)
- Release checker → GitHub releases: checks latest release (evidence: `src/lib/updates.ts`)
- Extension user → Tab and bookmark sources: organizes items (evidence: `README.md`)
