# fixion-code/google-maps-scraper architecture

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

- Interactive diagram: https://gitdiagram.com/fixion-code/google-maps-scraper
- Repository: https://github.com/fixion-code/google-maps-scraper

## Overview

Google Maps Scraper extracts business listings, contact details, and reviews through CLI, browser UI, REST API, and an optional self-hosted platform. The core workflow accepts scrape requests, creates or runs scrape jobs, collects and persists results, and exposes job status or exports. The SaaS edition adds authenticated administration, queued work, and cloud-worker provisioning. Edges are limited to relationships shown in excerpts, the source index, or README; unsampled integrations are omitted rather than inferred.

Main entry points: [`main.go`](https://github.com/fixion-code/google-maps-scraper/blob/main/main.go) (CLI entry), [`scraper/scraper.go`](https://github.com/fixion-code/google-maps-scraper/blob/main/scraper/scraper.go) (Scrape manager), [`runner/databaserunner/databaserunner.go`](https://github.com/fixion-code/google-maps-scraper/blob/main/runner/databaserunner/databaserunner.go) (Database runner), [`admin/handlers_workers.go`](https://github.com/fixion-code/google-maps-scraper/blob/main/admin/handlers_workers.go) (Admin handlers)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["User entry points"]
  node_main["CLI entry<br/>[main.go]"]
  node_runner_config["Runner config<br/>[runner.go]"]
  node_web_ui["Browser UI<br/>[web.go]"]
  node_rest_api["REST API<br/>[api.go]"]
end

subgraph group_scrape["Scraping runtime"]
  node_scraper["Scrape manager<br/>[scraper.go]"]
  node_maps_jobs["Maps jobs<br/>[searchjob.go]"]
  node_review_jobs["Review extraction<br/>[reviews.go]"]
  node_file_runner["File runner<br/>[filerunner.go]"]
  node_database_runner["Database runner<br/>[databaserunner.go]"]
  node_lambda_runner["Lambda runner<br/>[lambdaaws.go]"]
  node_web_runner["Web runner<br/>[webrunner.go]"]
end

subgraph group_results["Results and jobs"]
  node_central_writer["Result writer<br/>[centralwriter.go]"]
  node_postgres_results[("PostgreSQL results<br/>[resultwriter.go]")]
  node_job_queue["Job queue<br/>[rqueue.go]"]
end

subgraph group_platform["SaaS platform"]
  node_admin_routes["Admin routes<br/>[routes.go]"]
  node_admin_handlers["Admin handlers"]
  node_admin_store[("Admin store<br/>[postgres.go]")]
  node_worker_command["Worker command<br/>[cmd_worker.go]"]
  node_worker_jobs["Worker jobs<br/>[worker_jobs.go]"]
end

subgraph group_infra["Worker infrastructure"]
  node_provisioning["Worker provisioner<br/>[worker.go]"]
  node_cloud_providers["Cloud providers<br/>[appplatform.go]"]
end

node_cli_user(("CLI user"))
node_ui_user(("UI user"))
node_api_client(("API client"))
node_saas_user(("Platform user"))
node_maps(("Google Maps"))

node_cli_user -->|"runs"| node_main
node_main -->|"parses config"| node_runner_config
node_main -->|"selects mode"| node_file_runner
node_main -->|"selects mode"| node_database_runner
node_main -->|"selects mode"| node_lambda_runner
node_main -->|"selects mode"| node_web_runner
node_ui_user -->|"uses"| node_web_ui
node_api_client -->|"submits jobs"| node_rest_api
node_rest_api -->|"enqueues jobs"| node_job_queue
node_saas_user -->|"uses"| node_admin_routes
node_admin_routes -->|"routes requests"| node_admin_handlers
node_admin_handlers -->|"reads and writes"| node_admin_store
node_worker_command -->|"starts processing"| node_job_queue
node_worker_command -->|"runs manager"| node_scraper
node_worker_jobs -->|"creates workers"| node_cloud_providers
node_admin_handlers -->|"requests provisioning"| node_provisioning
node_provisioning -.->|"uses provider"| node_cloud_providers
node_file_runner -.->|"runs scraping"| node_scraper
node_database_runner -->|"starts app"| node_scraper
node_database_runner -->|"writes results"| node_postgres_results
node_scraper -->|"streams results"| node_central_writer
node_central_writer -->|"persists results"| node_postgres_results
node_maps -.->|"supplies listings"| node_maps_jobs
node_maps_jobs -.->|"extracts reviews"| node_review_jobs
node_web_ui -.->|"starts scraping"| node_web_runner

click node_main "https://github.com/fixion-code/google-maps-scraper/blob/main/main.go"
click node_runner_config "https://github.com/fixion-code/google-maps-scraper/blob/main/runner/runner.go"
click node_web_ui "https://github.com/fixion-code/google-maps-scraper/blob/main/web/web.go"
click node_rest_api "https://github.com/fixion-code/google-maps-scraper/blob/main/api/api.go"
click node_scraper "https://github.com/fixion-code/google-maps-scraper/blob/main/scraper/scraper.go"
click node_maps_jobs "https://github.com/fixion-code/google-maps-scraper/blob/main/gmaps/searchjob.go"
click node_review_jobs "https://github.com/fixion-code/google-maps-scraper/blob/main/gmaps/reviews.go"
click node_file_runner "https://github.com/fixion-code/google-maps-scraper/blob/main/runner/filerunner/filerunner.go"
click node_database_runner "https://github.com/fixion-code/google-maps-scraper/blob/main/runner/databaserunner/databaserunner.go"
click node_lambda_runner "https://github.com/fixion-code/google-maps-scraper/blob/main/runner/lambdaaws/lambdaaws.go"
click node_web_runner "https://github.com/fixion-code/google-maps-scraper/blob/main/runner/webrunner/webrunner.go"
click node_central_writer "https://github.com/fixion-code/google-maps-scraper/blob/main/scraper/centralwriter.go"
click node_postgres_results "https://github.com/fixion-code/google-maps-scraper/blob/main/postgres/resultwriter.go"
click node_job_queue "https://github.com/fixion-code/google-maps-scraper/blob/main/rqueue/rqueue.go"
click node_admin_routes "https://github.com/fixion-code/google-maps-scraper/blob/main/admin/routes.go"
click node_admin_handlers "https://github.com/fixion-code/google-maps-scraper/blob/main/admin/handlers_workers.go"
click node_admin_store "https://github.com/fixion-code/google-maps-scraper/blob/main/admin/postgres/postgres.go"
click node_worker_command "https://github.com/fixion-code/google-maps-scraper/blob/main/cmd/gmapssaas/cmdworker/cmd_worker.go"
click node_worker_jobs "https://github.com/fixion-code/google-maps-scraper/blob/main/rqueue/worker_jobs.go"
click node_provisioning "https://github.com/fixion-code/google-maps-scraper/blob/main/infra/worker.go"
click node_cloud_providers "https://github.com/fixion-code/google-maps-scraper/blob/main/infra/digitalocean/appplatform.go"

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_main,node_runner_config,node_web_ui,node_rest_api,node_cli_user,node_ui_user,node_api_client,node_saas_user toneBlue
class node_scraper,node_maps_jobs,node_review_jobs,node_file_runner,node_database_runner,node_lambda_runner,node_web_runner toneAmber
class node_central_writer,node_postgres_results,node_job_queue toneMint
class node_admin_routes,node_admin_handlers,node_admin_store,node_worker_command,node_worker_jobs toneRose
class node_provisioning,node_cloud_providers,node_maps toneIndigo
```

## Components

### User entry points

- [CLI entry](https://github.com/fixion-code/google-maps-scraper/blob/main/main.go): `main.go`
- [Runner config](https://github.com/fixion-code/google-maps-scraper/blob/main/runner/runner.go): `runner/runner.go`
- [Browser UI](https://github.com/fixion-code/google-maps-scraper/blob/main/web/web.go): `web/web.go`
- [REST API](https://github.com/fixion-code/google-maps-scraper/blob/main/api/api.go): `api/api.go`

### Scraping runtime

- [Scrape manager](https://github.com/fixion-code/google-maps-scraper/blob/main/scraper/scraper.go): `scraper/scraper.go`
- [Maps jobs](https://github.com/fixion-code/google-maps-scraper/blob/main/gmaps/searchjob.go): `gmaps/searchjob.go`
- [Review extraction](https://github.com/fixion-code/google-maps-scraper/blob/main/gmaps/reviews.go): `gmaps/reviews.go`
- [File runner](https://github.com/fixion-code/google-maps-scraper/blob/main/runner/filerunner/filerunner.go): `runner/filerunner/filerunner.go`
- [Database runner](https://github.com/fixion-code/google-maps-scraper/blob/main/runner/databaserunner/databaserunner.go): `runner/databaserunner/databaserunner.go`
- [Lambda runner](https://github.com/fixion-code/google-maps-scraper/blob/main/runner/lambdaaws/lambdaaws.go): `runner/lambdaaws/lambdaaws.go`
- [Web runner](https://github.com/fixion-code/google-maps-scraper/blob/main/runner/webrunner/webrunner.go): `runner/webrunner/webrunner.go`

### Results and jobs

- [Result writer](https://github.com/fixion-code/google-maps-scraper/blob/main/scraper/centralwriter.go): `scraper/centralwriter.go`
- [PostgreSQL results](https://github.com/fixion-code/google-maps-scraper/blob/main/postgres/resultwriter.go): `postgres/resultwriter.go`
- [Job queue](https://github.com/fixion-code/google-maps-scraper/blob/main/rqueue/rqueue.go): `rqueue/rqueue.go`

### SaaS platform

- [Admin routes](https://github.com/fixion-code/google-maps-scraper/blob/main/admin/routes.go): `admin/routes.go`
- [Admin handlers](https://github.com/fixion-code/google-maps-scraper/blob/main/admin/handlers_workers.go): `admin/handlers_workers.go`
- [Admin store](https://github.com/fixion-code/google-maps-scraper/blob/main/admin/postgres/postgres.go): `admin/postgres/postgres.go`
- [Worker command](https://github.com/fixion-code/google-maps-scraper/blob/main/cmd/gmapssaas/cmdworker/cmd_worker.go): `cmd/gmapssaas/cmdworker/cmd_worker.go`
- [Worker jobs](https://github.com/fixion-code/google-maps-scraper/blob/main/rqueue/worker_jobs.go): `rqueue/worker_jobs.go`

### Worker infrastructure

- [Worker provisioner](https://github.com/fixion-code/google-maps-scraper/blob/main/infra/worker.go): `infra/worker.go`
- [Cloud providers](https://github.com/fixion-code/google-maps-scraper/blob/main/infra/digitalocean/appplatform.go): `infra/digitalocean/appplatform.go`

### Other components

- **CLI user**
- **UI user**
- **API client**
- **Platform user**
- **Google Maps**

## Connections

- CLI user → CLI entry: runs (evidence: `README.md`)
- CLI entry → Runner config: parses config (evidence: `main.go`)
- CLI entry → File runner: selects mode (evidence: `main.go`)
- CLI entry → Database runner: selects mode (evidence: `main.go`)
- CLI entry → Lambda runner: selects mode (evidence: `main.go`)
- CLI entry → Web runner: selects mode (evidence: `main.go`)
- UI user → Browser UI: uses (evidence: `README.md`)
- API client → REST API: submits jobs (evidence: `README.md`)
- REST API → Job queue: enqueues jobs (evidence: `api/api.go`)
- Platform user → Admin routes: uses (evidence: `README.md`)
- Admin routes → Admin handlers: routes requests (evidence: `admin/routes.go`)
- Admin handlers → Admin store: reads and writes
- Worker command → Job queue: starts processing (evidence: `cmd/gmapssaas/cmdworker/cmd_worker.go`)
- Worker command → Scrape manager: runs manager (evidence: `cmd/gmapssaas/cmdworker/cmd_worker.go`)
- Worker jobs → Cloud providers: creates workers (evidence: `rqueue/worker_jobs.go`)
- Admin handlers → Worker provisioner: requests provisioning (evidence: `admin/handlers_workers.go`)
- Worker provisioner → Cloud providers: uses provider
- File runner → Scrape manager: runs scraping
- Database runner → Scrape manager: starts app (evidence: `runner/databaserunner/databaserunner.go`)
- Database runner → PostgreSQL results: writes results (evidence: `runner/databaserunner/databaserunner.go`)
- Scrape manager → Result writer: streams results (evidence: `scraper/centralwriter.go`)
- Result writer → PostgreSQL results: persists results (evidence: `scraper/centralwriter.go`)
- Google Maps → Maps jobs: supplies listings
- Maps jobs → Review extraction: extracts reviews
- Browser UI → Web runner: starts scraping
