# renthelautomations/google-maps-lead-scraper architecture

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

- Interactive diagram: https://gitdiagram.com/renthelautomations/google-maps-lead-scraper
- Repository: https://github.com/renthelautomations/google-maps-lead-scraper

## Overview

Maps Lead Scraper is a browser-local Chrome extension for collecting and enriching Google Maps business leads. A user starts a Maps scrape from the popup, or configures bulk searches in the dashboard; the scraper reads listings, the background service enriches websites, and results are saved for review and export. The graph also shows dashboard reporting and list management, shared cleaning/export logic, and the Maps and business websites as external systems. Dashboard implementation is sampled only partially; bulk-search wiring is documented in the README.

Main entry points: [`dashboard.js`](https://github.com/renthelautomations/google-maps-lead-scraper/blob/main/dashboard.js) (Lead dashboard), [`content.js`](https://github.com/renthelautomations/google-maps-lead-scraper/blob/main/content.js) (Maps scraper), [`clean.js`](https://github.com/renthelautomations/google-maps-lead-scraper/blob/main/clean.js) (Cleaning and export helpers), [`popup.js`](https://github.com/renthelautomations/google-maps-lead-scraper/blob/main/popup.js) (Scrape popup)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_collection["Lead collection"]
  node_popup["Scrape popup<br/>[popup.js]"]
  node_scraper["Maps scraper<br/>[content.js]"]
  node_queue["Bulk search queue<br/>[background.js]"]
  node_popup_export["Popup export<br/>[popup.js]"]
end

subgraph group_enrichment["Website enrichment"]
  node_background["Extension service worker<br/>[background.js]"]
  node_enricher["Website enricher<br/>[background.js]"]
end

subgraph group_workspace["Lead workspace"]
  node_dashboard["Lead dashboard<br/>[dashboard.js]"]
  node_bulk["Bulk search controls<br/>[dashboard.js]"]
  node_report["Lead report<br/>[dashboard.js]"]
  node_lead_detail["Lead details and actions<br/>[dashboard.js]"]
  node_export["CSV and Sheets export<br/>[dashboard.js]"]
end

subgraph group_shared["Shared data logic"]
  node_clean["Cleaning and export helpers<br/>[clean.js]"]
  node_storage[("Local lead storage")]
end

node_user(("User"))
node_maps["Google Maps"]
node_business_sites["Business websites"]

node_user -->|"searches"| node_maps
node_user -->|"starts scrape"| node_popup
node_popup -->|"injects"| node_scraper
node_maps -->|"provides listings"| node_scraper
node_scraper -->|"cleans fields"| node_clean
node_scraper -->|"saves leads"| node_storage
node_scraper -->|"requests enrichment"| node_background
node_background -->|"dispatches enrichment"| node_enricher
node_enricher -->|"fetches pages"| node_business_sites
node_enricher -->|"extracts signals"| node_clean
node_bulk -->|"starts searches"| node_queue
node_queue -->|"opens searches"| node_maps
node_queue -->|"injects scraper"| node_scraper
node_user -->|"reviews leads"| node_dashboard
node_dashboard -->|"loads and updates"| node_storage
node_dashboard -->|"configures"| node_bulk
node_dashboard -->|"summarizes leads"| node_report
node_dashboard -->|"opens details"| node_lead_detail
node_dashboard -->|"filters and formats"| node_clean
node_dashboard -->|"exports filtered leads"| node_export
node_popup -->|"exports leads"| node_popup_export
node_popup_export -->|"formats CSV and TSV"| node_clean
node_popup_export -->|"marks exported"| node_storage
node_user -->|"exports reviewed list"| node_export

click node_popup "https://github.com/renthelautomations/google-maps-lead-scraper/blob/main/popup.js"
click node_scraper "https://github.com/renthelautomations/google-maps-lead-scraper/blob/main/content.js"
click node_queue "https://github.com/renthelautomations/google-maps-lead-scraper/blob/main/background.js"
click node_background "https://github.com/renthelautomations/google-maps-lead-scraper/blob/main/background.js"
click node_enricher "https://github.com/renthelautomations/google-maps-lead-scraper/blob/main/background.js"
click node_clean "https://github.com/renthelautomations/google-maps-lead-scraper/blob/main/clean.js"
click node_dashboard "https://github.com/renthelautomations/google-maps-lead-scraper/blob/main/dashboard.js"
click node_bulk "https://github.com/renthelautomations/google-maps-lead-scraper/blob/main/dashboard.js"
click node_report "https://github.com/renthelautomations/google-maps-lead-scraper/blob/main/dashboard.js"
click node_lead_detail "https://github.com/renthelautomations/google-maps-lead-scraper/blob/main/dashboard.js"
click node_export "https://github.com/renthelautomations/google-maps-lead-scraper/blob/main/dashboard.js"
click node_popup_export "https://github.com/renthelautomations/google-maps-lead-scraper/blob/main/popup.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_scraper,node_queue,node_popup_export,node_user toneBlue
class node_background,node_enricher toneAmber
class node_dashboard,node_bulk,node_report,node_lead_detail,node_export toneMint
class node_clean,node_storage toneRose
class node_maps,node_business_sites toneIndigo
```

## Components

### Lead collection

- [Scrape popup](https://github.com/renthelautomations/google-maps-lead-scraper/blob/main/popup.js): `popup.js`
- [Maps scraper](https://github.com/renthelautomations/google-maps-lead-scraper/blob/main/content.js): `content.js`
- [Bulk search queue](https://github.com/renthelautomations/google-maps-lead-scraper/blob/main/background.js): `background.js`
- [Popup export](https://github.com/renthelautomations/google-maps-lead-scraper/blob/main/popup.js): `popup.js`

### Website enrichment

- [Extension service worker](https://github.com/renthelautomations/google-maps-lead-scraper/blob/main/background.js): `background.js`
- [Website enricher](https://github.com/renthelautomations/google-maps-lead-scraper/blob/main/background.js): `background.js`

### Lead workspace

- [Lead dashboard](https://github.com/renthelautomations/google-maps-lead-scraper/blob/main/dashboard.js): `dashboard.js`
- [Bulk search controls](https://github.com/renthelautomations/google-maps-lead-scraper/blob/main/dashboard.js): `dashboard.js`
- [Lead report](https://github.com/renthelautomations/google-maps-lead-scraper/blob/main/dashboard.js): `dashboard.js`
- [Lead details and actions](https://github.com/renthelautomations/google-maps-lead-scraper/blob/main/dashboard.js): `dashboard.js`
- [CSV and Sheets export](https://github.com/renthelautomations/google-maps-lead-scraper/blob/main/dashboard.js): `dashboard.js`

### Shared data logic

- [Cleaning and export helpers](https://github.com/renthelautomations/google-maps-lead-scraper/blob/main/clean.js): `clean.js`
- **Local lead storage**

### Other components

- **User**
- **Google Maps**
- **Business websites**

## Connections

- User → Google Maps: searches (evidence: `README.md`)
- User → Scrape popup: starts scrape (evidence: `README.md`)
- Scrape popup → Maps scraper: injects (evidence: `popup.js`)
- Google Maps → Maps scraper: provides listings (evidence: `content.js`)
- Maps scraper → Cleaning and export helpers: cleans fields (evidence: `content.js`)
- Maps scraper → Local lead storage: saves leads (evidence: `content.js`)
- Maps scraper → Extension service worker: requests enrichment (evidence: `content.js`)
- Extension service worker → Website enricher: dispatches enrichment (evidence: `background.js`)
- Website enricher → Business websites: fetches pages (evidence: `background.js`)
- Website enricher → Cleaning and export helpers: extracts signals (evidence: `background.js`)
- Bulk search controls → Bulk search queue: starts searches (evidence: `README.md`)
- Bulk search queue → Google Maps: opens searches (evidence: `background.js`)
- Bulk search queue → Maps scraper: injects scraper (evidence: `background.js`)
- User → Lead dashboard: reviews leads (evidence: `README.md`)
- Lead dashboard → Local lead storage: loads and updates (evidence: `dashboard.js`)
- Lead dashboard → Bulk search controls: configures (evidence: `README.md`)
- Lead dashboard → Lead report: summarizes leads (evidence: `dashboard.js`)
- Lead dashboard → Lead details and actions: opens details (evidence: `dashboard.js`)
- Lead dashboard → Cleaning and export helpers: filters and formats (evidence: `dashboard.js`)
- Lead dashboard → CSV and Sheets export: exports filtered leads (evidence: `README.md`)
- Scrape popup → Popup export: exports leads (evidence: `popup.js`)
- Popup export → Cleaning and export helpers: formats CSV and TSV (evidence: `popup.js`)
- Popup export → Local lead storage: marks exported (evidence: `popup.js`)
- User → CSV and Sheets export: exports reviewed list (evidence: `README.md`)
