🎯 Funzionalità Implementate: - Frontend React/TypeScript/Tailwind ottimizzato per tablet - Backend mock FastAPI con API complete - Hook RFID multi-pattern (US: ;? / IT: ò_) - Flusso validatore → partecipante → conferma ingresso - Carosello benvenuto multilingua (10 lingue, animazione smooth) - Gestione sessione con invalidazione su server restart - Pagina debug RFID accessibile da /debug 🧪 Test Implementati: - 56 unit test (Vitest) - hook RFID, API, componenti - 14 test E2E (Playwright) - flussi completi con browser reale - Test sicurezza: verifica blocco backend per utenti non ammessi 📋 Comandi Disponibili: - ./dev.sh install → Setup dipendenze - ./dev.sh dev → Sviluppo (hot reload) - ./dev.sh server → Produzione locale - ./dev.sh test → Unit test - ./dev.sh test:e2e → Test E2E headless - ./dev.sh test:e2e:headed → Test E2E con browser visibile - ./dev.sh test:e2e:ui → Playwright UI per debug 📝 Documentazione: - README.md con guida completa - API_SPECIFICATION.md per backend reale - TEST_CHECKLIST.md per test manuali - Piani sviluppo in ai-prompts/ ⏳ Stato: MVP completo, in attesa di feedback e richieste future
55 lines
1.5 KiB
TypeScript
55 lines
1.5 KiB
TypeScript
/// <reference types="vitest" />
|
|
import {defineConfig} from 'vitest/config'
|
|
import react from '@vitejs/plugin-react'
|
|
import tailwindcss from '@tailwindcss/vite'
|
|
|
|
// https://vite.dev/config/
|
|
export default defineConfig({
|
|
plugins: [react(), tailwindcss()],
|
|
|
|
// Path relativi per funzionare su qualsiasi IP/porta
|
|
base: './',
|
|
|
|
// Build nella cartella dist del frontend
|
|
build: {
|
|
outDir: 'dist',
|
|
emptyOutDir: true,
|
|
},
|
|
|
|
// Configurazione test Vitest
|
|
test: {
|
|
globals: true,
|
|
environment: 'jsdom',
|
|
setupFiles: ['./src/test/setup.ts'],
|
|
include: ['src/**/*.{test,spec}.{js,ts,jsx,tsx}'],
|
|
coverage: {
|
|
provider: 'v8',
|
|
reporter: ['text', 'html'],
|
|
exclude: ['node_modules/', 'src/test/'],
|
|
},
|
|
},
|
|
|
|
// Proxy API in sviluppo verso il backend (porta 8000)
|
|
// In produzione il backend serve direttamente il frontend
|
|
server: {
|
|
proxy: {
|
|
'/info-room': {
|
|
target: 'http://127.0.0.1:8000',
|
|
changeOrigin: true,
|
|
},
|
|
'/login-validate': {
|
|
target: 'http://127.0.0.1:8000',
|
|
changeOrigin: true,
|
|
},
|
|
'/anagrafica': {
|
|
target: 'http://127.0.0.1:8000',
|
|
changeOrigin: true,
|
|
},
|
|
'/entry-request': {
|
|
target: 'http://127.0.0.1:8000',
|
|
changeOrigin: true,
|
|
},
|
|
},
|
|
},
|
|
})
|