likwid/scripts/demo-reset.ps1
Marco Allegretti 910a6465f2 Initial commit: Likwid governance platform
- Backend: Rust/Axum with PostgreSQL, plugin architecture
- Frontend: Astro with polished UI
- Voting methods: Approval, Ranked Choice, Schulze, STAR, Quadratic
- Features: Liquid delegation, transparent moderation, structured deliberation
- Documentation: User and admin guides in /docs
- Deployment: Docker/Podman compose files for production and demo
- Demo: Seeded data with 3 communities, 13 users, 7 proposals

License: AGPLv3
2026-01-27 17:21:58 +01:00

59 lines
2 KiB
PowerShell

# Demo Reset Script (Windows PowerShell)
# Resets the demo instance to a clean state with fresh seed data
param(
[switch]$Force
)
$ErrorActionPreference = "Stop"
Write-Host "=== Likwid Demo Reset ===" -ForegroundColor Cyan
if (-not $Force) {
$confirm = Read-Host "This will DELETE all demo data and reset to initial state. Continue? (y/N)"
if ($confirm -ne "y" -and $confirm -ne "Y") {
Write-Host "Aborted." -ForegroundColor Yellow
exit 0
}
}
Set-Location "$PSScriptRoot\.."
Write-Host "`n[1/4] Stopping demo containers..." -ForegroundColor Yellow
podman-compose -f compose/demo.yml down
Write-Host "`n[2/4] Removing demo database volume..." -ForegroundColor Yellow
podman volume rm likwid_demo_data -f 2>$null
Write-Host "`n[3/4] Starting fresh demo instance..." -ForegroundColor Yellow
podman-compose -f compose/demo.yml up -d
Write-Host "`n[4/4] Waiting for services to be ready..." -ForegroundColor Yellow
Start-Sleep -Seconds 10
# Check if backend is responding
$maxRetries = 30
$retry = 0
while ($retry -lt $maxRetries) {
try {
$response = Invoke-WebRequest -Uri "http://localhost:3001/health" -UseBasicParsing -TimeoutSec 2
if ($response.StatusCode -eq 200) {
Write-Host "`n=== Demo Reset Complete ===" -ForegroundColor Green
Write-Host "`nDemo is ready at:"
Write-Host " Frontend: http://localhost:4322" -ForegroundColor Cyan
Write-Host " Backend: http://localhost:3001" -ForegroundColor Cyan
Write-Host "`nDemo accounts (password: demo123):"
Write-Host " - contributor (standard member)"
Write-Host " - moderator (can moderate)"
Write-Host " - observer (read-only)"
exit 0
}
} catch {
$retry++
Write-Host "." -NoNewline
Start-Sleep -Seconds 1
}
}
Write-Host "`nWarning: Backend health check timed out. Check logs with:" -ForegroundColor Yellow
Write-Host " podman-compose -f compose/demo.yml logs backend"