# πŸ”„ Plan de RefactorizaciΓ³n - EMERGES TES **Fecha:** 2026-01-15 **Objetivo:** Optimizar estructura del proyecto, eliminar redundancias, mejorar mantenibilidad **Principio:** Preservar 100% de funcionalidad existente --- ## πŸ“‹ FASES DE REFACTORIZACIΓ“N ### βœ… FASE 1: Root Level Cleanup - [x] Consolidar scripts de cleanup - [ ] Mover scripts de deployment a scripts/ - [ ] Eliminar scripts innecesarios - [x] Verificar config_backup/ (eliminado) ### ⏳ FASE 2: Assets Consolidation - [ ] Mover /assets a /public/assets - [ ] Actualizar referencias de assets - [ ] Eliminar /assets vacΓ­o ### ⏳ FASE 3: Components Reorganization - [ ] Reorganizar por dominio/feature - [ ] Mover componentes segΓΊn nuevo esquema - [ ] Actualizar imports ### ⏳ FASE 4: Public/Manual Fix - [ ] Verificar duplicados en public/manual - [ ] Limpiar si es necesario ### ⏳ FASE 5: Scripts Organization - [ ] Consolidar todos los scripts - [ ] Organizar por categorΓ­a ### ⏳ FASE 6: Import Updates - [ ] Actualizar todos los imports - [ ] Verificar rutas absolutas y relativas ### ⏳ FASE 7: Validation - [ ] npm run build - [ ] npx tsc --noEmit - [ ] npm run dev - [ ] Verificar imports - [ ] Verificar assets --- ## 🎯 ESTRUCTURA OBJETIVO ``` guia-tes/ β”œβ”€β”€ src/ β”‚ β”œβ”€β”€ components/ β”‚ β”‚ β”œβ”€β”€ content/ # Domain: medical content β”‚ β”‚ β”œβ”€β”€ interactive/ # Domain: interactive tools β”‚ β”‚ β”œβ”€β”€ communication/ # Domain: communication protocols β”‚ β”‚ β”œβ”€β”€ drugs/ # Domain: pharmacology β”‚ β”‚ β”œβ”€β”€ layout/ # Layout components β”‚ β”‚ └── ui/ # Reusable UI primitives β”‚ β”œβ”€β”€ pages/ β”‚ β”œβ”€β”€ hooks/ β”‚ β”œβ”€β”€ lib/ β”‚ β”œβ”€β”€ utils/ β”‚ └── data/ β”œβ”€β”€ public/ β”‚ β”œβ”€β”€ assets/ # Consolidated assets β”‚ └── manual/ # Downloadable documents β”œβ”€β”€ scripts/ # All automation scripts β”œβ”€β”€ docs/ # Documentation └── [config files] ``` --- ## ⚠️ NOTAS IMPORTANTES - **NO modificar lΓ³gica de componentes** - **NO cambiar comportamiento UI** - **Actualizar imports despuΓ©s de mover archivos** - **Verificar build despuΓ©s de cada fase**