New alert system and panel de control page

This commit is contained in:
Urtzi Alfaro
2025-11-27 15:52:40 +01:00
parent 1a2f4602f3
commit e902419b6e
178 changed files with 20982 additions and 6944 deletions

View File

@@ -2,61 +2,72 @@ import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
import path from 'path';
export default defineConfig({
plugins: [
react(),
// PWA plugin temporarily disabled to avoid service worker conflicts
// VitePWA can be re-enabled later for production PWA features
],
resolve: {
alias: {
'@': path.resolve(__dirname, './src'),
'@components': path.resolve(__dirname, './src/components'),
'@pages': path.resolve(__dirname, './src/pages'),
'@hooks': path.resolve(__dirname, './src/hooks'),
'@stores': path.resolve(__dirname, './src/stores'),
'@services': path.resolve(__dirname, './src/services'),
'@utils': path.resolve(__dirname, './src/utils'),
'@types': path.resolve(__dirname, './src/types'),
},
},
server: {
host: '0.0.0.0', // Important for Docker
port: 3000,
watch: {
// Use polling for Docker/Kubernetes compatibility
usePolling: true,
ignored: [
'**/node_modules/**',
'**/dist/**',
'**/.git/**',
],
},
proxy: {
'/api': {
target: process.env.VITE_API_URL !== undefined
? (process.env.VITE_API_URL || '') // Use value or empty string
: (process.env.NODE_ENV === 'development' && process.env.KUBERNETES_SERVICE_HOST
? 'http://gateway-service:8000' // Kubernetes internal service
: 'http://localhost:8000'), // Local development
changeOrigin: true,
rewrite: (path) => path.replace(/^\/api/, ''),
export default defineConfig(({ mode }) => {
// Enable debug mode for development builds
const isDevelopment = mode === 'development';
return {
plugins: [
react(),
// PWA plugin temporarily disabled to avoid service worker conflicts
// VitePWA can be re-enabled later for production PWA features
],
resolve: {
alias: {
'@': path.resolve(__dirname, './src'),
'@components': path.resolve(__dirname, './src/components'),
'@pages': path.resolve(__dirname, './src/pages'),
'@hooks': path.resolve(__dirname, './src/hooks'),
'@stores': path.resolve(__dirname, './src/stores'),
'@services': path.resolve(__dirname, './src/services'),
'@utils': path.resolve(__dirname, './src/utils'),
'@types': path.resolve(__dirname, './src/types'),
},
},
},
build: {
outDir: 'dist',
sourcemap: true,
rollupOptions: {
external: ['/runtime-config.js'], // Externalize runtime config to avoid bundling
output: {
manualChunks: {
vendor: ['react', 'react-dom', 'react-router-dom'],
ui: ['@radix-ui/react-dialog', '@radix-ui/react-dropdown-menu'],
charts: ['recharts'],
forms: ['react-hook-form', 'zod'],
server: {
host: '0.0.0.0', // Important for Docker
port: 3000,
watch: {
// Use polling for Docker/Kubernetes compatibility
usePolling: true,
ignored: [
'**/node_modules/**',
'**/dist/**',
'**/.git/**',
],
},
proxy: {
'/api': {
target: process.env.VITE_API_URL !== undefined
? (process.env.VITE_API_URL || '') // Use value or empty string
: (process.env.NODE_ENV === 'development' && process.env.KUBERNETES_SERVICE_HOST
? 'http://gateway-service:8000' // Kubernetes internal service
: 'http://localhost:8000'), // Local development
changeOrigin: true,
rewrite: (path) => path.replace(/^\/api/, ''),
},
},
},
},
build: {
outDir: 'dist',
// In development mode: inline source maps for better debugging
// In production mode: external source maps
sourcemap: isDevelopment ? 'inline' : true,
// In development mode: disable minification for readable errors
// In production mode: use esbuild minification
minify: isDevelopment ? false : 'esbuild',
rollupOptions: {
output: {
// In development mode: don't split chunks (easier debugging)
// In production mode: split chunks for better caching
manualChunks: isDevelopment ? undefined : {
vendor: ['react', 'react-dom', 'react-router-dom'],
ui: ['@radix-ui/react-dialog', '@radix-ui/react-dropdown-menu'],
charts: ['recharts'],
forms: ['react-hook-form', 'zod'],
},
},
},
},
};
});