# clenildo96/wme-scripts architecture

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

- Interactive diagram: https://gitdiagram.com/clenildo96/wme-scripts
- Repository: https://github.com/clenildo96/wme-scripts

## Overview

WME Postos ANP is a Tampermonkey userscript that brings official Brazilian fuel-station data into Waze Map Editor. The editor starts the script, which initializes the WME SDK and provides a sidebar search workflow: request ANP pages, process station records, draw georeferenced stations on a map layer, and report stations without coordinates. The script also documents a draggable station detail card, layer visibility control, and address copying. The single core file is only partially excerpted, so component boundaries and links are limited to evidenced behavior and README-described capabilities.

Main entry points: [`WME Postos ANP/WME-Postos-ANP.user.js`](https://github.com/clenildo96/wme-scripts/blob/main/WME%20Postos%20ANP/WME-Postos-ANP.user.js) (ANP userscript)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["WME interface"]
  node_sidebar["Search sidebar"]
  node_card["Station detail card"]
  node_clipboard["Address copying"]
end

subgraph group_workflow["Search and processing"]
  node_userscript["ANP userscript"]
  node_request["Cached API requests"]
  node_processing["Station processing"]
end

subgraph group_map["Map and reporting"]
  node_maplayer["Station map layer"]
  node_switcher["Layer visibility"]
  node_report["Missing-coordinate report"]
end

node_editor(("Waze editor"))
node_api["ANP data API"]

node_editor -.->|"hosts"| node_userscript
node_userscript -->|"registers"| node_sidebar
node_sidebar -->|"starts search"| node_request
node_request -->|"fetches pages"| node_api
node_request -.->|"returns records"| node_processing
node_processing -->|"adds features"| node_maplayer
node_userscript -->|"registers checkbox"| node_switcher
node_processing -.->|"updates report"| node_report
node_maplayer -.->|"shows station details"| node_card
node_report -.->|"copies address"| node_clipboard

click node_userscript "https://github.com/clenildo96/wme-scripts/blob/main/WME%20Postos%20ANP/WME-Postos-ANP.user.js"
click node_sidebar "https://github.com/clenildo96/wme-scripts/blob/main/WME%20Postos%20ANP/WME-Postos-ANP.user.js"
click node_request "https://github.com/clenildo96/wme-scripts/blob/main/WME%20Postos%20ANP/WME-Postos-ANP.user.js"
click node_processing "https://github.com/clenildo96/wme-scripts/blob/main/WME%20Postos%20ANP/WME-Postos-ANP.user.js"
click node_maplayer "https://github.com/clenildo96/wme-scripts/blob/main/WME%20Postos%20ANP/WME-Postos-ANP.user.js"
click node_switcher "https://github.com/clenildo96/wme-scripts/blob/main/WME%20Postos%20ANP/WME-Postos-ANP.user.js"
click node_report "https://github.com/clenildo96/wme-scripts/blob/main/WME%20Postos%20ANP/WME-Postos-ANP.user.js"
click node_card "https://github.com/clenildo96/wme-scripts/blob/main/WME%20Postos%20ANP/WME-Postos-ANP.user.js"
click node_clipboard "https://github.com/clenildo96/wme-scripts/blob/main/WME%20Postos%20ANP/WME-Postos-ANP.user.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_sidebar,node_card,node_clipboard toneBlue
class node_userscript,node_request,node_processing toneAmber
class node_maplayer,node_switcher,node_report,node_api toneMint
class node_editor toneIndigo
```

## Components

### WME interface

- [Search sidebar](https://github.com/clenildo96/wme-scripts/blob/main/WME%20Postos%20ANP/WME-Postos-ANP.user.js): `WME Postos ANP/WME-Postos-ANP.user.js`
- [Station detail card](https://github.com/clenildo96/wme-scripts/blob/main/WME%20Postos%20ANP/WME-Postos-ANP.user.js): `WME Postos ANP/WME-Postos-ANP.user.js`
- [Address copying](https://github.com/clenildo96/wme-scripts/blob/main/WME%20Postos%20ANP/WME-Postos-ANP.user.js): `WME Postos ANP/WME-Postos-ANP.user.js`

### Search and processing

- [ANP userscript](https://github.com/clenildo96/wme-scripts/blob/main/WME%20Postos%20ANP/WME-Postos-ANP.user.js): `WME Postos ANP/WME-Postos-ANP.user.js`
- [Cached API requests](https://github.com/clenildo96/wme-scripts/blob/main/WME%20Postos%20ANP/WME-Postos-ANP.user.js): `WME Postos ANP/WME-Postos-ANP.user.js`
- [Station processing](https://github.com/clenildo96/wme-scripts/blob/main/WME%20Postos%20ANP/WME-Postos-ANP.user.js): `WME Postos ANP/WME-Postos-ANP.user.js`

### Map and reporting

- [Station map layer](https://github.com/clenildo96/wme-scripts/blob/main/WME%20Postos%20ANP/WME-Postos-ANP.user.js): `WME Postos ANP/WME-Postos-ANP.user.js`
- [Layer visibility](https://github.com/clenildo96/wme-scripts/blob/main/WME%20Postos%20ANP/WME-Postos-ANP.user.js): `WME Postos ANP/WME-Postos-ANP.user.js`
- [Missing-coordinate report](https://github.com/clenildo96/wme-scripts/blob/main/WME%20Postos%20ANP/WME-Postos-ANP.user.js): `WME Postos ANP/WME-Postos-ANP.user.js`

### Other components

- **Waze editor**
- **ANP data API**

## Connections

- Waze editor → ANP userscript: hosts
- ANP userscript → Search sidebar: registers (evidence: `WME Postos ANP/WME-Postos-ANP.user.js`)
- Search sidebar → Cached API requests: starts search (evidence: `WME Postos ANP/WME-Postos-ANP.user.js`)
- Cached API requests → ANP data API: fetches pages (evidence: `WME Postos ANP/WME-Postos-ANP.user.js`)
- Cached API requests → Station processing: returns records (evidence: `WME Postos ANP/WME-Postos-ANP.user.js`)
- Station processing → Station map layer: adds features (evidence: `WME Postos ANP/WME-Postos-ANP.user.js`)
- ANP userscript → Layer visibility: registers checkbox (evidence: `WME Postos ANP/WME-Postos-ANP.user.js`)
- Station processing → Missing-coordinate report: updates report (evidence: `WME Postos ANP/WME-Postos-ANP.user.js`)
- Station map layer → Station detail card: shows station details (evidence: `WME Postos ANP/WME-Postos-ANP.user.js`)
- Missing-coordinate report → Address copying: copies address (evidence: `WME Postos ANP/WME-Postos-ANP.user.js`)
