Ir al contenido

Deploy y entornos

Ventana de terminal
cd emawell
npm install
npm run deploy

npm run deploy ejecuta:

  1. vite build — compila el SPA cliente en dist/client.
  2. wrangler deploy — empuja el worker (API Hono + assets estáticos) a Cloudflare.
ComponentePlataforma
API + assetsCloudflare Workers (single worker con [assets] binding)
BDSupabase (proyecto independiente emawell)
EmailLoops.so
PagosStripe
Push notificationsVAPID self-hosted

Set vía wrangler secret put <NOMBRE>:

SecretPara qué
SUPABASE_URLURL del proyecto emawell
SUPABASE_ANON_KEYCliente público (RLS-safe)
SUPABASE_SERVICE_ROLE_KEYSólo para crons / jobs admin
LOOPS_API_KEYEmail transaccional + nurture
ANTHROPIC_API_KEYOnboarding IA + sugerencias diarias (sólo Pro)
STRIPE_SECRET_KEYCobros y webhooks
STRIPE_WEBHOOK_SECRETVerificación de eventos Stripe
VAPID_PUBLIC_KEYPush notifications
VAPID_PRIVATE_KEYPush notifications

well.emahealth.io — configurado en Cloudflare Dashboard sobre el worker.

Definidos en wrangler.toml:

[triggers]
crons = [
"0 0 * * 0", # Domingo 00:00 UTC — weekly summary
"0 20 * * *", # Diario 20:00 UTC — streak at risk
]
  • Conventional commits (feat:, fix:, chore:, etc.).
  • Tests con Vitest: unit/, integration/, regression/, performance/, security/.
  • No GitHub Actions — deploy manual o con CF Git integration cuando aplique.