feat: add frontend, nginx reverse proxy and monitoring/reports extras

- apps/frontend: Next.js 15 (App Router) + Tailwind v4 + componentes estilo
  shadcn/ui sobre Radix UI + TanStack Query. Tema light/dark, logo
  processada. Menu completo (secao 52) com gating por permissao real.
  Todas as telas do checklist de aceite (secao 90) conectadas a endpoints
  reais (nao mockup): login, usuarios, perfis/permissoes, ramais/troncos,
  dialplan, filas/agentes, console do agente, campanhas (CPS/CSV/
  iniciar/pausar), monitoramento ao vivo (polling, nao WebSocket real),
  TME/TMA, busca/export de chamadas, administracao do Asterisk, auditoria
- infrastructure/nginx: reverse proxy colocando frontend+API na mesma
  origem (porta 80), antecipado da Fase 9 pois a API nao publica porta
  propria
- apps/api: GET /api/monitoring/agents (estado corrente real via
  agent_state_events em aberto) e filtro queueId em GET /api/reports/calls

Pendencia registrada: tela de Callbacks nao implementada (schema existe
desde a Fase 6, mas nunca houve controller/service — construir a tela sem
API real seria mockup). Verificacao visual em navegador nao foi possivel
neste ambiente headless; validado via tsc/eslint/next build limpos + curl
reproduzindo as chamadas do navegador (middleware de auth, 24 paginas
protegidas via Nginx, endpoints de dados com cookie de sessao).
This commit is contained in:
2026-08-27 17:35:34 -03:00
parent 0a8b830e2c
commit 6273b32214
100 changed files with 12280 additions and 17 deletions

View File

@@ -203,6 +203,70 @@ services:
limits:
memory: 150M
frontend:
build:
context: .
dockerfile: infrastructure/docker/frontend.Dockerfile
image: b2bcall-frontend:0.1.0
container_name: b2bcall-frontend
restart: unless-stopped
networks:
- b2bcall-net
depends_on:
api:
condition: service_healthy
# Sem "ports": só o Nginx expõe HTTP ao mundo externo (agente.md seção
# 87) — o browser fala só com o Nginx, nunca direto com este container.
healthcheck:
test: ["CMD", "node", "-e", "require('http').get('http://127.0.0.1:3000/login', r => process.exit(r.statusCode < 500 ? 0 : 1)).on('error', () => process.exit(1))"]
interval: 15s
timeout: 5s
retries: 5
start_period: 15s
logging:
driver: json-file
options:
max-size: "10m"
max-file: "3"
deploy:
resources:
limits:
memory: 200M
nginx:
image: nginx:1.27-alpine
container_name: b2bcall-nginx
restart: unless-stopped
networks:
- b2bcall-net
depends_on:
frontend:
condition: service_healthy
api:
condition: service_healthy
volumes:
- ./infrastructure/nginx/nginx.conf:/etc/nginx/nginx.conf:ro
ports:
# Único serviço exposto à LAN (agente.md seção 87) — todo o resto
# (api, frontend, postgres, redis, asterisk AMI/ARI) fica só na rede
# interna do Docker ou protegido por nftables.
- "80:80"
healthcheck:
test: ["CMD", "wget", "-qO-", "http://127.0.0.1:80/login"]
interval: 15s
timeout: 5s
retries: 5
start_period: 10s
logging:
driver: json-file
options:
max-size: "10m"
max-file: "3"
deploy:
resources:
limits:
memory: 64M
dialer-worker:
build:
context: .