From cce4743b712a88b823b112c8e30b5f6e03f4a65c Mon Sep 17 00:00:00 2001 From: Marcio Bevervanso Date: Mon, 13 Apr 2026 18:52:37 -0300 Subject: [PATCH] feat: migrate to single PRO plan and update Stripe Production Checkout --- image-renderer/Dockerfile | 35 ++++++ image-renderer/coolify.yaml | 14 +++ src/components/landing/Pricing.tsx | 123 +++++--------------- src/contexts/LanguageContext.tsx | 30 ++--- supabase/functions/stripe-checkout/index.ts | 2 +- 5 files changed, 96 insertions(+), 108 deletions(-) create mode 100644 image-renderer/Dockerfile create mode 100644 image-renderer/coolify.yaml diff --git a/image-renderer/Dockerfile b/image-renderer/Dockerfile new file mode 100644 index 0000000..74afba6 --- /dev/null +++ b/image-renderer/Dockerfile @@ -0,0 +1,35 @@ +# Usa a imagem oficial do Node.js baseada em Alpine (Leve mas precisa de libs do browser) +# Trocando pra Debian/Ubuntu leve por causa das dependencias complexas do Chrome +FROM node:18-slim + +# Instalar dependências necessárias para rodar o Puppeteer (Chromium) no Linux +RUN apt-get update \ + && apt-get install -y wget gnupg \ + && wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - \ + && sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list' \ + && apt-get update \ + && apt-get install -y google-chrome-stable fonts-ipafont-gothic fonts-wqy-zenhei fonts-thai-tlwg fonts-kacst fonts-freefont-ttf libxss1 \ + --no-install-recommends \ + && rm -rf /var/lib/apt/lists/* + +# Definir a variável de ambiente para forçar o Puppeteer a usar o Chrome instalado ao invés de baixar um próprio +ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true +ENV PUPPETEER_EXECUTABLE_PATH=/usr/bin/google-chrome-stable + +# Criar o diretório de trabalho da aplicação +WORKDIR /usr/src/app + +# Copiar os arquivos de dependência +COPY package*.json ./ + +# Instalar as dependências do Node +RUN npm install + +# Copiar o resto do código do servidor +COPY . . + +# Expor a porta que a aplicação Express escuta +EXPOSE 3001 + +# Comando para iniciar o servidor +CMD [ "npm", "start" ] diff --git a/image-renderer/coolify.yaml b/image-renderer/coolify.yaml new file mode 100644 index 0000000..d12792c --- /dev/null +++ b/image-renderer/coolify.yaml @@ -0,0 +1,14 @@ +# Configuração do Coolify Nixpacks +# O Coolify vai ler isso na raiz para o serviço específico "image-renderer" + +preBuild: + - npm ci + +start: + - node index.js + +# Variáveis do Node / Chrome +envs: + - PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true + - PUPPETEER_EXECUTABLE_PATH=/usr/bin/google-chrome-stable + - NODE_ENV=production diff --git a/src/components/landing/Pricing.tsx b/src/components/landing/Pricing.tsx index 43d4ef1..9b7c629 100644 --- a/src/components/landing/Pricing.tsx +++ b/src/components/landing/Pricing.tsx @@ -41,110 +41,49 @@ const Pricing: React.FC = ({ onRegister }) => { -
- - {/* Plan: Monthly (Was Starter in structure, now Monthly) */} -
-

{t.pricing.plans.monthly.title}

-
- {t.pricing.plans.monthly.price} - {t.pricing.plans.monthly.period} +
+
+
+
+

+ {t.pricing.plans.monthly.title} + PRO +

+

{t.pricing.plans.monthly.description}

+
+
+ +
-

{t.pricing.plans.monthly.description}

-

{t.pricing.plans.monthly.billingInfo}

-
    +
    + {t.pricing.plans.monthly.price} + {t.pricing.plans.monthly.period} +
    +

    {t.pricing.plans.monthly.billingInfo}

    + +
    + +
      {t.pricing.plans.monthly.features.map((item, i) => ( -
    • - - {item} +
    • +
      + +
      + {item}
    • ))}
- - {/* Plan: Annual (Highlighted) */} -
-
-
-
-

- {t.pricing.plans.annual.title} - {t.pricing.plans.annual.savings} -

-

{t.pricing.plans.annual.description}

-
-
- -
-
- -
- {t.pricing.plans.annual.price} - {t.pricing.plans.annual.period} -
-

{t.pricing.plans.annual.billingInfo}

- -
- -
    - {t.pricing.plans.annual.features.map((item, i) => ( -
  • -
    - -
    - {item} -
  • - ))} -
- - -
-
- - {/* Plan: Quarterly */} -
-

{t.pricing.plans.quarterly.title}

-
- {t.pricing.plans.quarterly.price} - {t.pricing.plans.quarterly.period} -
-

{t.pricing.plans.quarterly.description}

-

{t.pricing.plans.quarterly.billingInfo}

- -
    - {t.pricing.plans.quarterly.features.map((item, i) => ( -
  • - - {item} -
  • - ))} -
- - -
- -
- - {/* --- PROFESSIONAL PLAN SECTION --- */} +
\n {/* --- PROFESSIONAL PLAN SECTION --- */}
{/* Abstract Shapes */} diff --git a/src/contexts/LanguageContext.tsx b/src/contexts/LanguageContext.tsx index b2f6ef7..fa59f50 100644 --- a/src/contexts/LanguageContext.tsx +++ b/src/contexts/LanguageContext.tsx @@ -371,12 +371,12 @@ const dictionary: Record = { secure: 'Compra segura. Satisfação garantida ou seu dinheiro de volta em 7 dias.', plans: { monthly: { - title: 'Mensal', - price: 'R$ 49,90', + title: 'Plano Único PRO', + price: 'R$ 14,99', period: '/mês', - billingInfo: 'Sem fidelidade', - description: 'Para quem quer flexibilidade.', - btnText: 'Começar Mensal', + billingInfo: 'Cancele quando quiser', + description: 'Acesso completo e ilimitado ao FoodSnap.', + btnText: 'Assinar Agora', features: [ 'Fotos Ilimitadas', 'Feedback Imediato', @@ -721,12 +721,12 @@ const dictionary: Record = { secure: 'Secure payment via Stripe. Cancel anytime.', plans: { monthly: { - title: 'Monthly', - price: '$9.99', + title: 'PRO Subscription', + price: '$14.99', period: '/mo', - billingInfo: 'Billed monthly', - description: 'Total flexibility.', - btnText: 'Subscribe Monthly', + billingInfo: 'Cancel anytime', + description: 'Full unlimited access to FoodSnap.', + btnText: 'Subscribe Now', features: [ 'Unlimited Queries', 'AI Nutritionist Chat', @@ -1071,12 +1071,12 @@ const dictionary: Record = { secure: 'Pago seguro vía Stripe. Cancela cuando quieras.', plans: { monthly: { - title: 'Mensual', - price: '€ 14,90', + title: 'Plan Único PRO', + price: '€ 14,99', period: '/mes', - billingInfo: 'Cobrado mensualmente', - description: 'Flexibilidad total.', - btnText: 'Suscribir Mensual', + billingInfo: 'Cancela cuando quieras', + description: 'Acceso completo e ilimitado.', + btnText: 'Suscribir Ahora', features: [ 'Consultas Ilimitadas', 'Chat con Nutricionista IA', diff --git a/supabase/functions/stripe-checkout/index.ts b/supabase/functions/stripe-checkout/index.ts index b5df17b..0e1a00c 100644 --- a/supabase/functions/stripe-checkout/index.ts +++ b/supabase/functions/stripe-checkout/index.ts @@ -8,7 +8,7 @@ const SUPABASE_ANON_KEY = Deno.env.get("SUPABASE_ANON_KEY")!; const SITE_URL = Deno.env.get("SITE_URL")!; // ✅ seus PRICE IDs (recorrentes) -const PRICE_MENSAL = "price_1SeOVpPHwVDouhbBWZj9beS3"; +const PRICE_MENSAL = "price_1TLsAFA5oAF7o14GoHRM3LZ8"; const PRICE_TRIMESTRAL = "price_1SeOeXPHwVDouhbBcaiUy3vu"; const PRICE_ANUAL = "price_1SeOg4PHwVDouhbBTEiUPhMl";