# AudioForge Prerequisites Checker # Verifies all required services are running before starting $Colors = @{ Red = "Red" Green = "Green" Yellow = "Yellow" Blue = "Cyan" Cyan = "Cyan" } function Write-Info { Write-Host "[INFO] $args" -ForegroundColor $Colors.Blue } function Write-Success { Write-Host "[SUCCESS] $args" -ForegroundColor $Colors.Green } function Write-Warning { Write-Host "[WARNING] $args" -ForegroundColor $Colors.Yellow } function Write-Error { Write-Host "[ERROR] $args" -ForegroundColor $Colors.Red } Write-Host "`n╔═══════════════════════════════════════════════════════════╗" -ForegroundColor Cyan Write-Host "║ AudioForge Prerequisites Checker ║" -ForegroundColor Cyan Write-Host "╚═══════════════════════════════════════════════════════════╝`n" -ForegroundColor Cyan $allGood = $true # Check Docker Write-Info "Checking Docker Desktop..." try { $dockerVersion = docker --version 2>&1 if ($LASTEXITCODE -eq 0) { Write-Success "Docker found: $dockerVersion" # Check if Docker daemon is running try { $null = docker ps 2>&1 | Out-Null if ($LASTEXITCODE -eq 0) { Write-Success "Docker daemon is running" } else { Write-Error "Docker daemon is NOT running!" Write-Warning "Please start Docker Desktop and try again" $allGood = $false } } catch { Write-Error "Cannot connect to Docker daemon" Write-Warning "Please start Docker Desktop and try again" $allGood = $false } } else { Write-Error "Docker not found!" Write-Warning "Please install Docker Desktop from https://www.docker.com/products/docker-desktop" $allGood = $false } } catch { Write-Error "Docker not found in PATH" Write-Warning "Please install Docker Desktop from https://www.docker.com/products/docker-desktop" $allGood = $false } # Check Python Write-Info "Checking Python..." try { $pythonVersion = python --version 2>&1 if ($LASTEXITCODE -eq 0) { Write-Success "Python found: $pythonVersion" } else { Write-Error "Python not found!" $allGood = $false } } catch { Write-Error "Python not found in PATH" $allGood = $false } # Check Node.js Write-Info "Checking Node.js..." try { $nodeVersion = node --version 2>&1 if ($LASTEXITCODE -eq 0) { Write-Success "Node.js found: $nodeVersion" } else { Write-Error "Node.js not found!" $allGood = $false } } catch { Write-Error "Node.js not found in PATH" $allGood = $false } # Check pnpm Write-Info "Checking pnpm..." try { $pnpmVersion = pnpm --version 2>&1 if ($LASTEXITCODE -eq 0) { Write-Success "pnpm found: v$pnpmVersion" } else { Write-Warning "pnpm not found, will install automatically" } } catch { Write-Warning "pnpm not found, will install automatically" } Write-Host "" if ($allGood) { Write-Host "╔═══════════════════════════════════════════════════════════╗" -ForegroundColor Green Write-Host "║ ✅ All Prerequisites Satisfied! ✅ ║" -ForegroundColor Green Write-Host "╚═══════════════════════════════════════════════════════════╝`n" -ForegroundColor Green Write-Info "You can now run: .\scripts\dev_start.ps1" exit 0 } else { Write-Host "╔═══════════════════════════════════════════════════════════╗" -ForegroundColor Red Write-Host "║ ❌ Prerequisites Not Met ❌ ║" -ForegroundColor Red Write-Host "╚═══════════════════════════════════════════════════════════╝`n" -ForegroundColor Red Write-Info "Please fix the issues above and run this script again" exit 1 }