Visión General de Deployment
Infraestructura de deploy
Section titled “Infraestructura de deploy”| App | Plataforma | Rama | Notas |
|---|---|---|---|
apps/web | Vercel | main | SPA estática + edge |
apps/docs | Vercel | main | Sitio estático Astro |
apps/api | Railway | main | Container Node.js |
apps/ai-backend | Railway | main | Container Node.js, puerto 3001 |
Bitbucket Pipelines
Section titled “Bitbucket Pipelines”El pipeline principal corre en cada push a main y en PRs:
graph LR Push --> Lint Lint --> Build Build --> Test[Unit Tests] Test --> E2E[E2E access-control] E2E -->|✅ Pasa| Deploy E2E -->|❌ Falla| Block[PR Bloqueado]Stages del pipeline:
lint— ESLint en todo el monorepobuild—pnpm build(Turborepo build cache)test— Jest unit testse2e:access-control— Blocking — suite de access-control Playwrightdeploy— Deploy a Vercel (web + docs) y Railway (api + ai-backend)
Variables de entorno
Section titled “Variables de entorno”Ver apps/api/.env.example y apps/ai-backend/.env.example para la lista completa. Las críticas:
DATABASE_URL= # Neon pooler URLDIRECT_URL= # Neon direct URL (migraciones)JWT_SECRET= # Mín. 64 caracteresAIBACKEND_API_KEY= # Shared secret con ai-backendSTRIPE_SECRET_KEY=STRIPE_WEBHOOK_SECRET=GOOGLE_CLIENT_ID=GOOGLE_CLIENT_SECRET=FRONTEND_URL= # https://fluency.nappai.ai
# apps/ai-backendAIBACKEND_API_KEY= # Mismo que en apps/apiAI_CREDENTIALS_MASTER_KEY= # 64 chars hex — AES-256FLUENCY_API_URL= # URL de apps/apiQDRANT_URL=Migraciones en CI/CD
Section titled “Migraciones en CI/CD”Las migraciones Prisma se aplican manualmente antes de cada deploy que incluya cambios de schema:
# Aplicar migraciones en producciónpnpm db:migrateNo están automatizadas en el pipeline para evitar migraciones destructivas accidentales.