Modern ERP Reports Application with microservices architecture Tech Stack: - Backend: FastAPI + python-oracledb (Oracle DB integration) - Frontend: Vue.js 3 + PrimeVue + Vite - Telegram Bot: python-telegram-bot + SQLite - Infrastructure: Shared database pool, JWT authentication, SSH tunnel Features: - FastAPI backend with async Oracle connection pool - Vue.js 3 responsive frontend with PrimeVue components - Telegram bot alternative interface - Microservices architecture with shared components - Complete deployment support (Linux Docker + Windows IIS) - Comprehensive testing (Playwright E2E + pytest) Repository Structure: - reports-app/ - Main application (backend, frontend, telegram-bot) - shared/ - Shared components (database pool, auth, utils) - deployment/ - Deployment scripts (Linux & Windows) - docs/ - Project documentation - security/ - Security scanning and git hooks
78 lines
2.4 KiB
JavaScript
78 lines
2.4 KiB
JavaScript
import { defineConfig } from 'vite'
|
|
import vue from '@vitejs/plugin-vue'
|
|
import { fileURLToPath, URL } from 'node:url'
|
|
|
|
// Plugin pentru a înlocui BUILD_TIMESTAMP în index.html la build
|
|
function htmlTimestampPlugin() {
|
|
return {
|
|
name: 'html-timestamp',
|
|
transformIndexHtml(html) {
|
|
return html.replace('BUILD_TIMESTAMP', new Date().toISOString())
|
|
}
|
|
}
|
|
}
|
|
|
|
export default defineConfig({
|
|
plugins: [vue(), htmlTimestampPlugin()],
|
|
// Base path for production deployment in IIS subdirectory
|
|
base: process.env.NODE_ENV === 'production' ? '/roa2web/' : '/',
|
|
resolve: {
|
|
alias: {
|
|
'@': fileURLToPath(new URL('./src', import.meta.url))
|
|
}
|
|
},
|
|
server: {
|
|
port: 3000,
|
|
host: true,
|
|
// WSL2 file watching fix - use polling for /mnt/ paths
|
|
watch: {
|
|
usePolling: true, // Required for WSL2 when files are on Windows mount
|
|
interval: 1000 // Check for changes every second
|
|
},
|
|
// HMR configuration for better hot reload
|
|
hmr: {
|
|
overlay: true, // Show errors in browser overlay
|
|
protocol: 'ws', // WebSocket protocol
|
|
host: 'localhost' // Explicit host for WSL2
|
|
},
|
|
proxy: {
|
|
'/api': {
|
|
target: 'http://localhost:8001',
|
|
changeOrigin: true,
|
|
secure: false,
|
|
configure: (proxy, options) => {
|
|
proxy.on('proxyReq', (proxyReq, req, res) => {
|
|
// Preserve authorization header during redirects
|
|
if (req.headers.authorization) {
|
|
proxyReq.setHeader('Authorization', req.headers.authorization);
|
|
}
|
|
});
|
|
}
|
|
}
|
|
}
|
|
},
|
|
build: {
|
|
outDir: 'dist',
|
|
sourcemap: true,
|
|
// Cache busting - generează hash-uri noi la fiecare build
|
|
assetsInlineLimit: 0, // Nu inline asset-uri mici, folosește fișiere separate cu hash
|
|
rollupOptions: {
|
|
output: {
|
|
// Forțează hash-uri unice pentru toate fișierele
|
|
entryFileNames: `assets/[name].[hash].js`,
|
|
chunkFileNames: `assets/[name].[hash].js`,
|
|
assetFileNames: `assets/[name].[hash].[ext]`,
|
|
manualChunks: {
|
|
vendor: ['vue', 'vue-router', 'pinia'],
|
|
primevue: ['primevue/button', 'primevue/datatable', 'primevue/inputtext'],
|
|
utils: ['axios', 'date-fns']
|
|
}
|
|
}
|
|
}
|
|
},
|
|
// Adaugă timestamp la build pentru versioning
|
|
define: {
|
|
__APP_VERSION__: JSON.stringify(new Date().toISOString()),
|
|
__BUILD_TIMESTAMP__: JSON.stringify(Date.now())
|
|
}
|
|
}) |