feat: WhatsApp Nucleo con Nuxt 4 + Baileys v7
Some checks failed
Build and Deploy / build-and-deploy (push) Failing after 6m46s
Some checks failed
Build and Deploy / build-and-deploy (push) Failing after 6m46s
Reemplazo completo de Evolution API por implementación directa con Baileys. Características: - Dashboard completo con Nuxt UI v4 - Soporte para múltiples instancias de WhatsApp - Conexión via QR code o pairing code - Persistencia de mensajes en PostgreSQL - API REST para integraciones externas - Webhooks con firma HMAC - SSE para actualizaciones en tiempo real - Autenticación con Authentik
This commit is contained in:
127
nuxt.config.ts
Normal file
127
nuxt.config.ts
Normal file
@@ -0,0 +1,127 @@
|
||||
// https://nuxt.com/docs/api/configuration/nuxt-config
|
||||
export default defineNuxtConfig({
|
||||
ssr: true,
|
||||
compatibilityDate: '2025-07-15',
|
||||
devtools: { enabled: true },
|
||||
css: ['~/assets/css/main.css'],
|
||||
modules: ['@nuxt/image', '@nuxt/ui', '@vite-pwa/nuxt'],
|
||||
|
||||
// Performance optimizations
|
||||
experimental: {
|
||||
payloadExtraction: false,
|
||||
viewTransition: true
|
||||
},
|
||||
|
||||
// Vite config
|
||||
vite: {
|
||||
server: {
|
||||
hmr: {
|
||||
clientPort: 443,
|
||||
protocol: 'wss'
|
||||
},
|
||||
allowedHosts: [
|
||||
'.nucleoriofrio.com',
|
||||
'whatsapp.nucleoriofrio.com'
|
||||
]
|
||||
},
|
||||
build: {
|
||||
cssCodeSplit: true,
|
||||
rollupOptions: {
|
||||
output: {
|
||||
manualChunks: {
|
||||
'vendor-ui': ['@nuxt/ui']
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
app: {
|
||||
baseURL: process.env.BASE_URL || '/',
|
||||
head: {
|
||||
title: 'WhatsApp Nucleo',
|
||||
link: [
|
||||
{ rel: 'icon', type: 'image/png', href: '/icons/icon-192.png' },
|
||||
{ rel: 'apple-touch-icon', sizes: '192x192', href: '/apple-touch-icon.png' },
|
||||
{ rel: 'manifest', href: '/manifest.webmanifest' }
|
||||
],
|
||||
meta: [
|
||||
{ name: 'theme-color', content: '#075e54' },
|
||||
{ name: 'apple-mobile-web-app-capable', content: 'yes' },
|
||||
{ name: 'mobile-web-app-capable', content: 'yes' },
|
||||
{ name: 'apple-mobile-web-app-status-bar-style', content: 'black-translucent' }
|
||||
]
|
||||
}
|
||||
},
|
||||
|
||||
nitro: {
|
||||
baseURL: process.env.BASE_URL || '/',
|
||||
experimental: {
|
||||
openAPI: true
|
||||
},
|
||||
routeRules: {
|
||||
'/manifest.webmanifest': {
|
||||
headers: {
|
||||
'Content-Type': 'application/manifest+json',
|
||||
'Cache-Control': 'public, max-age=3600'
|
||||
}
|
||||
},
|
||||
'/sw.js': {
|
||||
headers: {
|
||||
'Service-Worker-Allowed': '/',
|
||||
'Cache-Control': 'public, max-age=0'
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
pwa: {
|
||||
registerType: 'autoUpdate',
|
||||
strategies: 'generateSW',
|
||||
manifestFilename: 'manifest.webmanifest',
|
||||
manifest: {
|
||||
id: '/?app=whatsapp',
|
||||
name: 'WhatsApp Nucleo',
|
||||
short_name: 'WhatsApp',
|
||||
description: 'Gestiona multiples instancias de WhatsApp desde un panel centralizado',
|
||||
start_url: '/',
|
||||
scope: '/',
|
||||
display: 'standalone',
|
||||
background_color: '#075e54',
|
||||
theme_color: '#075e54',
|
||||
launch_handler: {
|
||||
client_mode: 'navigate-existing'
|
||||
},
|
||||
icons: [
|
||||
{ src: '/icons/icon-192.png', sizes: '192x192', type: 'image/png' },
|
||||
{ src: '/icons/icon-512.png', sizes: '512x512', type: 'image/png' },
|
||||
{ src: '/icons/icon-192-maskable.png', sizes: '192x192', type: 'image/png', purpose: 'maskable' },
|
||||
{ src: '/icons/icon-512-maskable.png', sizes: '512x512', type: 'image/png', purpose: 'maskable' }
|
||||
]
|
||||
},
|
||||
workbox: {
|
||||
globPatterns: ['**/*.{js,css,html,png,svg,webp,ico,json,woff2}'],
|
||||
navigateFallback: undefined,
|
||||
cleanupOutdatedCaches: true,
|
||||
maximumFileSizeToCacheInBytes: 4 * 1024 * 1024
|
||||
},
|
||||
client: {
|
||||
installPrompt: true,
|
||||
periodicSyncForUpdates: 3600
|
||||
},
|
||||
devOptions: {
|
||||
enabled: process.env.NODE_ENV === 'development',
|
||||
type: 'module'
|
||||
}
|
||||
},
|
||||
|
||||
runtimeConfig: {
|
||||
// Server-side only
|
||||
databaseUrl: process.env.DATABASE_URL || 'postgresql://whatsapp:password@localhost:5432/whatsapp',
|
||||
masterApiKey: process.env.MASTER_API_KEY || '',
|
||||
// Public (client + server)
|
||||
public: {
|
||||
authentikUrl: process.env.NUXT_PUBLIC_AUTHENTIK_URL || 'https://authentik.nucleoriofrio.com'
|
||||
}
|
||||
}
|
||||
})
|
||||
Reference in New Issue
Block a user