# divyavadapalli/nitestays-divs-tej architecture

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

- Interactive diagram: https://gitdiagram.com/divyavadapalli/nitestays-divs-tej
- Repository: https://github.com/divyavadapalli/nitestays-divs-tej

## Overview

This Chrome extension collects hotel details from Google Hotels, presents and manages the results in an in-page panel, and supports single-hotel and sheet-driven batch workflows. Collection covers overview, prices, reviews, and photos; results can be normalized to USD, stored locally, and exported or sent to Supabase. The excerpts show the principal orchestration and selected module responsibilities; major panel features are visible, but some runtime wiring and integrations are only partially sampled, so uncertain links are omitted.

Main entry points: [`content/content-script.js`](https://github.com/divyavadapalli/nitestays-divs-tej/blob/main/content/content-script.js) (Collection controller), [`content/collector.js`](https://github.com/divyavadapalli/nitestays-divs-tej/blob/main/content/collector.js) (Collection workflow), [`background/service-worker.js`](https://github.com/divyavadapalli/nitestays-divs-tej/blob/main/background/service-worker.js) (Background service worker), [`content/panel.js`](https://github.com/divyavadapalli/nitestays-divs-tej/blob/main/content/panel.js) (In-page panel)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Extension interface"]
  node_popup["Popup controls<br/>[popup.js]"]
  node_panel["In-page panel<br/>[panel.js]"]
end

subgraph group_collection["Hotel collection"]
  node_controller["Collection controller<br/>[content-script.js]"]
  node_batch["Sheet batch matching<br/>[batch.js]"]
  node_collector["Collection workflow<br/>[collector.js]"]
  node_page["Page readiness<br/>[page.js]"]
  node_extractors["Hotel data extractors<br/>[extractors.js]"]
  node_utils["DOM and wait utilities<br/>[utils.js]"]
end

subgraph group_processing["Result processing"]
  node_currency["USD normalization<br/>[currency.js]"]
  node_export["Export formatting<br/>[export.js]"]
end

subgraph group_persistence["Storage and export"]
  node_local[("Extension local storage<br/>[content-script.js]")]
end

subgraph group_integrations["External services"]
  node_service["Background service worker<br/>[service-worker.js]"]
  node_frankfurter["Frankfurter rates"]
  node_supabase[("Supabase")]
  node_sheets["Google Sheets"]
end

node_user(("User"))
node_hotels["Google Hotels page"]

node_user -->|"opens"| node_popup
node_popup -->|"sends commands"| node_controller
node_user -->|"operates"| node_panel
node_panel -->|"invokes actions"| node_controller
node_controller -->|"updates state"| node_panel
node_controller -->|"starts collection"| node_collector
node_controller -->|"matches sheet rows"| node_batch
node_collector -->|"checks and opens tabs"| node_page
node_collector -->|"extracts sections"| node_extractors
node_collector -->|"waits and scrolls"| node_utils
node_page -.->|"uses helpers"| node_utils
node_extractors -.->|"uses helpers"| node_utils
node_hotels -.->|"provides page data"| node_collector
node_controller -->|"reads and writes"| node_local
node_controller -.->|"normalizes results"| node_currency
node_currency -.->|"requests rates"| node_service
node_service -->|"fetches rates"| node_frankfurter
node_controller -.->|"formats results"| node_export
node_controller -.->|"sends integrations"| node_service
node_service -->|"calls RPCs"| node_supabase
node_service -->|"reads sheet data"| node_sheets

click node_popup "https://github.com/divyavadapalli/nitestays-divs-tej/blob/main/popup/popup.js"
click node_panel "https://github.com/divyavadapalli/nitestays-divs-tej/blob/main/content/panel.js"
click node_controller "https://github.com/divyavadapalli/nitestays-divs-tej/blob/main/content/content-script.js"
click node_batch "https://github.com/divyavadapalli/nitestays-divs-tej/blob/main/content/batch.js"
click node_collector "https://github.com/divyavadapalli/nitestays-divs-tej/blob/main/content/collector.js"
click node_page "https://github.com/divyavadapalli/nitestays-divs-tej/blob/main/content/page.js"
click node_extractors "https://github.com/divyavadapalli/nitestays-divs-tej/blob/main/content/extractors.js"
click node_utils "https://github.com/divyavadapalli/nitestays-divs-tej/blob/main/content/utils.js"
click node_currency "https://github.com/divyavadapalli/nitestays-divs-tej/blob/main/content/currency.js"
click node_export "https://github.com/divyavadapalli/nitestays-divs-tej/blob/main/content/export.js"
click node_local "https://github.com/divyavadapalli/nitestays-divs-tej/blob/main/content/content-script.js"
click node_service "https://github.com/divyavadapalli/nitestays-divs-tej/blob/main/background/service-worker.js"

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_panel,node_user toneBlue
class node_controller,node_batch,node_collector,node_page,node_extractors,node_utils toneAmber
class node_currency,node_export toneMint
class node_local toneRose
class node_service,node_frankfurter,node_supabase,node_sheets,node_hotels toneIndigo
```

## Components

### Extension interface

- [Popup controls](https://github.com/divyavadapalli/nitestays-divs-tej/blob/main/popup/popup.js): `popup/popup.js`
- [In-page panel](https://github.com/divyavadapalli/nitestays-divs-tej/blob/main/content/panel.js): `content/panel.js`

### Hotel collection

- [Collection controller](https://github.com/divyavadapalli/nitestays-divs-tej/blob/main/content/content-script.js): `content/content-script.js`
- [Sheet batch matching](https://github.com/divyavadapalli/nitestays-divs-tej/blob/main/content/batch.js): `content/batch.js`
- [Collection workflow](https://github.com/divyavadapalli/nitestays-divs-tej/blob/main/content/collector.js): `content/collector.js`
- [Page readiness](https://github.com/divyavadapalli/nitestays-divs-tej/blob/main/content/page.js): `content/page.js`
- [Hotel data extractors](https://github.com/divyavadapalli/nitestays-divs-tej/blob/main/content/extractors.js): `content/extractors.js`
- [DOM and wait utilities](https://github.com/divyavadapalli/nitestays-divs-tej/blob/main/content/utils.js): `content/utils.js`

### Result processing

- [USD normalization](https://github.com/divyavadapalli/nitestays-divs-tej/blob/main/content/currency.js): `content/currency.js`
- [Export formatting](https://github.com/divyavadapalli/nitestays-divs-tej/blob/main/content/export.js): `content/export.js`

### Storage and export

- [Extension local storage](https://github.com/divyavadapalli/nitestays-divs-tej/blob/main/content/content-script.js): `content/content-script.js`

### External services

- [Background service worker](https://github.com/divyavadapalli/nitestays-divs-tej/blob/main/background/service-worker.js): `background/service-worker.js`
- **Frankfurter rates**
- **Supabase**
- **Google Sheets**

### Other components

- **User**
- **Google Hotels page**

## Connections

- User → Popup controls: opens (evidence: `popup/popup.js`)
- Popup controls → Collection controller: sends commands (evidence: `popup/popup.js`)
- User → In-page panel: operates (evidence: `content/panel.js`)
- In-page panel → Collection controller: invokes actions (evidence: `content/content-script.js`)
- Collection controller → In-page panel: updates state (evidence: `content/content-script.js`)
- Collection controller → Collection workflow: starts collection (evidence: `content/content-script.js`)
- Collection controller → Sheet batch matching: matches sheet rows (evidence: `content/content-script.js`)
- Collection workflow → Page readiness: checks and opens tabs (evidence: `content/collector.js`)
- Collection workflow → Hotel data extractors: extracts sections (evidence: `content/collector.js`)
- Collection workflow → DOM and wait utilities: waits and scrolls (evidence: `content/collector.js`)
- Page readiness → DOM and wait utilities: uses helpers
- Hotel data extractors → DOM and wait utilities: uses helpers
- Google Hotels page → Collection workflow: provides page data
- Collection controller → Extension local storage: reads and writes (evidence: `content/content-script.js`)
- Collection controller → USD normalization: normalizes results
- USD normalization → Background service worker: requests rates
- Background service worker → Frankfurter rates: fetches rates (evidence: `background/service-worker.js`)
- Collection controller → Export formatting: formats results
- Collection controller → Background service worker: sends integrations
- Background service worker → Supabase: calls RPCs (evidence: `background/service-worker.js`)
- Background service worker → Google Sheets: reads sheet data (evidence: `background/service-worker.js`)
