Deploy y entornos
Comando
Sección titulada «Comando»cd emawellnpm installnpm run deploynpm run deploy ejecuta:
vite build— compila el SPA cliente endist/client.wrangler deploy— empuja el worker (API Hono + assets estáticos) a Cloudflare.
Hosting
Sección titulada «Hosting»| Componente | Plataforma |
|---|---|
| API + assets | Cloudflare Workers (single worker con [assets] binding) |
| BD | Supabase (proyecto independiente emawell) |
| Loops.so | |
| Pagos | Stripe |
| Push notifications | VAPID self-hosted |
Secrets requeridos
Sección titulada «Secrets requeridos»Set vía wrangler secret put <NOMBRE>:
| Secret | Para qué |
|---|---|
SUPABASE_URL | URL del proyecto emawell |
SUPABASE_ANON_KEY | Cliente público (RLS-safe) |
SUPABASE_SERVICE_ROLE_KEY | Sólo para crons / jobs admin |
LOOPS_API_KEY | Email transaccional + nurture |
ANTHROPIC_API_KEY | Onboarding IA + sugerencias diarias (sólo Pro) |
STRIPE_SECRET_KEY | Cobros y webhooks |
STRIPE_WEBHOOK_SECRET | Verificación de eventos Stripe |
VAPID_PUBLIC_KEY | Push notifications |
VAPID_PRIVATE_KEY | Push notifications |
Custom domain
Sección titulada «Custom domain»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]Convenciones
Sección titulada «Convenciones»- 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.