# Script PowerShell per Unificazione Documentazione NetGescon # Data: 18/07/2025 # Scopo: Unificare tutte le cartelle docs sparse in una struttura organizzata Write-Host "šŸ”§ NETGESCON - UNIFICAZIONE DOCUMENTAZIONE" -ForegroundColor Cyan Write-Host "=============================================" -ForegroundColor Cyan $BaseDir = "u:\home\michele\netgescon" $UnifiedDir = "$BaseDir\DOCS-UNIFIED" # Percorsi delle cartelle docs originali $DocsMain = "$BaseDir\docs" $DocsLaravel = "$BaseDir\netgescon-laravel\docs" $DocsTempWindows = "c:\temp" Write-Host "`nšŸ“ Verifica esistenza cartelle..." -ForegroundColor Yellow # Verifica esistenza cartelle if (!(Test-Path $DocsMain)) { Write-Host "āŒ Cartella $DocsMain non trovata" -ForegroundColor Red exit 1 } if (!(Test-Path $DocsLaravel)) { Write-Host "āŒ Cartella $DocsLaravel non trovata" -ForegroundColor Red exit 1 } Write-Host "āœ… Cartelle sorgente verificate" -ForegroundColor Green # Crea struttura di destinazione se non esiste if (!(Test-Path $UnifiedDir)) { New-Item -ItemType Directory -Path $UnifiedDir -Force | Out-Null Write-Host "āœ… Creata cartella unificata: $UnifiedDir" -ForegroundColor Green } Write-Host "`nšŸ“‹ FASE 1: Copia da docs principale ($DocsMain)" -ForegroundColor Yellow # 00-NAVIGAZIONE Write-Host " šŸ“‚ 00-NAVIGAZIONE..." $NavDir = "$UnifiedDir\00-NAVIGAZIONE" if (!(Test-Path $NavDir)) { New-Item -ItemType Directory -Path $NavDir -Force | Out-Null } # Copia indice master if (Test-Path "$BaseDir\00-INDICE-MASTER-NETGESCON.md") { Copy-Item "$BaseDir\00-INDICE-MASTER-NETGESCON.md" "$NavDir\" -Force Write-Host " āœ… 00-INDICE-MASTER-NETGESCON.md" -ForegroundColor Green } # Copia QUICK REFERENCE se esiste if (Test-Path "$DocsMain\QUICK-REFERENCE-CARD.md") { Copy-Item "$DocsMain\QUICK-REFERENCE-CARD.md" "$NavDir\" -Force Write-Host " āœ… QUICK-REFERENCE-CARD.md" -ForegroundColor Green } # 01-MANUALI-OPERATIVI Write-Host " šŸ“‚ 01-MANUALI-OPERATIVI..." $ManualDir = "$UnifiedDir\01-MANUALI-OPERATIVI" if (!(Test-Path $ManualDir)) { New-Item -ItemType Directory -Path $ManualDir -Force | Out-Null } # Copia manuali $ManualFiles = @( "00-MANUALE-COMPLETO-NETGESCON-UNIFICATO.md", "RIEPILOGO-FINALE-SESSIONE-17-07-2025.md" ) foreach ($file in $ManualFiles) { if (Test-Path "$DocsMain\$file") { Copy-Item "$DocsMain\$file" "$ManualDir\" -Force Write-Host " āœ… $file" -ForegroundColor Green } } # Copia cartella manuals se esiste if (Test-Path "$DocsMain\manuals") { Copy-Item "$DocsMain\manuals\*" "$ManualDir\" -Recurse -Force Write-Host " āœ… Cartella manuals/*" -ForegroundColor Green } # 02-DOCUMENTAZIONE-TECNICA Write-Host " šŸ“‚ 02-DOCUMENTAZIONE-TECNICA..." $TechDir = "$UnifiedDir\02-DOCUMENTAZIONE-TECNICA" if (!(Test-Path $TechDir)) { New-Item -ItemType Directory -Path $TechDir -Force | Out-Null } $TechFiles = @( "04-DATABASE-STRUTTURE.md", "05-INTERFACCIA-UNIVERSALE.md", "06-SISTEMA-MULTI-RUOLO.md", "08-FRONTEND-UX.md" ) foreach ($file in $TechFiles) { if (Test-Path "$DocsMain\$file") { Copy-Item "$DocsMain\$file" "$TechDir\" -Force Write-Host " āœ… $file" -ForegroundColor Green } } # 04-LOGS-SVILUPPO Write-Host " šŸ“‚ 04-LOGS-SVILUPPO..." $LogsDir = "$UnifiedDir\04-LOGS-SVILUPPO" if (!(Test-Path $LogsDir)) { New-Item -ItemType Directory -Path $LogsDir -Force | Out-Null } $LogFiles = @( "RIEPILOGO-MODULARIZZAZIONE.md", "LISTA-FILE-BACKUP.md" ) foreach ($file in $LogFiles) { if (Test-Path "$DocsMain\$file") { Copy-Item "$DocsMain\$file" "$LogsDir\" -Force Write-Host " āœ… $file" -ForegroundColor Green } } # Copia cartella logs se esiste if (Test-Path "$DocsMain\logs") { Copy-Item "$DocsMain\logs\*" "$LogsDir\" -Recurse -Force Write-Host " āœ… Cartella logs/*" -ForegroundColor Green } # 07-API-SPECS Write-Host " šŸ“‚ 07-API-SPECS..." $ApiDir = "$UnifiedDir\07-API-SPECS" if (!(Test-Path $ApiDir)) { New-Item -ItemType Directory -Path $ApiDir -Force | Out-Null } $ApiFiles = @( "07-API-INTEGRAZIONI.md", "05-SINCRONIZZAZIONE-AMBIENTE.md" ) foreach ($file in $ApiFiles) { if (Test-Path "$DocsMain\$file") { Copy-Item "$DocsMain\$file" "$ApiDir\" -Force Write-Host " āœ… $file" -ForegroundColor Green } } # Copia cartella api se esiste if (Test-Path "$DocsMain\api") { Copy-Item "$DocsMain\api\*" "$ApiDir\" -Recurse -Force Write-Host " āœ… Cartella api/*" -ForegroundColor Green } # 08-CHECKLISTS-TODO Write-Host " šŸ“‚ 08-CHECKLISTS-TODO..." $CheckDir = "$UnifiedDir\08-CHECKLISTS-TODO" if (!(Test-Path $CheckDir)) { New-Item -ItemType Directory -Path $CheckDir -Force | Out-Null } # Copia cartella checklists se esiste if (Test-Path "$DocsMain\checklists") { Copy-Item "$DocsMain\checklists\*" "$CheckDir\" -Recurse -Force Write-Host " āœ… Cartella checklists/*" -ForegroundColor Green } Write-Host "`nšŸ“‹ FASE 2: Copia da docs Laravel ($DocsLaravel)" -ForegroundColor Yellow # 03-ARCHITETTURA-SISTEMA Write-Host " šŸ“‚ 03-ARCHITETTURA-SISTEMA..." $ArchDir = "$UnifiedDir\03-ARCHITETTURA-SISTEMA" if (!(Test-Path $ArchDir)) { New-Item -ItemType Directory -Path $ArchDir -Force | Out-Null } $ArchFiles = @( "ARCHITETTURA_MODULARE_COMPLETATA.md", "RIEPILOGO_ARCHITETTURA_COMPLETATA.md", "PROTOCOLLO_COMUNICAZIONE.md", "sidebar-modulare.md" ) foreach ($file in $ArchFiles) { if (Test-Path "$DocsLaravel\$file") { Copy-Item "$DocsLaravel\$file" "$ArchDir\" -Force Write-Host " āœ… $file" -ForegroundColor Green } } # 01-MANUALI-OPERATIVI (aggiungi da Laravel) $LaravelManualFiles = @( "PROCEDURA_OPERATIVA.md", "personalizzazione-tema.md", "miki.md" ) foreach ($file in $LaravelManualFiles) { if (Test-Path "$DocsLaravel\$file") { Copy-Item "$DocsLaravel\$file" "$ManualDir\" -Force Write-Host " āœ… $file (da Laravel)" -ForegroundColor Green } } # 00-NAVIGAZIONE (aggiungi da Laravel) if (Test-Path "$DocsLaravel\QUICK_REFERENCE.md") { Copy-Item "$DocsLaravel\QUICK_REFERENCE.md" "$NavDir\QUICK_REFERENCE_LARAVEL.md" -Force Write-Host " āœ… QUICK_REFERENCE_LARAVEL.md" -ForegroundColor Green } # Copia guide e specifiche se esistono if (Test-Path "$DocsLaravel\guide") { $GuideDestDir = "$TechDir\guide-laravel" if (!(Test-Path $GuideDestDir)) { New-Item -ItemType Directory -Path $GuideDestDir -Force | Out-Null } Copy-Item "$DocsLaravel\guide\*" "$GuideDestDir\" -Recurse -Force Write-Host " āœ… Cartella guide/*" -ForegroundColor Green } if (Test-Path "$DocsLaravel\specifiche") { $SpecDestDir = "$TechDir\specifiche-laravel" if (!(Test-Path $SpecDestDir)) { New-Item -ItemType Directory -Path $SpecDestDir -Force | Out-Null } Copy-Item "$DocsLaravel\specifiche\*" "$SpecDestDir\" -Recurse -Force Write-Host " āœ… Cartella specifiche/*" -ForegroundColor Green } # FASE 3: Copia da materiali Windows temporanei Write-Host "`nšŸ“‹ FASE 3: Copia materiali Windows temporanei" -ForegroundColor Yellow # 00-NAVIGAZIONE if (Test-Path "$DocsTempWindows\README-TRANSITION-COMPLETE.md") { Copy-Item "$DocsTempWindows\README-TRANSITION-COMPLETE.md" "$NavDir\" -Force Write-Host " āœ… README-TRANSITION-COMPLETE.md" -ForegroundColor Green } # 02-DOCUMENTAZIONE-TECNICA if (Test-Path "$DocsTempWindows\FEATURES-INVENTORY-COMPLETE.md") { Copy-Item "$DocsTempWindows\FEATURES-INVENTORY-COMPLETE.md" "$TechDir\" -Force Write-Host " āœ… FEATURES-INVENTORY-COMPLETE.md" -ForegroundColor Green } # 05-MIGRAZIONE-LINUX Write-Host " šŸ“‚ 05-MIGRAZIONE-LINUX..." $MigrationDir = "$UnifiedDir\05-MIGRAZIONE-LINUX" if (!(Test-Path $MigrationDir)) { New-Item -ItemType Directory -Path $MigrationDir -Force | Out-Null } if (Test-Path "$DocsTempWindows\DEPLOYMENT-GUIDE-COMPLETE.md") { Copy-Item "$DocsTempWindows\DEPLOYMENT-GUIDE-COMPLETE.md" "$MigrationDir\" -Force Write-Host " āœ… DEPLOYMENT-GUIDE-COMPLETE.md" -ForegroundColor Green } # 06-SCRIPTS-TOOLS Write-Host " šŸ“‚ 06-SCRIPTS-TOOLS..." $ScriptsDir = "$UnifiedDir\06-SCRIPTS-TOOLS" if (!(Test-Path $ScriptsDir)) { New-Item -ItemType Directory -Path $ScriptsDir -Force | Out-Null } if (Test-Path "$DocsTempWindows\fix-vscode-install.sh") { Copy-Item "$DocsTempWindows\fix-vscode-install.sh" "$ScriptsDir\" -Force Write-Host " āœ… fix-vscode-install.sh" -ForegroundColor Green } # Copia script da netgescon-laravel se esistono if (Test-Path "$BaseDir\netgescon-laravel\*.sh") { Copy-Item "$BaseDir\netgescon-laravel\*.sh" "$ScriptsDir\" -Force Write-Host " āœ… Script da netgescon-laravel/*" -ForegroundColor Green } # Copia script da cartella scripts principale se esiste if (Test-Path "$BaseDir\scripts") { Copy-Item "$BaseDir\scripts\*" "$ScriptsDir\" -Recurse -Force Write-Host " āœ… Cartella scripts/*" -ForegroundColor Green } Write-Host "`nšŸ“‹ FASE 4: Creazione file di inventario" -ForegroundColor Yellow # Crea inventario dei file copiati $InventoryFile = "$UnifiedDir\INVENTARIO-UNIFICAZIONE.md" $Inventory = @" # šŸ“‹ INVENTARIO UNIFICAZIONE DOCUMENTAZIONE **Data:** $(Get-Date -Format "dd/MM/yyyy HH:mm") **Script:** unify-docs-netgescon.ps1 ## šŸ“ CARTELLE SORGENTE UNIFICATE: - ``$DocsMain`` - ``$DocsLaravel`` - ``$DocsTempWindows`` ## šŸ“‚ STRUTTURA UNIFICATA CREATA: - šŸ“‚ 00-NAVIGAZIONE - Indici e guide rapide - šŸ“‚ 01-MANUALI-OPERATIVI - Guide pratiche - šŸ“‚ 02-DOCUMENTAZIONE-TECNICA - Specifiche tecniche - šŸ“‚ 03-ARCHITETTURA-SISTEMA - Design e architettura - šŸ“‚ 04-LOGS-SVILUPPO - Tracking sviluppo - šŸ“‚ 05-MIGRAZIONE-LINUX - Guide Linux/deployment - šŸ“‚ 06-SCRIPTS-TOOLS - Script e automazione - šŸ“‚ 07-API-SPECS - Specifiche API - šŸ“‚ 08-CHECKLISTS-TODO - Task e checklist ## šŸ“Š STATISTICHE UNIFICAZIONE: "@ # Conta i file in ogni directory $Stats = @{} Get-ChildItem $UnifiedDir -Recurse -File | Group-Object DirectoryName | ForEach-Object { $RelPath = $_.Name.Replace($UnifiedDir, "").TrimStart("\") $Stats[$RelPath] = $_.Count } foreach ($dir in $Stats.Keys | Sort-Object) { $Inventory += "`n- **$dir**: $($Stats[$dir]) file" } $Inventory += @" ## āœ… OPERAZIONI COMPLETATE: - [x] Unificazione cartelle docs sparse - [x] Organizzazione per categoria - [x] Creazione indice master - [x] Copia script e tools - [x] Inventario documentazione ## šŸŽÆ PROSSIMI PASSI: 1. Trasferire DOCS-UNIFIED su Linux 2. Aggiornare riferimenti nei documenti 3. Validare completezza materiale 4. Creare script sync automatico --- *Generato automaticamente da unify-docs-netgescon.ps1* "@ $Inventory | Out-File -FilePath $InventoryFile -Encoding UTF8 -Force Write-Host " āœ… INVENTARIO-UNIFICAZIONE.md creato" -ForegroundColor Green Write-Host "`nāœ… UNIFICAZIONE COMPLETATA!" -ForegroundColor Green Write-Host "šŸ“‚ Documentazione unificata in: $UnifiedDir" -ForegroundColor Cyan Write-Host "šŸ“‹ Inventario disponibile in: $InventoryFile" -ForegroundColor Cyan # Mostra statistiche finali Write-Host "`nšŸ“Š STATISTICHE FINALI:" -ForegroundColor Yellow $TotalFiles = (Get-ChildItem $UnifiedDir -Recurse -File).Count $TotalSize = [math]::Round((Get-ChildItem $UnifiedDir -Recurse -File | Measure-Object -Property Length -Sum).Sum / 1MB, 2) Write-Host "šŸ“„ File totali: $TotalFiles" -ForegroundColor White Write-Host "šŸ’¾ Dimensione totale: $TotalSize MB" -ForegroundColor White Write-Host "šŸ“ Cartelle create: 8" -ForegroundColor White Write-Host "`nšŸŽÆ PROSSIMA AZIONE:" -ForegroundColor Magenta Write-Host " Trasferire la cartella DOCS-UNIFIED nel server Linux:" -ForegroundColor White Write-Host " scp -r $UnifiedDir netgescon@192.168.0.200:/var/www/netgescon-complete/" -ForegroundColor Gray Write-Host "`nPremere Enter per continuare..." -ForegroundColor Yellow Read-Host