| title | description |
|---|---|
Desenvolvimento local |
Configure a Social API localmente com Go + Make para desenvolver e iterar |
Este é o jeito mais rápido para desenvolver e iterar na Social API.
macOS (Homebrew):
brew install goLinux (apt):
sudo apt update
sudo apt install golang-goVerificar instalação:
go versionmacOS (Homebrew):
brew install makeLinux:
sudo apt install makeÚtil para seguir os exemplos de Jobs:
macOS:
brew install jqLinux:
sudo apt install jqgit clone <repo-url>
cd social-go
cp .env.example .envEdite .env com suas credenciais reais:
DATABASE_URL=postgres://postgres.[ref]:[pass]@db.[ref].supabase.co:5432/postgres?sslmode=require
APIFY_TOKEN=apify_api_xxxxx
GEMINI_API_KEY=AIzaSyxxxxx
INTERNAL_SECRET=sua-chave-secreta
PORT=8080
ENV=developmentmake runA API estará disponível em:
- Swagger UI →
http://localhost:8080/docs/ - Healthcheck →
http://localhost:8080/health
curl http://localhost:8080/healthEsperado:
OK
Se isso funcionou… parabéns 🎉 — a Social API está no ar.
export INTERNAL_SECRET="sua-chave-secreta"
export ENTERPRISE_ID="123e4567-e89b-12d3-a456-426614174000" # UUID v4
curl -X POST http://localhost:8080/connect \
-H "X-Internal-Secret: $INTERNAL_SECRET" \
-H "X-Enterprise-Id: $ENTERPRISE_ID" \
-H "Content-Type: application/json" \
-d '{
"username": "contyapp",
"platform": "INSTAGRAM",
"options": {
"fetch_profile": true,
"fetch_posts": true,
"fetch_reels": true,
"posts_limit": 20,
"reels_limit": 20,
"newer_than": "7 days"
}
}'curl http://localhost:8080/accounts \
-H "X-Internal-Secret: $INTERNAL_SECRET" \
-H "X-Enterprise-Id: $ENTERPRISE_ID"ACCOUNT_ID="123e4567-e89b-12d3-a456-426614174000"
curl "http://localhost:8080/accounts/$ACCOUNT_ID/dashboard?limit=5" \
-H "X-Internal-Secret: $INTERNAL_SECRET" \
-H "X-Enterprise-Id: $ENTERPRISE_ID"