# noah20102021/giftcardreminder architecture

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

- Interactive diagram: https://gitdiagram.com/noah20102021/giftcardreminder
- Repository: https://github.com/noah20102021/giftcardreminder

## Overview

#### Purpose and Runtime
giftcardReminder is a Chromium browser extension for tracking gift-card balances, currencies, domains, and optional expiration dates. It runs entirely client-side: card data is stored in browser local storage, with no backend or external service indicated. The extension is loaded unpacked through Chrome/Edge and is defined by `manifest.json`.

#### Extension Entry Points
The manifest is the architectural dispatch point for extension pages and browser integration: `manifest.json`. The user-facing popup/listing is `index.html`, backed by `index.js`; dedicated extension pages support creation, deletion, and data administration:
- `index.html`, `index.js`
- `add.html`, `delete.html`
- `settings.html`

#### Gift Card Data Lifecycle
Users add card records through the add flow, which captures website domain, balance, currency, and expiry. Records are persisted in browser local storage and then rendered by the primary list view. Deletion is isolated into its own page/flow, while settings provides bulk data management:
- `add.html`
- `delete.html`
- `settings.html`

The storage boundary is the browser’s local storage: data remains local to the installed browser profile and is not sent to an application server. `assets/storage(no longer in use).xml` is explicitly legacy and should not be treated as the active persistence source.

#### Popup and Card Presentation
The extension’s main interaction surface is a card-based view launched from the browser toolbar. `index.html` supplies the structure, while `index.js` drives the dynamic behavior and state-backed rendering. Shared visual styling and client-side interactions are kept under assets:
- `index.html`, `index.js`
- `assets/style.css`
- `assets/script.js`

#### Site-Match Notification Flow
A core browser-integration behavior compares the currently visited site against saved gift-card domains. When a match exists, the extension displays an upper-right-page indicator; clicking it exposes the relevant card details. The manifest must connect this browser/page-context behavior to the extension’s packaged scripts and permissions:
- `manifest.json`
- `index.js`
- `assets/script.js`

#### Import, Export, and Storage Administration
The settings surface imports gift-card data by adding imported JSON records to existing local data, exports records as a JSON file, and can clear all stored cards. This is a client-only serialization/import boundary and should preserve compatibility with the locally stored card schema:
- `settings.html`
- `assets/script.js`
- `assets/style.css`

#### Packaging and Development
This is a static HTML/CSS/JavaScript extension rather than a bundled web application. `package.json` and `scripts/watcher.js` suggest optional Node-based local development/watch support, but the runtime artifact remains the extension directory loaded by Chromium. Packaged icons support browser UI identity:
- `package.json`
- `scripts/watcher.js`
- `icons`

Main entry points: [`manifest.json`](https://github.com/noah20102021/giftcardreminder/blob/master/manifest.json) (Extension manifest), [`index.html`](https://github.com/noah20102021/giftcardreminder/blob/master/index.html) (Card list popup), [`settings.html`](https://github.com/noah20102021/giftcardreminder/blob/master/settings.html) (Settings and data admin), [`assets/script.js`](https://github.com/noah20102021/giftcardreminder/blob/master/assets/script.js) (Shared interactions)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_extension["Chromium extension"]
  node_manifest["Extension manifest<br/>[manifest.json]"]
  node_browser{{"Chromium browser<br/>Browser runtime"}}
  node_site_match["Site-match indicator<br/>Page-context UI"]
  node_icons["Extension icons<br/>Packaged assets"]
end

subgraph group_ui["User surfaces"]
  node_popup["Card list popup<br/>Popup page<br/>[index.html]"]
  node_popup_logic["Popup state and rendering<br/>Client script<br/>[index.js]"]
  node_add["Add card flow<br/>Extension page<br/>[add.html]"]
  node_delete["Delete card flow<br/>Extension page<br/>[delete.html]"]
  node_settings["Settings and data admin<br/>Extension page<br/>[settings.html]"]
  node_shared_script["Shared interactions<br/>Client script<br/>[script.js]"]
  node_styles["Shared styles<br/>Stylesheet<br/>[style.css]"]
end

subgraph group_data["Local data lifecycle"]
  node_storage[("Browser local storage<br/>Persistence boundary")]
  node_json_io["JSON import/export<br/>Serialization boundary"]
end

subgraph group_dev["Development support"]
  node_package["Node development metadata<br/>Package manifest<br/>[package.json]"]
  node_watcher["Development watcher<br/>Node script<br/>[watcher.js]"]
end

node_manifest -->|"installed in"| node_browser
node_manifest -->|"declares"| node_popup
node_manifest -->|"enables"| node_site_match
node_manifest -->|"packages"| node_icons
node_browser -->|"opens from toolbar"| node_popup
node_popup -->|"runs"| node_popup_logic
node_popup -->|"uses"| node_styles
node_popup_logic -->|"reads and renders"| node_storage
node_add -->|"creates card records"| node_storage
node_delete -->|"removes card records"| node_storage
node_settings -->|"uses"| node_shared_script
node_settings -->|"uses"| node_styles
node_shared_script -->|"manages"| node_storage
node_settings -->|"offers"| node_json_io
node_json_io -->|"imports to and exports from"| node_storage
node_browser -->|"provides current site"| node_site_match
node_site_match -->|"matches saved domains"| node_storage
node_site_match -->|"shows details through"| node_shared_script
node_package -.->|"supports"| node_watcher

click node_manifest "https://github.com/noah20102021/giftcardreminder/blob/master/manifest.json"
click node_popup "https://github.com/noah20102021/giftcardreminder/blob/master/index.html"
click node_popup_logic "https://github.com/noah20102021/giftcardreminder/blob/master/index.js"
click node_add "https://github.com/noah20102021/giftcardreminder/blob/master/add.html"
click node_delete "https://github.com/noah20102021/giftcardreminder/blob/master/delete.html"
click node_settings "https://github.com/noah20102021/giftcardreminder/blob/master/settings.html"
click node_shared_script "https://github.com/noah20102021/giftcardreminder/blob/master/assets/script.js"
click node_styles "https://github.com/noah20102021/giftcardreminder/blob/master/assets/style.css"
click node_package "https://github.com/noah20102021/giftcardreminder/blob/master/package.json"
click node_watcher "https://github.com/noah20102021/giftcardreminder/blob/master/scripts/watcher.js"
click node_icons "https://github.com/noah20102021/giftcardreminder/tree/master/icons"

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_manifest,node_browser,node_site_match,node_icons toneBlue
class node_popup,node_popup_logic,node_add,node_delete,node_settings,node_shared_script,node_styles toneAmber
class node_storage,node_json_io toneMint
class node_package,node_watcher toneRose
```

## Components

### Chromium extension

Static files loaded unpacked by Chrome or Edge.

- [Extension manifest](https://github.com/noah20102021/giftcardreminder/blob/master/manifest.json): Manifest · Dispatches extension pages, scripts, permissions, and browser integration. · `manifest.json`
- **Chromium browser**: Browser runtime · Hosts the extension and provides the active-tab context.
- **Site-match indicator**: Page-context UI · Shows matching saved-card details on visited domains.
- [Extension icons](https://github.com/noah20102021/giftcardreminder/tree/master/icons): Packaged assets · Browser UI identity assets. · `icons`

### User surfaces

- [Card list popup](https://github.com/noah20102021/giftcardreminder/blob/master/index.html): Popup page · Primary toolbar-launched card view. · `index.html`
- [Popup state and rendering](https://github.com/noah20102021/giftcardreminder/blob/master/index.js): Client script · Renders stored cards and drives popup behavior. · `index.js`
- [Add card flow](https://github.com/noah20102021/giftcardreminder/blob/master/add.html): Extension page · Captures domain, balance, currency, and expiry. · `add.html`
- [Delete card flow](https://github.com/noah20102021/giftcardreminder/blob/master/delete.html): Extension page · Isolated card removal workflow. · `delete.html`
- [Settings and data admin](https://github.com/noah20102021/giftcardreminder/blob/master/settings.html): Extension page · Imports, exports, and clears card data. · `settings.html`
- [Shared interactions](https://github.com/noah20102021/giftcardreminder/blob/master/assets/script.js): Client script · Supports page behavior and site-match indicator interactions. · `assets/script.js`
- [Shared styles](https://github.com/noah20102021/giftcardreminder/blob/master/assets/style.css): Stylesheet · `assets/style.css`

### Local data lifecycle

- **Browser local storage**: Persistence boundary · Stores gift-card records only in the local browser profile.
- **JSON import/export**: Serialization boundary · Merges imported records and exports the local card schema.

### Development support

- [Node development metadata](https://github.com/noah20102021/giftcardreminder/blob/master/package.json): Package manifest · Optional local development/watch support. · `package.json`
- [Development watcher](https://github.com/noah20102021/giftcardreminder/blob/master/scripts/watcher.js): Node script · `scripts/watcher.js`

## Connections

- Extension manifest → Chromium browser: installed in
- Extension manifest → Card list popup: declares
- Extension manifest → Site-match indicator: enables · Connects packaged scripts and permissions to page-context behavior.
- Extension manifest → Extension icons: packages
- Chromium browser → Card list popup: opens from toolbar
- Card list popup → Popup state and rendering: runs
- Card list popup → Shared styles: uses
- Popup state and rendering → Browser local storage: reads and renders
- Add card flow → Browser local storage: creates card records
- Delete card flow → Browser local storage: removes card records
- Settings and data admin → Shared interactions: uses
- Settings and data admin → Shared styles: uses
- Shared interactions → Browser local storage: manages
- Settings and data admin → JSON import/export: offers
- JSON import/export → Browser local storage: imports to and exports from
- Chromium browser → Site-match indicator: provides current site
- Site-match indicator → Browser local storage: matches saved domains
- Site-match indicator → Shared interactions: shows details through
- Node development metadata → Development watcher: supports
