Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
There was a problem hiding this comment.
Pull request overview
Adiciona documentação e especificações OpenAPI para o serviço de scraping em Go e para o backend, além de pequenos ajustes de infra/configuração para facilitar setup local e padronizar variáveis.
Changes:
- Cria documentação detalhada do scraper Go e do backend (endpoints, fluxo, env vars e exemplos).
- Adiciona especificação OpenAPI do scraper Go (YAML + JSON) e script para gerar OpenAPI do backend.
- Atualiza
docker-compose.infra.yml,.env.examplee dicionário do cspell.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 13 comments.
Show a summary per file
| File | Description |
|---|---|
| SCRAPER.md | Documentação do serviço Go (arquitetura, endpoints e operação). |
| scraper-go/openapi.yaml | OpenAPI (YAML) do serviço Go. |
| scraper-go/openapi.json | OpenAPI (JSON) do serviço Go. |
| docker-compose.infra.yml | Compose de infra com Postgres + Valkey. |
| backend/scripts/generate-openapi.cjs | Script para exportar OpenAPI do backend em JSON/YAML. |
| backend/.env.example | Exemplo de env reorganizado/expandido (inclui OAuth, sessão, URLs). |
| BACKEND.md | Documentação do backend (rotas, módulos, execução, exemplos). |
| .cspell/custom-dictionary-workspace.txt | Expande dicionário PT-BR para reduzir falsos positivos. |
|
|
||
| ## Como executar | ||
|
|
||
| Requisitos: Go >= 1.26, Redis (opcional, mas recomendado) |
|
|
||
| O serviço expõe endpoints HTTP (implementação em `cmd/server` e arquivos associados). Principais rotas: | ||
|
|
||
| - POST `/scrape` — body JSON com `ScrapeRequest` para disparar uma busca em todas as fontes configuradas. Retorna `ScrapeResponse` com `jobs`, `total`, `cachedAt` e `fromCache`. |
|
|
||
| ## Variáveis de ambiente importantes | ||
|
|
||
| - `REDIS_URL` / `VALKEY_URL` — conexão Redis/Valkey. |
|
|
||
| --- | ||
|
|
||
| Arquivo gerado: `scraper-go/SCRAPER.md`. |
| version: 1.0.0 | ||
| description: API mínima para disparar scrapes e gerenciar keywords | ||
| servers: | ||
| - url: http://localhost:8080 |
Comment on lines
+41
to
+85
| "/api/keywords": { | ||
| "get": { | ||
| "summary": "Retorna keywords carregadas", | ||
| "responses": { | ||
| "200": { | ||
| "description": "Lista de keywords", | ||
| "content": { | ||
| "application/json": { | ||
| "schema": { | ||
| "type": "object", | ||
| "properties": { | ||
| "keywords": { | ||
| "type": "array", | ||
| "items": { "type": "string" } | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } | ||
| }, | ||
| "post": { | ||
| "summary": "Atualiza/persiste keywords", | ||
| "requestBody": { | ||
| "required": true, | ||
| "content": { | ||
| "application/json": { | ||
| "schema": { | ||
| "type": "object", | ||
| "properties": { | ||
| "keywords": { | ||
| "type": "array", | ||
| "items": { "type": "string" } | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } | ||
| }, | ||
| "responses": { | ||
| "202": { "description": "Keywords enfileiradas/aceitas" } | ||
| } | ||
| } | ||
| } |
Comment on lines
+103
to
+120
| "ScrapeRequest": { | ||
| "type": "object", | ||
| "properties": { | ||
| "keywords": { "type": "array", "items": { "type": "string" } }, | ||
| "searchLocation": { "type": "string" }, | ||
| "searchGeoId": { "type": "string" }, | ||
| "searchLanguage": { "type": "string" }, | ||
| "jobTypes": { "type": "string" }, | ||
| "timeFilter": { "type": "string" }, | ||
| "remoteOnly": { "type": "boolean" }, | ||
| "resultsPerPage": { "type": "integer" }, | ||
| "maxPagesPerKeyword": { "type": "integer" }, | ||
| "waitBetweenSearchesMs": { "type": "integer" }, | ||
| "pageTimeoutMs": { "type": "integer" }, | ||
| "maxConcurrency": { "type": "integer" } | ||
| }, | ||
| "required": ["keywords"] | ||
| }, |
|
|
||
| --- | ||
|
|
||
| Para editar ou complementar esta documentação, abra [backend/BACKEND.md](backend/BACKEND.md). |
Comment on lines
+180
to
+184
| ## Docker / Infra | ||
|
|
||
| - `Dockerfile` presente no diretório `backend`. | ||
| - `docker-compose.yml` no projeto raiz orquestra serviços (possivelmente `scraper-go`, `postgres`, `redis`). | ||
|
|
| @@ -1,48 +1,65 @@ | |||
| # Runtime | |||
| # Runtime | |||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.