Files
wled-controller/setup.ps1
2025-12-10 18:07:21 +00:00

51 lines
1.5 KiB
PowerShell

# WLED Controller Setup Script
Write-Host "Setting up WLED Controller..." -ForegroundColor Green
# Backend setup
Write-Host "`nSetting up backend..." -ForegroundColor Cyan
Set-Location backend
if (Test-Path ".env") {
Write-Host "Backend .env file already exists" -ForegroundColor Yellow
} else {
Copy-Item .env.example .env
Write-Host "Created backend .env file" -ForegroundColor Green
}
Write-Host "Installing backend dependencies..."
npm install
Write-Host "Generating Prisma client..."
npm run prisma:generate
Write-Host "Running database migrations..."
npm run prisma:migrate
# Frontend setup
Write-Host "`nSetting up frontend..." -ForegroundColor Cyan
Set-Location ../frontend
if (Test-Path ".env") {
Write-Host "Frontend .env file already exists" -ForegroundColor Yellow
} else {
Copy-Item .env.example .env
Write-Host "Created frontend .env file" -ForegroundColor Green
}
Write-Host "Installing frontend dependencies..."
npm install
Set-Location ..
Write-Host "`n========================================" -ForegroundColor Green
Write-Host "Setup complete!" -ForegroundColor Green
Write-Host "========================================" -ForegroundColor Green
Write-Host "`nTo start the backend (in backend directory):"
Write-Host " npm run dev" -ForegroundColor Cyan
Write-Host "`nTo start the frontend (in frontend directory):"
Write-Host " npm run dev" -ForegroundColor Cyan
Write-Host "`nOr use Docker Compose:"
Write-Host " docker-compose up -d" -ForegroundColor Cyan
Write-Host ""