# willclaf/garimpo architecture

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

- Interactive diagram: https://gitdiagram.com/willclaf/garimpo
- Repository: https://github.com/willclaf/garimpo

## Overview

Garimpo é um painel local de prospecção: o usuário inicia caçadas no Google Maps, acompanha leads e oportunidades, e pode gerenciar contato e vendas pelo WhatsApp. O servidor Python concentra a lógica, o estado SQLite e as integrações; o painel no navegador apresenta os resultados. A documentação também descreve inteligência de mercado, auditoria de clientes, páginas de diagnóstico e análise opcional por IA. Algumas capacidades estão documentadas, mas seus detalhes internos não foram amostrados; as relações correspondentes seguem apenas o que o README confirma.

Main entry points: [`garimpo.py`](https://github.com/willclaf/garimpo/blob/main/garimpo.py) (Servidor local), [`web/app.js`](https://github.com/willclaf/garimpo/blob/main/web/app.js) (Painel), [`diag.py`](https://github.com/willclaf/garimpo/blob/main/diag.py) (Página de diagnóstico), [`web/i18n.js`](https://github.com/willclaf/garimpo/blob/main/web/i18n.js) (Traduções)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["Painel local"]
  node_panel["Painel<br/>[app.js]"]
  node_translations["Traduções<br/>[i18n.js]"]
end

subgraph group_prospecting["Prospecção e inteligência"]
  node_server["Servidor local<br/>[garimpo.py]"]
  node_db[("Dados locais<br/>[garimpo.py]")]
  node_hunt["Caçadas<br/>[garimpo.py]"]
  node_maps["Motor Maps"]
  node_leadscore["Nota de oportunidade<br/>[garimpo.py]"]
  node_market["Inteligência de mercado<br/>[garimpo.py]"]
  node_osm["OpenStreetMap"]
end

subgraph group_sales["Vendas e contato"]
  node_pipeline["Funil de vendas<br/>[garimpo.py]"]
  node_outreach["Fila e mensagens<br/>[garimpo.py]"]
  node_gateway["Gateway WhatsApp"]
  node_whatsapp["Servidores WhatsApp"]
end

subgraph group_diagnostics["Diagnósticos"]
  node_diagnostic["Página de diagnóstico<br/>[diag.py]"]
  node_audit["Blindagem de clientes<br/>[garimpo.py]"]
  node_claude["Claude CLI"]
  node_publichost["Servidor público"]
end

node_user(("Usuário"))
node_browser(("Navegador"))

node_user -->|"usa"| node_browser
node_browser -->|"abre"| node_panel
node_panel -->|"faz chamadas API"| node_server
node_panel -->|"recebe eventos"| node_server
node_panel -->|"traduz interface"| node_translations
node_server -->|"lê e grava"| node_db
node_server -->|"coordena"| node_hunt
node_hunt -->|"busca no Maps"| node_maps
node_hunt -->|"consulta bairros"| node_osm
node_server -->|"calcula nota"| node_leadscore
node_server -->|"fornece inteligência"| node_market
node_server -->|"inicia checagem"| node_audit
node_server -->|"gerencia etapas"| node_pipeline
node_server -->|"gerencia fila"| node_outreach
node_outreach -->|"envia mensagens"| node_gateway
node_gateway -->|"conecta"| node_whatsapp
node_whatsapp -->|"envia eventos"| node_gateway
node_gateway -->|"notifica por webhook"| node_server
node_server -->|"gera página"| node_diagnostic
node_server -->|"solicita análise"| node_claude
node_server -.->|"sincroniza páginas"| node_publichost
node_browser -->|"visualiza página"| node_diagnostic

click node_panel "https://github.com/willclaf/garimpo/blob/main/web/app.js"
click node_translations "https://github.com/willclaf/garimpo/blob/main/web/i18n.js"
click node_server "https://github.com/willclaf/garimpo/blob/main/garimpo.py"
click node_db "https://github.com/willclaf/garimpo/blob/main/garimpo.py"
click node_hunt "https://github.com/willclaf/garimpo/blob/main/garimpo.py"
click node_leadscore "https://github.com/willclaf/garimpo/blob/main/garimpo.py"
click node_market "https://github.com/willclaf/garimpo/blob/main/garimpo.py"
click node_pipeline "https://github.com/willclaf/garimpo/blob/main/garimpo.py"
click node_outreach "https://github.com/willclaf/garimpo/blob/main/garimpo.py"
click node_diagnostic "https://github.com/willclaf/garimpo/blob/main/diag.py"
click node_audit "https://github.com/willclaf/garimpo/blob/main/garimpo.py"

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_panel,node_translations toneBlue
class node_server,node_db,node_hunt,node_maps,node_leadscore,node_market,node_osm toneAmber
class node_pipeline,node_outreach,node_gateway,node_whatsapp toneMint
class node_diagnostic,node_audit,node_claude,node_publichost toneRose
class node_user,node_browser toneIndigo
```

## Components

### Painel local

- [Painel](https://github.com/willclaf/garimpo/blob/main/web/app.js): `web/app.js`
- [Traduções](https://github.com/willclaf/garimpo/blob/main/web/i18n.js): `web/i18n.js`

### Prospecção e inteligência

- [Servidor local](https://github.com/willclaf/garimpo/blob/main/garimpo.py): `garimpo.py`
- [Dados locais](https://github.com/willclaf/garimpo/blob/main/garimpo.py): `garimpo.py`
- [Caçadas](https://github.com/willclaf/garimpo/blob/main/garimpo.py): `garimpo.py`
- **Motor Maps**
- [Nota de oportunidade](https://github.com/willclaf/garimpo/blob/main/garimpo.py): `garimpo.py`
- [Inteligência de mercado](https://github.com/willclaf/garimpo/blob/main/garimpo.py): `garimpo.py`
- **OpenStreetMap**

### Vendas e contato

- [Funil de vendas](https://github.com/willclaf/garimpo/blob/main/garimpo.py): `garimpo.py`
- [Fila e mensagens](https://github.com/willclaf/garimpo/blob/main/garimpo.py): `garimpo.py`
- **Gateway WhatsApp**
- **Servidores WhatsApp**

### Diagnósticos

- [Página de diagnóstico](https://github.com/willclaf/garimpo/blob/main/diag.py): `diag.py`
- [Blindagem de clientes](https://github.com/willclaf/garimpo/blob/main/garimpo.py): `garimpo.py`
- **Claude CLI**
- **Servidor público**

### Other components

- **Usuário**
- **Navegador**

## Connections

- Usuário → Navegador: usa (evidence: `README.md`)
- Navegador → Painel: abre (evidence: `README.md`)
- Painel → Servidor local: faz chamadas API (evidence: `README.md`)
- Painel → Servidor local: recebe eventos (evidence: `README.md`)
- Painel → Traduções: traduz interface (evidence: `web/i18n.js`)
- Servidor local → Dados locais: lê e grava (evidence: `README.md`)
- Servidor local → Caçadas: coordena (evidence: `garimpo.py`)
- Caçadas → Motor Maps: busca no Maps (evidence: `README.md`)
- Caçadas → OpenStreetMap: consulta bairros (evidence: `README.md`)
- Servidor local → Nota de oportunidade: calcula nota (evidence: `README.md`)
- Servidor local → Inteligência de mercado: fornece inteligência (evidence: `README.md`)
- Servidor local → Blindagem de clientes: inicia checagem (evidence: `garimpo.py`)
- Servidor local → Funil de vendas: gerencia etapas (evidence: `README.md`)
- Servidor local → Fila e mensagens: gerencia fila (evidence: `README.md`)
- Fila e mensagens → Gateway WhatsApp: envia mensagens (evidence: `README.md`)
- Gateway WhatsApp → Servidores WhatsApp: conecta (evidence: `README.md`)
- Servidores WhatsApp → Gateway WhatsApp: envia eventos (evidence: `README.md`)
- Gateway WhatsApp → Servidor local: notifica por webhook (evidence: `README.md`)
- Servidor local → Página de diagnóstico: gera página (evidence: `README.md`)
- Servidor local → Claude CLI: solicita análise (evidence: `README.md`)
- Servidor local → Servidor público: sincroniza páginas (evidence: `README.md`)
- Navegador → Página de diagnóstico: visualiza página (evidence: `README.md`)
