Skip to content

feat: suporte a Linux e macOS - #5

Open
nicolasapr wants to merge 1 commit into
nando0x:mainfrom
nicolasapr:feat/linux-macos-support
Open

feat: suporte a Linux e macOS#5
nicolasapr wants to merge 1 commit into
nando0x:mainfrom
nicolasapr:feat/linux-macos-support

Conversation

@nicolasapr

Copy link
Copy Markdown

O que muda

Hoje o ProspectOS roda só no Windows. Este PR porta o canal do Google Maps e o tooling de conveniência para Linux e macOS, sem alterar nada do comportamento no Windows.

Testado ponta a ponta no Linux (Debian, Python 3.13): busca do Google Maps subindo o navegador, progresso ao vivo e os 230 testes do backend passando.

Mudanças

  • backend/jobs.py — resolve o binário do scraper e o Node por plataforma (sem .exe nem caminho fixo do Windows), com override por GOOGLE_MAPS_SCRAPER_BIN / PLAYWRIGHT_NODEJS_PATH. Passa a ler o progresso ao vivo também do stderr, onde as builds de Linux do scraper emitem os logs JSON — antes o contador ficava parado em zero.
  • backend/preparar_driver_playwright.sh (novo) — monta o driver do Playwright a partir do pacote npm playwright-core. O playwright-go embutido no scraper baixa o driver do CDN antigo (playwright.azureedge.net), hoje 404, então o navegador interno nunca subia no Linux/macOS. Idempotente e overridável por PLAYWRIGHT_GO_DRIVER_VERSION.
  • iniciar.sh (novo) — equivalente Linux/macOS do iniciar.bat (sobe backend :5000 + frontend :5173, abre o navegador via xdg-open/open).
  • Docs (README, CONTRIBUTING, CHANGELOG) — atualizadas para as três plataformas, incluindo o download do scraper por SO e o passo de preparo do driver.
  • requirements.txtrequests 2.32.3 → 2.34.2 (versão do ambiente testado).

Como testar no Linux/macOS

  1. Baixar a build linux-amd64/darwin do google-maps-scraper, renomear para google-maps-scraper e chmod +x.
  2. cd backend && ./preparar_driver_playwright.sh
  3. ./iniciar.sh na raiz e disparar uma busca no canal Google Maps.

Sem o passo 2, a busca falha com "não conseguiu iniciar o navegador interno" — a mensagem de erro agora orienta exatamente isso.

Previously the app ran on Windows only. Ports the Google Maps scraper
integration and convenience tooling to Linux/macOS:

- jobs.py: resolve the scraper binary and Node per platform (no hardcoded
  .exe or Windows Node path), overridable via GOOGLE_MAPS_SCRAPER_BIN /
  PLAYWRIGHT_NODEJS_PATH. Also read live progress from stderr, where the
  Linux scraper builds emit their JSON logs (the counter stayed at zero).
- preparar_driver_playwright.sh: build the Playwright driver from the npm
  playwright-core package. The scraper's embedded playwright-go fetches the
  driver from the old azureedge CDN, now 404, so the browser never started.
- iniciar.sh: Linux/macOS equivalent of iniciar.bat (backend + frontend).
- Docs (README, CONTRIBUTING, CHANGELOG) updated for the three platforms,
  including the OS-specific scraper download and the driver-prep step.

requirements: bump requests to 2.34.2 (matches the tested environment).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant