mirror of
https://codeberg.org/likwid/likwid.git
synced 2026-02-10 05:23:09 +00:00
- 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
52 lines
1.7 KiB
Bash
52 lines
1.7 KiB
Bash
#!/bin/bash
|
|
# Demo Reset Script (Linux/macOS)
|
|
# Resets the demo instance to a clean state with fresh seed data
|
|
|
|
set -e
|
|
|
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
cd "$SCRIPT_DIR/.."
|
|
|
|
echo "=== Likwid Demo Reset ==="
|
|
|
|
if [ "$1" != "--force" ] && [ "$1" != "-f" ]; then
|
|
read -p "This will DELETE all demo data and reset to initial state. Continue? (y/N) " confirm
|
|
if [ "$confirm" != "y" ] && [ "$confirm" != "Y" ]; then
|
|
echo "Aborted."
|
|
exit 0
|
|
fi
|
|
fi
|
|
|
|
echo -e "\n[1/4] Stopping demo containers..."
|
|
podman-compose -f compose/demo.yml down || docker-compose -f compose/demo.yml down
|
|
|
|
echo -e "\n[2/4] Removing demo database volume..."
|
|
podman volume rm likwid_demo_data -f 2>/dev/null || docker volume rm likwid_demo_data -f 2>/dev/null || true
|
|
|
|
echo -e "\n[3/4] Starting fresh demo instance..."
|
|
podman-compose -f compose/demo.yml up -d || docker-compose -f compose/demo.yml up -d
|
|
|
|
echo -e "\n[4/4] Waiting for services to be ready..."
|
|
sleep 5
|
|
|
|
max_retries=30
|
|
retry=0
|
|
while [ $retry -lt $max_retries ]; do
|
|
if curl -s http://localhost:3001/health > /dev/null 2>&1; then
|
|
echo -e "\n=== Demo Reset Complete ==="
|
|
echo -e "\nDemo is ready at:"
|
|
echo " Frontend: http://localhost:4322"
|
|
echo " Backend: http://localhost:3001"
|
|
echo -e "\nDemo accounts (password: demo123):"
|
|
echo " - contributor (standard member)"
|
|
echo " - moderator (can moderate)"
|
|
echo " - observer (read-only)"
|
|
exit 0
|
|
fi
|
|
retry=$((retry + 1))
|
|
echo -n "."
|
|
sleep 1
|
|
done
|
|
|
|
echo -e "\nWarning: Backend health check timed out. Check logs with:"
|
|
echo " podman-compose -f compose/demo.yml logs backend"
|