Go to file
Luis 1391fe6216 feat: enhance Google Calendar integration and update Dockerfile for environment variables
- Updated Dockerfile to include hardcoded environment variables for Next.js build.
- Enhanced Google Calendar API integration by extracting user email from id_token and adding scopes for OpenID and email access.
- Modified credential management to delete existing credentials before creating new ones in n8n.
- Updated dashboard to display connected Google Calendar email and credential details.

Story: 4.2 - Melhorar integração com Google Calendar e atualizar Dockerfile

🤖 Generated with [Claude Code](https://claude.com/claude-code)
2025-10-12 21:16:21 -03:00
.bmad-core Initial commit from Create Next App 2025-10-05 21:17:43 -03:00
.claude Initial commit from Create Next App 2025-10-05 21:17:43 -03:00
.playwright-mcp feat: enhance Google Calendar integration and update Dockerfile for environment variables 2025-10-12 21:16:21 -03:00
app feat: enhance Google Calendar integration and update Dockerfile for environment variables 2025-10-12 21:16:21 -03:00
components feat: enhance Google Calendar integration and update Dockerfile for environment variables 2025-10-12 21:16:21 -03:00
docs feat: enhance Google Calendar integration and update Dockerfile for environment variables 2025-10-12 21:16:21 -03:00
k8s feat: enhance Google Calendar integration and update Dockerfile for environment variables 2025-10-12 21:16:21 -03:00
lib feat: enhance Google Calendar integration and update Dockerfile for environment variables 2025-10-12 21:16:21 -03:00
public Initial commit from Create Next App 2025-10-05 21:17:43 -03:00
scripts feat: enhance Google Calendar integration and update Dockerfile for environment variables 2025-10-12 21:16:21 -03:00
supabase feat: add n8n API testing script for Google OAuth2 schema and existing credentials 2025-10-10 14:29:02 -03:00
tmp feat: enhance Google Calendar integration and update Dockerfile for environment variables 2025-10-12 21:16:21 -03:00
types feat: add n8n API testing script for Google OAuth2 schema and existing credentials 2025-10-10 14:29:02 -03:00
.dockerignore feat: add Dockerfile and Kubernetes manifests for deployment 2025-10-12 19:57:26 -03:00
.gitignore Initial commit from Create Next App 2025-10-05 21:17:43 -03:00
.mcp.json feat: enhance Google Calendar integration and update Dockerfile for environment variables 2025-10-12 21:16:21 -03:00
biome.json feat: add n8n API testing script for Google OAuth2 schema and existing credentials 2025-10-10 14:29:02 -03:00
Dockerfile feat: enhance Google Calendar integration and update Dockerfile for environment variables 2025-10-12 21:16:21 -03:00
GOOGLE_OAUTH_SETUP.md feat: add n8n API testing script for Google OAuth2 schema and existing credentials 2025-10-10 14:29:02 -03:00
image copy.png feat: add n8n API testing script for Google OAuth2 schema and existing credentials 2025-10-10 14:29:02 -03:00
image.png feat: add n8n API testing script for Google OAuth2 schema and existing credentials 2025-10-10 14:29:02 -03:00
middleware.ts feat: add n8n API testing script for Google OAuth2 schema and existing credentials 2025-10-10 14:29:02 -03:00
next.config.ts feat: add Dockerfile and Kubernetes manifests for deployment 2025-10-12 19:57:26 -03:00
package-lock.json feat: add n8n API testing script for Google OAuth2 schema and existing credentials 2025-10-10 14:29:02 -03:00
package.json feat: add n8n API testing script for Google OAuth2 schema and existing credentials 2025-10-10 14:29:02 -03:00
postcss.config.mjs Initial commit from Create Next App 2025-10-05 21:17:43 -03:00
README-DEPLOY.md feat: add Dockerfile and Kubernetes manifests for deployment 2025-10-12 19:57:26 -03:00
README.md feat: add n8n API testing script for Google OAuth2 schema and existing credentials 2025-10-10 14:29:02 -03:00
tsconfig.json Initial commit from Create Next App 2025-10-05 21:17:43 -03:00
vitest.config.ts feat: add n8n API testing script for Google OAuth2 schema and existing credentials 2025-10-10 14:29:02 -03:00
vitest.setup.ts feat: add n8n API testing script for Google OAuth2 schema and existing credentials 2025-10-10 14:29:02 -03:00

AutomatizaSE Portal

Portal web para gerenciamento de conexões WhatsApp (EvolutionAPI) e autorização OAuth do Google Calendar.

Setup

  1. Clone o repositório
  2. Copie .env.local.example para .env.local
  3. Preencha as variáveis de ambiente
  4. Configure o Supabase (veja seção abaixo)
  5. Instale dependências: npm install
  6. Rode o servidor: npm run dev
  7. Acesse: http://localhost:3000

Configuração do Supabase

1. Criar Schema e Tabelas

No Supabase Dashboard, vá em SQL Editor e execute o script:

docs/sql/01-schema-portal.sql

Este script irá:

  • Criar o schema portal
  • Criar tabelas user_settings e integrations
  • Habilitar Row Level Security (RLS)
  • Configurar políticas de acesso

2. Configurar SMTP para Autenticação

No Supabase Dashboard:

  1. Vá em Authentication → Email Templates → SMTP Settings
  2. Configure:

3. Testar Conexão

Após configurar, acesse: http://localhost:3000/test-supabase

Se tudo estiver correto, você verá: Supabase connected successfully!

Tech Stack

  • NextJS 14+ (App Router)
  • TailwindCSS v4
  • Supabase (Auth + Database)
  • TypeScript

Variáveis de Ambiente

Veja o arquivo .env.local.example para todas as variáveis necessárias:

  • Supabase: URL e chaves de API
  • EvolutionAPI: URL, API key e nomes de instâncias
  • n8n: URL do webhook OAuth
  • Site: URL pública do site

Estrutura do Projeto

/app            - Páginas e rotas da aplicação
/components     - Componentes React reutilizáveis
/lib            - Bibliotecas e utilitários
/types          - Definições de tipos TypeScript
/hooks          - React hooks customizados
/services       - Camada de serviços

Scripts Disponíveis

npm run dev      # Inicia servidor de desenvolvimento
npm run build    # Build de produção
npm run start    # Inicia servidor de produção
npm run lint     # Executa linting
npm run format   # Formata código

Tema Escuro

O projeto usa tema escuro por padrão. Todas as cores estão centralizadas no arquivo app/globals.css. Para alterar as cores do projeto inteiro, basta editar as variáveis CSS em :root.