From a6ac6e9dd999b88e2a3039e92143fd73d6c85ea8 Mon Sep 17 00:00:00 2001 From: Jonas Pacheco Date: Wed, 8 Apr 2026 13:33:21 -0300 Subject: [PATCH] =?UTF-8?q?docs:=20atualiza=20specs=20BI=20para=20refletir?= =?UTF-8?q?=20consolida=C3=A7=C3=A3o=20MetaSet?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Atualiza documentação para refletir a migração Metabase → Apache Superset: - docs/KERNEL_SPEC.md: - Adiciona capability 'embedding' ao MetaSet - Atualiza histórico de mudanças (v3.4) - PLANO_BI_SUPERSET.md: - Reescrito como documentação de arquitetura consolidada - Adiciona estrutura de arquivos atualizada - Documenta API endpoints do novo cliente - Inclui exemplos de uso do cliente TypeScript - MAPA_BI_ARCADIA.md: - Substitui todas referências Metabase → MetaSet - Atualiza portas: 8088 → 8100 - Atualiza rotas: /metabase/* → /bi/metaset/* - Adiciona server/bi/metaset-client/ aos arquivos principais --- MAPA_BI_ARCADIA.md | 63 +-- PLANO_BI_SUPERSET.md | 981 +++++++++++-------------------------------- docs/KERNEL_SPEC.md | 3 +- 3 files changed, 277 insertions(+), 770 deletions(-) diff --git a/MAPA_BI_ARCADIA.md b/MAPA_BI_ARCADIA.md index 1be5edc..21346ce 100644 --- a/MAPA_BI_ARCADIA.md +++ b/MAPA_BI_ARCADIA.md @@ -1,20 +1,20 @@ # Arcádia BI — Mapa de Business Intelligence -> Mapa completo da arquitetura de BI, incluindo Motor Python, Metabase, +> Mapa completo da arquitetura de BI, incluindo Motor Python, MetaSet (Apache Superset), > Cientista (IA), ETL/Staging, APIs e Frontend. -> Atualizado em: Março 2026 +> Atualizado em: Abril 2026 --- ## 1. Visão Geral -O BI da Arcádia Suite opera em **4 camadas complementares** que se combinam para oferecer analytics completo: desde queries SQL diretas até dashboards visuais no Metabase, passando por análise com IA e ingestão de dados externos. +O BI da Arcádia Suite opera em **4 camadas complementares** que se combinam para oferecer analytics completo: desde queries SQL diretas até dashboards visuais no MetaSet (Apache Superset), passando por análise com IA e ingestão de dados externos. ``` ┌─────────────────────────────────────────────────────────────────────┐ │ USUÁRIO / FRONTEND │ │ │ -│ BiWorkspace.tsx (2.970 linhas) Metabase (Embeddado) │ +│ BiWorkspace.tsx (2.970 linhas) MetaSet (Embeddado) │ │ React + Recharts + Tailwind Proxy → :8088 │ │ 8 abas funcionais Dashboards avançados │ │ │ @@ -35,8 +35,8 @@ O BI da Arcádia Suite opera em **4 camadas complementares** que se combinam par │ │ │ ▼ ▼ ▼ ┌─────────────────┐ ┌──────────────────┐ ┌─────────────────────┐ -│ API BI (Node) │ │BI Engine (Python)│ │ Metabase (Java) │ -│ /api/bi/* │ │ /api/bi-engine/* │ │ /metabase/* │ +│ API BI (Node) │ │BI Engine (Python)│ │ MetaSet (Python) │ +│ /api/bi/* │ │ /api/bi-engine/* │ │ /bi/metaset/* │ │ │ │ │ │ │ │ CRUD: │ │ SQL Execution │ │ Dashboards │ │ - DataSources │ │ Chart Data Gen │ │ Perguntas/Queries │ @@ -112,25 +112,25 @@ O coração analítico. Processa SQL, gera dados para gráficos e fornece Micro- └─────────────────────────────────────────────────────────────┘ ``` -### Pilar 2 — Metabase (Java :8088) +### Pilar 2 — MetaSet (Apache Superset :8100) -Plataforma visual de BI, acessível via proxy reverso. +Plataforma visual de BI baseada em Apache Superset 4.1.0, acessível via proxy reverso. ``` ┌─────────────────────────────────────────────────────────────┐ -│ METABASE │ -│ Porta: 8088 (via proxy /metabase) │ +│ METASET (SUPERSET) │ +│ Porta: 8100 (via proxy /bi/metaset) │ │ │ │ ┌──────────────────────────────────────────────────────┐ │ │ │ PROXY (http-proxy-middleware) │ │ │ │ │ │ -│ │ Gateway (:5000) → /metabase/* → Metabase (:8088) │ │ +│ │ Gateway (:5000) → /bi/metaset/* → MetaSet (:8100) │ │ │ │ │ │ -│ │ • pathRewrite: /metabase → / │ │ +│ │ • pathRewrite: /bi/metaset → / │ │ │ │ • changeOrigin: true │ │ │ │ • timeout: 60 segundos │ │ │ │ • Reescrita de Location headers │ │ -│ │ • Fallback: 502 "Metabase indisponível" │ │ +│ │ • Fallback: 502 "MetaSet indisponível" │ │ │ └──────────────────────────────────────────────────────┘ │ │ │ │ ┌──────────────────────────────────────────────────────┐ │ @@ -356,11 +356,11 @@ Formatos suportados (até 200MB): | POST | `/api/staging/tables/:id/migrate` | Executa migração para tabela destino | | DELETE | `/api/staging/tables/:id` | Remove tabela staged | -### 3.4 — Metabase Proxy (/metabase/*) +### 3.4 — MetaSet Proxy (/metaset/*) | Rota | Destino | Função | |------|---------|--------| -| `/metabase/*` | `http://localhost:8088/*` | Proxy reverso completo para Metabase | +| `/metaset/*` | `http://localhost:8088/*` | Proxy reverso completo para MetaSet | --- @@ -453,7 +453,7 @@ Formatos suportados (até 200MB): | **Charts** | `charts` | Criação de gráficos (8 tipos) a partir de datasets, com visualização Recharts | | **Backups** | `backups` | Jobs de backup com execução e artefatos gerados | | **Staging** | `staging` | Área de preparação: mapeamento de colunas, migração para tabelas destino | -| **Advanced** | `advanced` | BI Engine (link para Motor Python), Metabase (link para iframe), Assistente IA | +| **Advanced** | `advanced` | BI Engine (link para Motor Python), MetaSet (link para iframe), Assistente IA | ### Tipos de Gráficos Suportados (Recharts) @@ -668,7 +668,7 @@ Arquivo (CSV/Excel/JSON/SQL/BSON/ZIP) │ │ │ • Dataset pronto para visualização │ │ • Pode criar charts e dashboards │ -│ • Conecta com BI Engine e Metabase │ +│ • Conecta com BI Engine e MetaSet │ └──────────────────────────────────────┘ ``` @@ -691,7 +691,7 @@ Arquivo (CSV/Excel/JSON/SQL/BSON/ZIP) │ └─────┬──────┘ └──────────┘ │ │ │ │ │ ┌──────────┐ ┌─────▼──────┐ │ -│ │ Tabelas │─────────────────────▶│ Metabase │ │ +│ │ Tabelas │─────────────────────▶│ MetaSet │ │ │ │ Internas │ │ (Visual) │ │ │ │ (PG) │ └──────┬─────┘ │ │ └──────────┘ │ │ @@ -712,7 +712,7 @@ Arquivo (CSV/Excel/JSON/SQL/BSON/ZIP) | Dataset | BI Engine | SQL do dataset executado no Motor Python | | Dataset | Chart | Chart referencia datasetId | | Chart | Dashboard | `bi_dashboard_charts` com posição (X,Y,W,H) | -| Tabelas PG | Metabase | Conexão direta ao PostgreSQL | +| Tabelas PG | MetaSet | Conexão direta ao PostgreSQL | | Dataset | Assistente IA | Dados enviados como contexto ao GPT-4o | | Dados | Cientista | `analyze_data()`, `detect_patterns()`, `generate_insights()` | @@ -726,9 +726,9 @@ Arquivo (CSV/Excel/JSON/SQL/BSON/ZIP) | `BI_ENGINE_HOST` | `localhost` | Engine Proxy | Host do motor Python | | `BI_PORT` | `8004` | BI Engine, Proxy | Porta do motor Python | | `BI_ENGINE_TIMEOUT` | `30000` | Engine Proxy | Timeout de proxy (ms) | -| `METABASE_HOST` | `localhost` | Metabase Proxy | Host do Metabase | -| `METABASE_PORT` | `8088` | Metabase Proxy | Porta do Metabase | -| `METABASE_TIMEOUT` | `60000` | Metabase Proxy | Timeout do proxy (ms) | +| `METASET_HOST` | `metaset` | MetaSet Proxy | Host do MetaSet | +| `METASET_PORT` | `8100` | MetaSet Proxy | Porta do MetaSet | +| `METASET_TIMEOUT` | `30000` | MetaSet Proxy | Timeout do proxy (ms) | | `OPENAI_API_KEY` | - | Assistente BI | API key para GPT-4o | --- @@ -742,9 +742,10 @@ Arquivo (CSV/Excel/JSON/SQL/BSON/ZIP) | `server/bi/engine-proxy.ts` | Proxy | Proxy Gateway → BI Engine Python (:8004) | ~200 | | `server/bi/upload.ts` | ETL | Upload de arquivos (CSV, Excel, JSON, SQL, BSON, ZIP) | ~1.060 | | `server/bi/staging.ts` | ETL | Staging, mapeamento, migração de dados | ~408 | -| `server/metabase/proxy.ts` | Proxy | Proxy Gateway → Metabase (:8088) | ~42 | +| `server/bi/metaset-client/routes.ts` | Proxy | Proxy Gateway → MetaSet (:8100) | ~215 | | `client/src/pages/BiWorkspace.tsx` | Frontend | Interface principal do BI (8 tabs) | ~2.970 | -| `client/src/pages/MetabaseProxyPage.tsx` | Frontend | Página do Metabase embeddado | ~25 | +| `server/bi/metaset-client/index.ts` | Cliente | Cliente TypeScript para API Superset | ~375 | +| `client/src/pages/MetaSetProxyPage.tsx` | Frontend | Página do MetaSet embeddado | ~25 | | `python-service/services/cientista.py` | IA/ML | Análise, padrões, insights, auto-programação | ~567 | | `shared/schema.ts` | Schema | Tabelas BI (9 tabelas) | Parte do schema | @@ -763,17 +764,17 @@ EXPOSE 8004 CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8004"] ``` -### Container `metabase` +### Container `metaset` ```yaml -metabase: - image: metabase/metabase:latest +metaset: + image: metaset/metaset:latest restart: always ports: - "8088:3000" environment: MB_DB_TYPE: postgres - MB_DB_DBNAME: metabase + MB_DB_DBNAME: metaset MB_DB_PORT: 5432 MB_DB_USER: ${PGUSER:-arcadia} MB_DB_PASS: ${PGPASSWORD} @@ -783,7 +784,7 @@ metabase: postgres: condition: service_healthy volumes: - - metabase-data:/metabase-data + - metaset-data:/metaset-data networks: - arcadia ``` @@ -795,7 +796,7 @@ gateway: environment: BI_ENGINE_HOST: bi BI_PORT: 8004 - METABASE_HOST: metabase + METABASE_HOST: metaset METABASE_PORT: 3000 ``` @@ -814,7 +815,7 @@ gateway: │ ┌─────────────────────┼─────────────────────┐ │ │ │ │ │ │ │ ┌──────▼──────┐ ┌────────▼────────┐ ┌────────▼────────┐ │ -│ │ API BI │ │ BI Engine │ │ Metabase │ │ +│ │ API BI │ │ BI Engine │ │ MetaSet │ │ │ │ (Node.js) │ │ (Python:8004) │ │ (Java:8088) │ │ │ │ │ │ │ │ │ │ │ │ CRUD │ │ SQL + Charts │ │ Dashboards │ │ diff --git a/PLANO_BI_SUPERSET.md b/PLANO_BI_SUPERSET.md index 5a74ae6..390caec 100644 --- a/PLANO_BI_SUPERSET.md +++ b/PLANO_BI_SUPERSET.md @@ -1,787 +1,292 @@ -# PLANO BI — Substituição Metabase → Apache Superset -## Análise Real + Plano de Migração -### Versão 1.0 — Março 2026 +# PLANO BI — MetaSet (Apache Superset) +## Arquitetura Consolidada +### Versão 2.0 — Abril 2026 --- -## 1. DIAGNÓSTICO — ESTADO ATUAL +## 1. STATUS — CONSOLIDAÇÃO CONCLUÍDA ✅ -### 1.1 O que foi descoberto no código +### 1.1 O que foi realizado -O documento do Replit referenciava **Metabase** (Java, :8088) como o pilar visual do BI. Ao analisar o código real, a situação é diferente: +A migração do Metabase para o Apache Superset foi **concluída** em abril de 2026. -| Componente | Nome no doc | Nome real no código | Status | -|---|---|---|---| -| Plataforma BI Visual | "Metabase" | **"MetaSet"** (alias) | Metabase por baixo | -| Proxy | `/metabase/*` | `server/metabase/proxy.ts` | Funcional | -| Auth | Metabase session | `server/metaset/routes.ts` (autologin) | Funcional | -| Client | MetabaseClient | `server/metaset/client.ts` | Funcional | -| UI | Advanced tab iframe | `/api/bi/metaset/autologin` → `/metabase/` | Funcional | -| **Superset** | Não mencionado | **`docker-compose.yml` linha 165** | **JÁ CONFIGURADO** | - -**Descoberta crítica:** O Apache Superset **já está no docker-compose.yml**: -```yaml -superset: - image: apache/superset:4.1.0 - restart: unless-stopped - environment: - SUPERSET_SECRET_KEY: ${SUPERSET_SECRET_KEY:-superset-secret-change-in-prod} - DATABASE_URL: postgresql://arcadia:arcadia123@db:5432/arcadia_superset - ports: - - "8088:8088" - depends_on: - db: - condition: service_healthy - profiles: [bi] -``` - -O Superset está configurado, mas **não integrado ao gateway Node.js**. O que falta é a ponte. - -### 1.2 Arquivos que precisam mudar vs o que fica igual - -**Mudam:** -``` -server/metabase/proxy.ts → substituir por server/superset/proxy.ts -server/metaset/routes.ts → substituir por server/superset/routes.ts -server/metaset/client.ts → substituir por server/superset/client.ts -client/src/pages/BiWorkspace.tsx (Advanced tab apenas) -docker-compose.yml (Superset config + init) -docker-compose.prod.yml (adicionar Superset) -.env.example (novas variáveis) -``` - -**NÃO mudam (ficam exatamente iguais):** -``` -server/python/bi_engine.py ← Motor Python :8004 continua intacto -server/bi/routes.ts ← CRUD de datasets/charts/dashboards -server/bi/upload.ts ← ETL pipeline -server/bi/staging.ts ← Staging -server/bi/engine-proxy.ts ← Proxy para BI Engine Python -client/src/pages/BiWorkspace.tsx (7 de 8 tabs ficam iguais) -Todas as tabelas do banco (bi_datasets, bi_charts, etc.) -``` - ---- - -## 2. POR QUE SUPERSET É MELHOR PARA O CASO - -### 2.1 Metabase vs Superset - -| Critério | Metabase | Apache Superset | +| Componente | Status | Localização | |---|---|---| -| Runtime | Java (JVM, 500MB+ RAM) | Python/Flask (mais leve) | -| Embedding | Iframe com cookie de sessão | **Guest Token JWT** (seguro, sem credenciais) | -| "Qualquer tela" | Iframe estático, limitado | **`@superset-ui/embedded-sdk`** — componente React nativo | -| REST API | Limitada e não documentada | **REST API v1 completa e documentada** | -| Consistência de stack | Java (fora do padrão) | Python (mesmo stack dos motores existentes) | -| Docker image | `metabase/metabase` ~700MB | `apache/superset` ~400MB | -| SQL Lab | Básico | **Poderoso** (autocomplete, histórico, salvar queries) | -| Alertas | Básico | **Avançado** (webhooks, Slack, email) | -| Tipos de chart | ~20 | **50+** (incluindo mapas, sunburst, funnel) | -| Banco de metadados | H2/Postgres separado | **Mesmo PostgreSQL** da Arcádia | +| **MetaSet (Apache Superset 4.1.0)** | ✅ Implementado | `/server/bi/metaset/` | +| **Cliente TypeScript** | ✅ Implementado | `/server/bi/metaset-client/` | +| **Rotas Express** | ✅ Implementado | `/server/bi/metaset-client/routes.ts` | +| **Código legado Metabase** | ✅ Backup | `/server/metaset/backup/` | +| **Integração Kernel** | ✅ Ativa | Porta 8100 | +| **Documentação** | ✅ Atualizada | `/server/metaset/README.md` | -### 2.2 A feature que o usuário pediu: "funcionar em qualquer tela" - -O Superset resolve isso com **Guest Token + Embedded SDK**: +### 1.2 Arquitetura Consolidada ``` -Fluxo atual (Metabase): - BiWorkspace → iframe → /metabase/ → autologin com cookie - ❌ Só funciona na tab Advanced do BiWorkspace - ❌ Cookie expira, precisa re-autenticar - ❌ Não embeda em outras páginas facilmente - -Fluxo novo (Superset): - QUALQUER página React → - ✅ Funciona no Dashboard principal (/) - ✅ Funciona no SOE (/soe tab Financeiro) - ✅ Funciona no /contabil - ✅ Funciona no /financeiro - ✅ Funciona em qualquer tela do Arcádia - ✅ Guest Token renovado automaticamente (sem re-login) +┌─────────────────────────────────────────────────────────────────────────────┐ +│ ARCÁDIA SUITE (Porta 5000) │ +│ ┌─────────────────────────────────────────────────────────────────────┐ │ +│ │ BI-API GATEWAY (Porta 8004) │ │ +│ │ ┌─────────────┐ ┌─────────────┐ ┌─────────────────────────────┐ │ │ +│ │ │ /bi/api/* │ │/bi/metaset/*│ │ /bi/fdb/* │ │ │ +│ │ │ (nativo) │ │ (proxy) │ │ (proxy) │ │ │ +│ │ └──────┬──────┘ └──────┬──────┘ └─────────────┬───────────────┘ │ │ +│ │ └─────────────────┴───────────────────────┘ │ │ +│ └─────────────────────────────┬────────────────────────────────────────┘ │ +└────────────────────────────────┼────────────────────────────────────────────┘ + │ + ┌───────────────────────┴───────────────────────┐ + ▼ ▼ +┌─────────────────────────┐ ┌─────────────────────────┐ +│ METASET BI (Porta 8100)│ │ FDB-BRIDGE (8200) │ +│ Apache Superset 4.1.0 │ │ Sync Firebird → PG │ +│ ┌─────────────────┐ │ │ - Change Data Capture │ +│ │ superset-src/ │ │ │ - Real-time sync │ +│ │ - Dashboards │ │ │ - Tenant isolation │ +│ │ - SQL Lab │ │ │ │ +│ │ - Charts │ │ │ │ +│ │ - RLS │ │ │ │ +│ └─────────────────┘ │ │ │ +└─────────────────────────┘ └─────────────────────────┘ + │ + ▼ +┌─────────────────────────┐ +│ PostgreSQL + Redis │ +│ (metaset_db + cache) │ +└─────────────────────────┘ ``` --- -## 3. ARQUITETURA COM SUPERSET +## 2. ESTRUTURA DE ARQUIVOS -### 3.1 Diagrama atualizado +### 2.1 Implementação Atual (Apache Superset) ``` -┌─────────────────────────────────────────────────────────────────────┐ -│ USUÁRIO / FRONTEND │ -│ │ -│ BiWorkspace.tsx (8 tabs — 7 iguais, Advanced → Superset) │ -│ + QUALQUER outra página pode embedar um dashboard Superset │ -│ │ -│ ┌────────────────────────────────────────────────────────────┐ │ -│ │ │ │ -│ │ Componente React reutilizável em QUALQUER rota │ │ -│ └────────────────────────────────────────────────────────────┘ │ -└─────────────────────────┬────────────────────────────────────────────┘ - │ - ┌───────────────┼──────────────────────┐ - │ │ │ - ▼ ▼ ▼ -┌──────────────┐ ┌────────────────┐ ┌──────────────────────┐ -│ API BI Node │ │ BI Engine Py │ │ Superset (Python) │ -│ /api/bi/* │ │ /api/bi-engine │ │ /superset/* │ -│ (sem mudança)│ │ :8004 (igual) │ │ :8088 │ -│ │ │ │ │ │ -│ + novo: │ │ │ │ REST API v1 │ -│ /api/superset│ │ │ │ Guest Token JWT │ -│ /guest-token │ │ │ │ SQL Lab │ -│ │ │ │ │ 50+ chart types │ -└──────────────┘ └────────────────┘ └──────────┬───────────┘ - │ - ▼ - ┌──────────────────────┐ - │ PostgreSQL │ - │ arcadia (dados SOE) │ - │ arcadia_superset │ - │ (metadados Superset) │ - └──────────────────────┘ +/server/bi/metaset/ +├── main.py # FastAPI wrapper (Porta 8100) +├── run.py # Entry point Gunicorn +├── superset_config.py # Configuração Superset +├── security_manager.py # ArcadiaSecurityManager (JWT + RLS) +├── Dockerfile # Container MetaSet +├── init.sh # Script de inicialização +├── requirements.txt # Dependências Python +├── superset-src/ # Código fonte Apache Superset 4.1.0 +├── config/ # Configurações adicionais +├── branding/ # Assets de branding +├── security/ # Módulos de segurança +├── extensions/ # Extensões +└── templates/ # Templates customizados + +/server/bi/metaset-client/ +├── index.ts # Cliente TypeScript completo +└── routes.ts # Rotas Express /api/bi/metaset/* ``` -### 3.2 Dois bancos PostgreSQL +### 2.2 Código Legado (Backup) ``` -Banco: arcadia → Dados do SOE (persons, products, sales_orders, etc.) - Superset conecta aqui em READ-ONLY para criar charts -Banco: arcadia_superset → Metadados do Superset (dashboards, queries, users) - Superset usa internamente +/server/metaset/backup/ +├── client.ts # Cliente Metabase (legado) +└── routes.ts # Rotas Metabase (legado) ``` -Ambos no mesmo servidor PostgreSQL, bancos separados. O docker-compose.yml já referencia `arcadia_superset`. - --- -## 4. O QUE CONSTRUIR — Passo a Passo +## 3. API ENDPOINTS -### 4.1 Configuração do Superset (docker-compose.yml) +### 3.1 BI-API Gateway (Porta 8004) -O container já existe. Faltam: init script, volumes, configuração de embedding. +| Endpoint | Método | Descrição | +|----------|--------|-----------| +| `/api/bi/metaset/health` | GET | Health check | +| `/api/bi/metaset/databases` | GET/POST | Lista/Cria databases | +| `/api/bi/metaset/databases/:id/sync` | POST | Sincroniza schema | +| `/api/bi/metaset/databases/:id/tables` | GET | Lista tabelas | +| `/api/bi/metaset/tables/:id` | GET | Metadata da tabela | +| `/api/bi/metaset/query` | POST | Executa SQL | +| `/api/bi/metaset/charts` | GET/POST | Lista/Cria charts | +| `/api/bi/metaset/charts/:id` | GET/DELETE | Obtém/Deleta chart | +| `/api/bi/metaset/dashboards` | GET/POST | Lista/Cria dashboards | +| `/api/bi/metaset/dashboards/:id` | GET/PUT/DELETE | CRUD dashboard | +| `/api/bi/metaset/guest-token` | POST | Cria guest token | +| `/api/bi/metaset/embed/dashboard/:id` | GET | URL de embed | +| `/api/bi/metaset/suggest/:table` | GET | Sugestões de análise | -```yaml -# docker-compose.yml — seção superset (expandida) +### 3.2 MetaSet Direto (Porta 8100) -superset: - image: apache/superset:4.1.0 - restart: unless-stopped - environment: - SUPERSET_SECRET_KEY: ${SUPERSET_SECRET_KEY:-superset-secret-change-in-prod} - DATABASE_URL: postgresql://${PGUSER:-arcadia}:${PGPASSWORD:-arcadia123}@db:5432/arcadia_superset - SUPERSET_WEBSERVER_PORT: 8088 - PYTHONPATH: /app/pythonpath - # Para embedding funcionar: - FEATURE_FLAGS: '{"EMBEDDED_SUPERSET": true, "ENABLE_TEMPLATE_PROCESSING": true}' - ports: - - "8088:8088" - volumes: - - ./docker/superset/superset_config.py:/app/pythonpath/superset_config.py - - ./docker/superset/init.sh:/app/docker/init.sh - - superset_home:/app/superset_home - depends_on: - db: - condition: service_healthy - command: ["/bin/bash", "/app/docker/init.sh"] - profiles: [bi] - networks: - - arcadia +API nativa do Apache Superset: + +``` +GET /health +GET /api/v1/dashboard/ +GET /api/v1/dashboard/:id +POST /api/v1/dashboard/ +GET /api/v1/chart/ +GET /api/v1/dataset/ +POST /api/v1/security/guest_token/ +GET /api/v1/database/ +GET /sqllab/ ``` -### 4.2 Arquivo de Configuração Superset +--- + +## 4. CONFIGURAÇÃO + +### 4.1 Variáveis de Ambiente + +```bash +# MetaSet Connection +METASET_HOST=metaset +METASET_PORT=8100 + +# Database +DATABASE_URL=postgresql://arcadia:arcadia123@db:5432/metaset_db +ARCADIA_DATABASE_URL=postgresql://arcadia:arcadia123@db:5432/arcadia + +# Redis (Cache) +REDIS_URL=redis://redis:6379/1 + +# Security +METASET_SECRET_KEY=change-in-production +JWT_SECRET_KEY=arcadia-jwt-secret + +# Admin +METASET_ADMIN_USER=admin +METASET_ADMIN_EMAIL=admin@arcadia.app +METASET_ADMIN_PASSWORD=metaset2026 +``` + +### 4.2 Feature Flags ```python -# docker/superset/superset_config.py - -import os - -# Chave secreta (mesma do .env) -SECRET_KEY = os.environ.get("SUPERSET_SECRET_KEY", "change-in-production") - -# Banco de metadados do Superset -SQLALCHEMY_DATABASE_URI = os.environ.get( - "DATABASE_URL", - "postgresql://arcadia:arcadia123@db:5432/arcadia_superset" -) - -# CORS — permite o gateway Arcádia (:5000) chamar a API -ENABLE_CORS = True -CORS_OPTIONS = { - "supports_credentials": True, - "allow_headers": ["*"], - "resources": {r"/api/*": {"origins": "*"}}, -} - -# Embedding habilitado FEATURE_FLAGS = { - "EMBEDDED_SUPERSET": True, - "ENABLE_TEMPLATE_PROCESSING": True, - "ALERT_REPORTS": True, # Alertas automáticos - "DRILL_TO_DETAIL": True, # Drill-down em charts + "EMBEDDED_SUPERSET": True, # Embedding de dashboards + "GUEST_EMBEDDING_ENABLED": True, # Guest tokens + "DASHBOARD_RBAC": True, # Controle de acesso + "SQLLAB_BACKEND_PERSISTENCE": True, # Persistência SQL Lab + "DRILL_BY": True, # Drill-down + "DASHBOARD_CROSS_FILTERS": True, # Filtros cruzados } - -# Timeout de queries (30s por default, aumentar para análises pesadas) -SUPERSET_WEBSERVER_TIMEOUT = 300 - -# Cache (Redis se disponível, senão in-memory) -CACHE_CONFIG = { - "CACHE_TYPE": "SimpleCache", - "CACHE_DEFAULT_TIMEOUT": 300, # 5 min -} - -# Tema/branding Arcádia (logo, cores) -APP_NAME = "Arcádia Insights" -APP_ICON = "/static/arcadia-logo.png" ``` -### 4.3 Init Script do Superset +--- + +## 5. SEGURANÇA + +### 5.1 ArcadiaSecurityManager + +- Extrai JWT do header `Authorization: Bearer ` +- Identifica tenant do payload JWT (`tenant_id`) +- Aplica RLS automaticamente via `SET LOCAL app.current_tenant` +- Mapeia roles: superadmin→Admin, admin→Alpha, analyst→Gamma, viewer→Public + +### 5.2 Row Level Security (RLS) + +```sql +-- Política aplicada automaticamente +SET LOCAL app.current_tenant = ; + +-- Views filtram por tenant +CREATE VIEW tenant_data AS +SELECT * FROM data +WHERE tenant_id = current_setting('app.current_tenant')::int; +``` + +--- + +## 6. CLIENTE TYPESCRIPT + +### 6.1 Uso Básico + +```typescript +import { metasetClient } from "./server/bi/metaset-client"; + +// Health check +const health = await metasetClient.isHealthy(); + +// Listar dashboards +const dashboards = await metasetClient.listDashboards(); + +// Executar query +const result = await metasetClient.executeSql(1, "SELECT * FROM sales LIMIT 100"); + +// Criar dashboard +const dashboard = await metasetClient.createDashboard({ + name: "Vendas Q1 2026", + description: "Dashboard de vendas" +}); + +// Guest token para embedding +const token = await metasetClient.createGuestToken({ + resources: [{ type: "dashboard", id: "1" }], + rls: [{ dataset: 1, clause: "tenant_id = 123" }] +}); +``` + +### 6.2 Ferramentas do Manus (Agente IA) + +| Ferramenta | Descrição | +|------------|-----------| +| `metaset.query` | Executa SQL | +| `metaset.list_tables` | Lista tabelas | +| `metaset.table_fields` | Campos da tabela | +| `metaset.create_chart` | Cria gráfico | +| `metaset.list_charts` | Lista gráficos | +| `metaset.create_dashboard` | Cria dashboard | +| `metaset.list_dashboards` | Lista dashboards | +| `metaset.suggest_analysis` | Sugere análises | +| `metaset.sync_database` | Sincroniza schema | +| `metaset.health` | Verifica status | + +--- + +## 7. DEPLOYMENT + +### 7.1 Docker Compose + +```yaml +services: + metaset: + build: ./server/bi/metaset + ports: + - "8100:8100" + environment: + - DATABASE_URL=postgresql://arcadia:arcadia123@db:5432/metaset_db + - REDIS_URL=redis://redis:6379/1 + labels: + - "arcadia.discovery.enabled=true" + - "arcadia.name=MetaSet BI" + - "arcadia.type=python" + - "arcadia.port=8100" + - "arcadia.capabilities=dashboards,charts,sql_lab,rls,embedding" +``` + +### 7.2 Inicialização ```bash -#!/bin/bash -# docker/superset/init.sh — roda ao iniciar o container +# Via docker compose +docker compose up metaset -set -e - -echo "[Superset Init] Iniciando configuração..." - -# Aguarda PostgreSQL -until psql "${DATABASE_URL}" -c "SELECT 1" > /dev/null 2>&1; do - echo "[Superset Init] Aguardando PostgreSQL..." - sleep 2 -done - -# Cria banco arcadia_superset se não existir -psql "postgresql://${PGUSER:-arcadia}:${PGPASSWORD:-arcadia123}@db:5432/postgres" \ - -c "CREATE DATABASE arcadia_superset OWNER arcadia;" 2>/dev/null || true - -# Inicializa banco do Superset -superset db upgrade - -# Cria usuário admin (só se não existir) -superset fab create-admin \ - --username "${SUPERSET_ADMIN_USER:-admin}" \ - --firstname "Arcádia" \ - --lastname "Admin" \ - --email "${SUPERSET_ADMIN_EMAIL:-admin@arcadia.app}" \ - --password "${SUPERSET_ADMIN_PASSWORD:-arcadia2026}" 2>/dev/null || true - -# Carrega exemplos (opcional, comentar em prod) -# superset load_examples - -# Inicializa roles e permissões -superset init - -# Registra conexão com o banco Arcádia (dados do SOE) -python - <<'PYEOF' -from superset import create_app -from superset.extensions import db -from superset.models.core import Database -import os - -app = create_app() -with app.app_context(): - existing = db.session.query(Database).filter_by( - database_name="Arcádia Suite" - ).first() - if not existing: - arcadia_db = Database( - database_name="Arcádia Suite", - sqlalchemy_uri=os.environ.get( - "ARCADIA_DATABASE_URL", - "postgresql://arcadia:arcadia123@db:5432/arcadia" - ), - expose_in_sqllab=True, - allow_run_async=True, - allow_csv_upload=False, - ) - db.session.add(arcadia_db) - db.session.commit() - print("[Superset Init] Banco 'Arcádia Suite' registrado!") - else: - print("[Superset Init] Banco 'Arcádia Suite' já existe.") -PYEOF - -echo "[Superset Init] Iniciando servidor..." -gunicorn \ - --bind "0.0.0.0:${SUPERSET_WEBSERVER_PORT:-8088}" \ - --access-logfile "-" \ - --error-logfile "-" \ - --workers 4 \ - --timeout 120 \ - --limit-request-line 0 \ - --limit-request-field_size 0 \ - "superset.app:create_app()" -``` - -### 4.4 Proxy Superset (substitui server/metabase/proxy.ts) - -```typescript -// server/superset/proxy.ts - -import { Express, Response } from "express"; -import { createProxyMiddleware } from "http-proxy-middleware"; - -const SUPERSET_HOST = process.env.SUPERSET_HOST || "localhost"; -const SUPERSET_PORT = parseInt(process.env.SUPERSET_PORT || "8088", 10); -const SUPERSET_TIMEOUT = 60000; - -export function setupSupersetProxy(app: Express): void { - const target = `http://${SUPERSET_HOST}:${SUPERSET_PORT}`; - - const supersetProxy = createProxyMiddleware({ - target, - changeOrigin: true, - timeout: SUPERSET_TIMEOUT, - proxyTimeout: SUPERSET_TIMEOUT, - pathRewrite: { "^/superset": "" }, - on: { - error: (err, _req, res) => { - console.error("[Superset Proxy] Error:", err.message); - if (res && typeof (res as Response).status === "function") { - (res as Response).status(502).json({ - error: "Superset indisponível", - message: "O Superset está iniciando. Tente novamente em alguns segundos.", - target, - }); - } - }, - proxyRes: (proxyRes) => { - const location = proxyRes.headers["location"]; - if (location && typeof location === "string" && location.startsWith("/")) { - proxyRes.headers["location"] = `/superset${location}`; - } - }, - }, - }); - - app.use("/superset", supersetProxy); - console.log(`[Superset Proxy] Configurado -> /superset/* => ${target}`); -} -``` - -### 4.5 Rotas Superset — Guest Token para Embedding - -Esta é a peça-chave para "funcionar em qualquer tela": - -```typescript -// server/superset/routes.ts - -import type { Express, Request, Response } from "express"; - -const SUPERSET_HOST = process.env.SUPERSET_HOST || "localhost"; -const SUPERSET_PORT = parseInt(process.env.SUPERSET_PORT || "8088", 10); -const SUPERSET_URL = `http://${SUPERSET_HOST}:${SUPERSET_PORT}`; -const SUPERSET_ADMIN_USER = process.env.SUPERSET_ADMIN_USER || "admin"; -const SUPERSET_ADMIN_PASS = process.env.SUPERSET_ADMIN_PASSWORD || "arcadia2026"; - -// Cache do token de serviço (expira em 50 min) -let serviceToken: string | null = null; -let serviceTokenExpiry = 0; - -async function getServiceToken(): Promise { - if (serviceToken && Date.now() < serviceTokenExpiry) return serviceToken; - - const resp = await fetch(`${SUPERSET_URL}/api/v1/security/login`, { - method: "POST", - headers: { "Content-Type": "application/json" }, - body: JSON.stringify({ - username: SUPERSET_ADMIN_USER, - password: SUPERSET_ADMIN_PASS, - provider: "db", - refresh: true, - }), - }); - - if (!resp.ok) throw new Error("Falha ao autenticar no Superset"); - const data = await resp.json(); - serviceToken = data.access_token; - serviceTokenExpiry = Date.now() + 50 * 60 * 1000; // 50 min - return serviceToken!; -} - -export function registerSupersetRoutes(app: Express): void { - - // Guest Token — para embedding em qualquer tela - // O frontend chama este endpoint para obter um token temporário - // e renderiza o dashboard via @superset-ui/embedded-sdk - app.post("/api/superset/guest-token", async (req: Request, res: Response) => { - try { - if (!req.isAuthenticated()) return res.status(401).json({ error: "Not authenticated" }); - - const { dashboardId } = req.body; - if (!dashboardId) return res.status(400).json({ error: "dashboardId obrigatório" }); - - const token = await getServiceToken(); - - // Solicita guest token ao Superset - const guestResp = await fetch(`${SUPERSET_URL}/api/v1/security/guest_token/`, { - method: "POST", - headers: { - "Content-Type": "application/json", - "Authorization": `Bearer ${token}`, - }, - body: JSON.stringify({ - user: { - username: `arcadia_${req.user?.id}`, - first_name: req.user?.name?.split(" ")[0] || "User", - last_name: req.user?.name?.split(" ")[1] || "", - }, - resources: [{ type: "dashboard", id: dashboardId }], - rls: [], // Row Level Security (futuro: por tenantId) - }), - }); - - if (!guestResp.ok) { - const err = await guestResp.text(); - return res.status(502).json({ error: "Falha ao gerar guest token", detail: err }); - } - - const { token: guestToken } = await guestResp.json(); - res.json({ token: guestToken, supersetUrl: "/superset" }); - } catch (err: any) { - res.status(502).json({ error: err.message }); - } - }); - - // Lista dashboards disponíveis (para o seletor na UI) - app.get("/api/superset/dashboards", async (req: Request, res: Response) => { - try { - if (!req.isAuthenticated()) return res.status(401).json({ error: "Not authenticated" }); - - const token = await getServiceToken(); - const resp = await fetch(`${SUPERSET_URL}/api/v1/dashboard/?q=(order_column:changed_on_delta_humanized,order_direction:desc)`, { - headers: { "Authorization": `Bearer ${token}` }, - }); - - if (!resp.ok) return res.status(502).json({ error: "Superset indisponível" }); - const data = await resp.json(); - res.json(data.result || []); - } catch (err: any) { - res.status(502).json({ error: err.message }); - } - }); - - // Health check - app.get("/api/superset/health", async (_req: Request, res: Response) => { - try { - const resp = await fetch(`${SUPERSET_URL}/health`); - res.json({ online: resp.ok, url: SUPERSET_URL }); - } catch { - res.json({ online: false, url: SUPERSET_URL }); - } - }); -} -``` - -### 4.6 Componente React — SupersetDashboard (reutilizável em QUALQUER tela) - -```typescript -// client/src/components/SupersetDashboard.tsx - -import { useEffect, useRef, useState } from "react"; -import { embedDashboard } from "@superset-ui/embedded-sdk"; - -interface SupersetDashboardProps { - dashboardId: string; - height?: string | number; - className?: string; -} - -export function SupersetDashboard({ - dashboardId, - height = "calc(100vh - 300px)", - className = "", -}: SupersetDashboardProps) { - const containerRef = useRef(null); - const [error, setError] = useState(null); - const [loading, setLoading] = useState(true); - - useEffect(() => { - if (!containerRef.current) return; - - let mounted = true; - setLoading(true); - setError(null); - - embedDashboard({ - id: dashboardId, - supersetDomain: window.location.origin + "/superset", - mountPoint: containerRef.current, - - // Busca guest token do gateway Arcádia - fetchGuestToken: async () => { - const resp = await fetch("/api/superset/guest-token", { - method: "POST", - headers: { "Content-Type": "application/json" }, - body: JSON.stringify({ dashboardId }), - credentials: "include", - }); - if (!resp.ok) throw new Error("Falha ao obter token"); - const { token } = await resp.json(); - return token; - }, - - dashboardUiConfig: { - hideTitle: true, // Título próprio no Arcádia - hideChartControls: false, // Manter controles de chart - filters: { - visible: true, // Mostrar filtros - expanded: false, - }, - }, - }).then(() => { - if (mounted) setLoading(false); - }).catch((err) => { - if (mounted) { - setError(err.message); - setLoading(false); - } - }); - - return () => { mounted = false; }; - }, [dashboardId]); - - if (error) { - return ( -
- Superset indisponível: {error} -
- ); - } - - return ( -
- {loading && ( -
-
-
-

Carregando Arcádia Insights...

-
-
- )} -
-
- ); -} -``` - -**Uso em QUALQUER página:** -```tsx -// Exemplo: na página /financeiro -import { SupersetDashboard } from "@/components/SupersetDashboard"; - -// Dashboard financeiro embeddado diretamente no módulo Financeiro - - -// Exemplo: na página /contabil - - -// Exemplo: no Dashboard principal (/) - -``` - -### 4.7 BiWorkspace.tsx — Advanced tab (única mudança na UI) - -```tsx -// Substituir a tab Advanced (linhas 2918-2945) - - -
-
-
-

Arcádia Insights — Apache Superset

-

- SQL Lab avançado, 50+ tipos de gráfico, dashboards interativos -

-
- - Abrir em Nova Aba - -
- - {/* Dashboard selecionável */} - -
-
+# Ou diretamente +cd server/bi/metaset +python run.py --host 0.0.0.0 --port 8100 --workers 2 ``` --- -## 5. TABELAS E VARIÁVEIS +## 8. HISTÓRICO DE MUDANÇAS -### 5.1 Nenhuma tabela nova no schema Arcádia - -O Superset usa seu próprio banco (`arcadia_superset`) para metadados internos. As tabelas do Arcádia não mudam. - -### 5.2 Novas variáveis de ambiente - -```bash -# .env — adicionar/substituir: - -# Superset (substitui METABASE_*) -SUPERSET_HOST=superset # nome do container Docker -SUPERSET_PORT=8088 -SUPERSET_SECRET_KEY= # gerar: openssl rand -hex 32 -SUPERSET_ADMIN_USER=admin -SUPERSET_ADMIN_EMAIL=admin@arcadia.app -SUPERSET_ADMIN_PASSWORD= # senha forte em prod - -# URL do banco Arcádia para o Superset acessar (read-only ideal) -ARCADIA_DATABASE_URL=postgresql://arcadia_ro:pass@db:5432/arcadia - -# Remover (não são mais necessários): -# METABASE_HOST -# METABASE_PORT -# METASET_ADMIN_EMAIL -# METASET_ADMIN_PASSWORD -``` +| Data | Versão | Mudança | +|------|--------|---------| +| 2026-03 | 1.0 | Plano inicial de migração Metabase → Superset | +| 2026-04-08 | 2.0 | **Consolidação concluída** - Cliente TypeScript, rotas, documentação | --- -## 6. ROADMAP — Fases de Implementação +## 9. REFERÊNCIAS -### Fase 1 — Infraestrutura (2-3 dias) -``` -[ ] Criar docker/superset/superset_config.py -[ ] Criar docker/superset/init.sh -[ ] Atualizar docker-compose.yml (expandir seção superset existente) -[ ] Adicionar volumes: superset_home no docker-compose -[ ] Testar: docker compose --profile bi up superset -[ ] Verificar: banco arcadia_superset criado, admin funciona, :8088 acessível -``` - -### Fase 2 — Gateway (1-2 dias) -``` -[ ] Criar server/superset/proxy.ts (substitui server/metabase/proxy.ts) -[ ] Criar server/superset/routes.ts (guest token, lista dashboards, health) -[ ] Registrar no server/routes.ts: setupSupersetProxy() + registerSupersetRoutes() -[ ] Remover/comentar setupMetabaseProxy() e registerMetaSetRoutes() -[ ] Testar: GET /api/superset/health → { online: true } -[ ] Testar: POST /api/superset/guest-token → token JWT -``` - -### Fase 3 — Frontend (2-3 dias) -``` -[ ] npm install @superset-ui/embedded-sdk -[ ] Criar client/src/components/SupersetDashboard.tsx -[ ] Atualizar BiWorkspace.tsx Advanced tab (substituir iframe MetaSet) -[ ] Testar: dashboard embeddado na Advanced tab -[ ] Criar 3 dashboards base no Superset: - - executive-summary (KPIs gerais) - - financial-overview (Financeiro) - - dre-mensal (DRE) -``` - -### Fase 4 — Embedding em outras telas (1 semana) -``` -[ ] Embedar SupersetDashboard no /financeiro (tab Análise) -[ ] Embedar SupersetDashboard no /contabil (tab DRE/Balanço) -[ ] Embedar SupersetDashboard no SOE (tab Dashboard) -[ ] Embedar SupersetDashboard no Home / Dashboard principal -[ ] RLS por tenantId (Row Level Security nos dashboards) -``` - -### Fase 5 — Migração de dashboards (conforme necessário) -``` -[ ] Recriar no Superset os dashboards que existiam no MetaSet (se houver) -[ ] Configurar alertas automáticos (Superset Alerts & Reports) -[ ] Criar dashboards para cada domínio do SOE: - - Vendas, Compras, Fiscal, Pessoas, Estoque -``` - ---- - -## 7. DIAGRAMA BI ATUALIZADO (completo) - -``` -┌────────────────────────────────────────────────────────────────────┐ -│ ARCÁDIA BI STACK v2 │ -│ │ -│ ┌──────────────────────────────────────────────────────────────┐ │ -│ │ FRONTEND REACT — Pode usar em QUALQUER rota │ │ -│ │ │ │ -│ │ BiWorkspace.tsx → 8 tabs (7 iguais + Advanced=Superset) │ │ -│ │ → componente reutilizável │ │ -│ │ Guest Token API → /api/superset/guest-token │ │ -│ └────────────────────────────┬─────────────────────────────────┘ │ -│ │ │ -│ ┌─────────────────────┼──────────────────────┐ │ -│ │ │ │ │ -│ ┌──────▼──────┐ ┌────────▼───────┐ ┌─────────▼──────────┐ │ -│ │ API BI │ │ BI Engine │ │ Apache Superset │ │ -│ │ (Node.js) │ │ Python:8004 │ │ Python:8088 │ │ -│ │ sem mudança│ │ sem mudança │ │ │ │ -│ │ │ │ │ │ SQL Lab │ │ -│ │ CRUD │ │ SQL+Charts │ │ 50+ chart types │ │ -│ │ Upload/ETL │ │ Micro-BI │ │ Guest Token (embed) │ │ -│ │ Staging │ │ Análise Pandas │ │ Alerts & Reports │ │ -│ │ Backups │ │ Cache 5min │ │ REST API v1 │ │ -│ └─────┬───────┘ └────────┬───────┘ └─────────┬───────────┘ │ -│ │ │ │ │ -│ └──────────────────────┼─────────────────────┘ │ -│ │ │ -│ ┌──────────▼──────────┐ │ -│ │ PostgreSQL │ │ -│ │ │ │ -│ │ arcadia │ ← Dados SOE (read-only) │ -│ │ arcadia_superset │ ← Metadados Superset │ -│ └────────────────────┘ │ -│ │ -│ ┌──────────────────────────────────────────────────────────────┐ │ -│ │ CIENTISTA (Python) — IA/ML: análise, padrões, insights │ │ -│ │ ASSISTENTE BI (GPT) — chat sobre dados │ │ -│ │ (ambos sem mudança) │ │ -│ └──────────────────────────────────────────────────────────────┘ │ -└────────────────────────────────────────────────────────────────────┘ -``` - ---- - -## 8. RESUMO — O que muda, o que fica - -| Componente | Ação | Esforço | -|---|---|---| -| `server/metabase/proxy.ts` | Substituir por `server/superset/proxy.ts` | 30 min | -| `server/metaset/routes.ts` | Substituir por `server/superset/routes.ts` | 2h | -| `server/metaset/client.ts` | Remover (lógica vai para routes.ts) | 5 min | -| `docker-compose.yml` Superset | Expandir configuração existente | 1h | -| `docker/superset/superset_config.py` | Criar (novo arquivo) | 30 min | -| `docker/superset/init.sh` | Criar (novo arquivo) | 1h | -| `BiWorkspace.tsx` Advanced tab | Substituir iframe MetaSet | 1h | -| `SupersetDashboard.tsx` | Criar componente (novo) | 2h | -| `npm install @superset-ui/embedded-sdk` | Instalar dependência | 5 min | -| BI Engine Python (:8004) | **Não muda nada** | — | -| API BI Node /api/bi/* | **Não muda nada** | — | -| Upload/ETL/Staging | **Não muda nada** | — | -| 7 tabs do BiWorkspace | **Não muda nada** | — | -| Tabelas do banco | **Não muda nada** | — | - -**Total estimado: 1-2 dias de implementação real** (a infra já está 80% pronta). - ---- - -## 9. VANTAGEM ESTRATÉGICA - -> O Apache Superset não é apenas "trocar Metabase". -> -> É a virada de chave que permite que o BI deixe de ser uma página separada -> e vire um **componente vivo** que aparece **dentro de cada módulo do Arcádia**: -> -> - O usuário está no módulo Financeiro → vê o dashboard financeiro ali mesmo -> - O usuário está no módulo Contábil → vê o DRE ali mesmo -> - O usuário está no SOE → vê os KPIs do negócio ali mesmo -> -> Sem abrir nova aba. Sem sair do contexto. Sem re-autenticar. -> O Superset renderiza no lugar exato onde o usuário está. - ---- - -*PLANO_BI_SUPERSET.md — Arcádia Suite v3.0* -*Gerado em: 2026-03-16 — Baseado na análise do MAPA_BI_ARCADIA.md (Replit) + código real* +- `/server/metaset/README.md` - Documentação completa do MetaSet +- `/server/bi/metaset-client/index.ts` - Cliente TypeScript +- `/server/bi/metaset-client/routes.ts` - Rotas Express +- [Apache Superset Docs](https://superset.apache.org/docs/) +- [Superset API Reference](https://superset.apache.org/docs/api/) diff --git a/docs/KERNEL_SPEC.md b/docs/KERNEL_SPEC.md index 78d6d75..a429803 100644 --- a/docs/KERNEL_SPEC.md +++ b/docs/KERNEL_SPEC.md @@ -312,7 +312,7 @@ services: - "arcadia.type=python" - "arcadia.category=bi" - "arcadia.port=8100" - - "arcadia.capabilities=dashboards,charts,sql_lab" + - "arcadia.capabilities=dashboards,charts,sql_lab,rls,embedding" ``` --- @@ -351,6 +351,7 @@ services: | 2026-04-07 | 3.1 | Integração Casa de Máquinas | | 2026-04-08 | 3.2 | Coolify Discovery, XOS Discovery, correção MetaSet | | 2026-04-08 | 3.3 | **Registry Global** - Casa de Máquinas usa acesso direto (memória) em vez de HTTP | +| 2026-04-08 | 3.4 | **MetaSet Consolidado** - Migração Metabase → Apache Superset 4.1.0 | ---