Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
fc32170
Add Vercel Web Analytics to Next.js
vercel[bot] Dec 10, 2025
7ddd2d1
Merge pull request #1 from Marcelo-Rosas/vercel/vercel-web-analytics-…
Marcelo-Rosas Dec 14, 2025
8fe9303
Fix React Server Components CVE vulnerabilities
vercel[bot] Dec 19, 2025
5412a89
Merge pull request #2 from Marcelo-Rosas/vercel/react-server-componen…
Marcelo-Rosas Dec 19, 2025
48acb2e
Fix Meta limits fetch parameters
Marcelo-Rosas Dec 21, 2025
1c9fea6
Merge pull request #3 from Marcelo-Rosas/codex/corrigir-problema-de-c…
Marcelo-Rosas Dec 21, 2025
653524c
Configuração pronta para deploy
Marcelo-Rosas Dec 22, 2025
476cd55
feat: Add WhatsApp testing and migration scripts, and update environm…
Marcelo-Rosas Dec 22, 2025
52c496d
feat: Add Docker Compose configurations for production and debug envi…
Marcelo-Rosas Dec 22, 2025
47fd700
feat: add whatsapp diagnostic script
Marcelo-Rosas Dec 22, 2025
6da9a70
fix: sync package-lock with package.json
Marcelo-Rosas Dec 28, 2025
ca0c85c
chore(lint): align typescript-eslint and pin typescript for eslint co…
Marcelo-Rosas Dec 28, 2025
6cc2874
chore(lint): garantir lint estável para Next 16
Marcelo-Rosas Dec 28, 2025
e58121d
chore: atualizar dependências
Marcelo-Rosas Dec 28, 2025
2878912
fix: align AI SDK versions; setup ESLint flat config; lint fixes; add…
Marcelo-Rosas Dec 28, 2025
808115b
refactor: optimize post-completion window check and sidebar skeleton …
Marcelo-Rosas Dec 28, 2025
f7d5570
fix(realtime): make pollCount single source of truth; remove ref; als…
Marcelo-Rosas Dec 28, 2025
503e36d
merge: resolve package conflicts with remote
Marcelo-Rosas Dec 28, 2025
eb1eeff
fix(vercel): add missing @vercel/analytics; remove deprecated config
Marcelo-Rosas Dec 28, 2025
97c0713
feat: add Supabase Auth password reset flow
Marcelo-Rosas Dec 29, 2025
25f4b22
fix: improve auth callback to always redirect to reset-password
Marcelo-Rosas Dec 29, 2025
0a29fe6
Update test.yml
Marcelo-Rosas Dec 29, 2025
5af40f4
minhas alterações
Marcelo-Rosas Jan 17, 2026
bb77584
Update .env.example
Marcelo-Rosas Jan 17, 2026
8349680
Update .env.example
Marcelo-Rosas Jan 17, 2026
e35175d
Update .env.example
Marcelo-Rosas Jan 17, 2026
1cae3b0
Update .env.example
Marcelo-Rosas Jan 17, 2026
1dfbe7e
Update .env.example
Marcelo-Rosas Jan 17, 2026
1d59b9f
Update .env.example
Marcelo-Rosas Jan 17, 2026
5f1ec3e
Update .env.example
Marcelo-Rosas Jan 17, 2026
5f1f4f2
Update .env.example
Marcelo-Rosas Jan 17, 2026
1854c93
Update .env.example
Marcelo-Rosas Jan 17, 2026
f4ca7f0
Update .env.example
Marcelo-Rosas Jan 18, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
86 changes: 31 additions & 55 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,58 +1,34 @@
# ===========================================
# SmartZap - Next.js + Upstash Workflow v2.0
# ===========================================

# ----- SECURITY (Required for Production) -----
# Generate with: openssl rand -base64 32
# API Key for general API access
SMARTZAP_API_KEY=szap_your_generated_api_key_here

# Admin Key for sensitive operations (database, redeploy)
SMARTZAP_ADMIN_KEY=szap_admin_your_admin_key_here

# Allowed frontend origin for CORS (defaults to Vercel URL)
FRONTEND_URL=https://your-app.vercel.app

# ----- UPSTASH (Required for Production) -----
# Get these from: https://console.upstash.com
UPSTASH_REDIS_REST_URL=https://xxx.upstash.io
UPSTASH_REDIS_REST_TOKEN=xxx

# QStash is required for Upstash Workflow
# Get from: https://console.upstash.com/qstash
QSTASH_TOKEN=xxx
QSTASH_CURRENT_SIGNING_KEY=xxx
QSTASH_NEXT_SIGNING_KEY=xxx

# ----- WHATSAPP API -----
# From Meta Business Settings: https://business.facebook.com
WHATSAPP_TOKEN=your_access_token
WHATSAPP_PHONE_ID=your_phone_number_id
WHATSAPP_BUSINESS_ACCOUNT_ID=your_business_account_id
WHATSAPP_VERIFY_TOKEN=my_verify_token

# ----- AI (Optional) -----
# For AI-generated templates
GEMINI_API_KEY=your_gemini_api_key

# ----- DATABASE -----
# Choose your database provider: 'turso' or 'supabase'
# ------------------------------------------------------------
# 🔐 SEGURANÇA / ADMIN (Recomendado)
# ------------------------------------------------------------

# Senha do painel (login). É a "senha mestra" do SmartZap.
# - Local: defina aqui no .env.local
# - Vercel: o wizard salva como variável de ambiente

MASTER_PASSWORD=Vectra@179mr$$$HUB

AUTH_SECRET=jaVBVCWDNboM0ctLGYlYpGkp3sFD/MukA3ytSaTe3E4=

SMARTZAP_ADMIN_KEY=Vectra@179mr

# (opcional mas recomendado)
SMARTZAP_API_KEY=Vectra@179mr$$

# ===== Banco (Supabase) =====
DATABASE_PROVIDER=supabase
NEXT_PUBLIC_SUPABASE_URL=https://bfxovdgjgoijwkekbftl.supabase.co
NEXT_PUBLIC_SUPABASE_ANON_KEY==eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImJmeG92ZGdqZ29pandrZWtiZnRsIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NjU3NTg5MDQsImV4cCI6MjA4MTMzNDkwNH0.aPbtNP_pAkmBGdSrdi4VqqvkxrVTTPivu2bo-F4ckZ8
NEXT_PUBLIC_SUPABASE_PUBLISHABLE_DEFAULT_KEY=sb_secret_nFBQ7_EGAtnsSJF_x2jFXA_yCXbJQHU

# ===== Upstash Redis (obrigatório p/ workflows) =====
UPSTASH_REDIS_REST_URL=https://ready-sunbird-10099.upstash.io
UPSTASH_REDIS_REST_TOKEN=ASdzAAIncDI3YWZjZTM0MmE1OWQ0ODJhYjgyNDZlYzU1Y2I5NWNlMXAyMTAwOTk

# ===== QStash (obrigatório p/ workflows) =====
QSTASH_URL="https://qstash.upstash.io"
QSTASH_TOKEN=eyJVc2VySUQiOiIwZjNlNTY5Ny01NWYxLTQ0ZjItOWJiYS05OWNjOWU5OWM1MDMiLCJQYXNzd29yZCI6IjNiNmZlMDNmMDJhZDQ0ZGI5YzA2Y2VkYTU2Y2NjYjk1In0=
QSTASH_CURRENT_SIGNING_KEY=sig_6F8RbNs8QXBjqzuN4h7SpXKgHMfX
QSTASH_NEXT_SIGNING_KEY=sig_5rhRMUtxzFDeqdV1YkZhCLzayuP7

# Turso (SQLite - legacy)
TURSO_DATABASE_URL=libsql://your-database.turso.io
TURSO_AUTH_TOKEN=your_turso_auth_token

# Supabase (PostgreSQL - recommended)
NEXT_PUBLIC_SUPABASE_URL=https://your-project.supabase.co
NEXT_PUBLIC_SUPABASE_ANON_KEY=your_anon_key
SUPABASE_SERVICE_ROLE_KEY=your_service_role_key

# ----- Vercel / App URL -----
# NEXT_PUBLIC_APP_URL is optional. If not set, the system will auto-detect:
# 1. VERCEL_PROJECT_PRODUCTION_URL (stable production domain, auto-set by Vercel)
# 2. VERCEL_URL (deployment-specific URL, auto-set by Vercel)
#
# Only set this manually if you have a custom domain:
# NEXT_PUBLIC_APP_URL=https://your-custom-domain.com

6 changes: 6 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
node_modules
.next
dist
coverage
.next/standalone
.next/cache
16 changes: 16 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/** @type {import("eslint").Linter.Config} */
module.exports = {
extends: ["next/core-web-vitals"],
parser: "@typescript-eslint/parser",
plugins: ["@typescript-eslint"],
parserOptions: {
ecmaVersion: "latest",
sourceType: "module",
project: ["./tsconfig.json"],
tsconfigRootDir: __dirname,
},
rules: {
"react/no-unescaped-entities": "off",
"@typescript-eslint/no-explicit-any": "off",
},
};
9 changes: 9 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"extends": ["next/core-web-vitals"],
"plugins": ["@typescript-eslint"],
"parser": "@typescript-eslint/parser",
Comment on lines +1 to +4

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion | 🟠 Major

Add TypeScript parser options for better type-aware linting.

The ESLint configuration is missing parserOptions for the TypeScript parser. This limits the effectiveness of type-aware lint rules.

🔎 Proposed enhancement
 {
   "extends": ["next/core-web-vitals"],
   "plugins": ["@typescript-eslint"],
   "parser": "@typescript-eslint/parser",
+  "parserOptions": {
+    "ecmaVersion": "latest",
+    "sourceType": "module",
+    "project": "./tsconfig.json"
+  },
   "rules": {
     "react/no-unescaped-entities": "off",
     "@typescript-eslint/no-explicit-any": "off"
   }
 }

Note: Including "project": "./tsconfig.json" enables type-aware linting rules but may slow down linting. If performance is a concern, you can omit it.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
{
"extends": ["next/core-web-vitals"],
"plugins": ["@typescript-eslint"],
"parser": "@typescript-eslint/parser",
{
"extends": ["next/core-web-vitals"],
"plugins": ["@typescript-eslint"],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module",
"project": "./tsconfig.json"
},
"rules": {
"react/no-unescaped-entities": "off",
"@typescript-eslint/no-explicit-any": "off"
}
}
🤖 Prompt for AI Agents
.eslintrc.json around lines 1 to 4: the TypeScript parser lacks parserOptions
which prevents type-aware lint rules from running; update the ESLint config to
add a parserOptions block for the TypeScript parser (include at minimum
"project": "./tsconfig.json" and "tsconfigRootDir": "<project root>" and
optionally "ecmaVersion": 2020 and "sourceType": "module") so type-aware rules
can operate; if performance is a concern, omit "project" or document the
trade-off.

"rules": {
"react/no-unescaped-entities": "off",
"@typescript-eslint/no-explicit-any": "off"
}
}
23 changes: 15 additions & 8 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,34 +8,41 @@ on:

jobs:
test:
name: Tests & Type Check
name: Tests, Lint & Type Check
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'

- name: Install dependencies
run: npm ci

- name: Run type check
run: npx tsc --noEmit

- name: Run unit tests
run: npm test -- --run

run: npm test -- --run --passWithNoTests

- name: Run lint
run: npm run lint

- name: Build
run: npm run build

- name: Upload test results
uses: actions/upload-artifact@v4
if: always()
with:
name: test-results
path: test-results/
if-no-files-found: ignore
retention-days: 7

# E2E tests are run locally before deploy
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,4 @@ coverage/

# Backups / Utility
tmp/
.env*.local
Loading