This commit is contained in:
lubiana 2025-07-25 14:41:43 +02:00
parent c0f49a8f50
commit 91d308485b
Signed by: lubiana
SSH key fingerprint: SHA256:vW1EA0fRR3Fw+dD/sM0K+x3Il2gSry6YRYHqOeQwrfk
2 changed files with 58 additions and 43 deletions

42
demo.sh
View file

@ -1,42 +0,0 @@
#!/bin/bash
echo "🚀 Starting GoCheck Demo"
echo "========================"
# Start the server in the background
echo "Starting server..."
./gocheck &
SERVER_PID=$!
# Wait for server to start
sleep 2
echo ""
echo "✅ Server is running at http://localhost:8080"
echo ""
echo "🌐 Open your browser and go to: http://localhost:8080"
echo ""
echo "📋 Demo Features:"
echo " • Create a new checklist"
echo " • Add items to your checklist"
echo " • Check/uncheck items"
echo " • Edit item content"
echo " • Lock items to prevent conflicts"
echo " • Create hierarchical items (sub-items)"
echo " • Real-time collaboration (open multiple browser tabs)"
echo ""
echo "🔧 API Testing:"
echo " • Create checklist: POST /api/checklists"
echo " • Add item: POST /api/checklists/{uuid}/items"
echo " • Get items: GET /api/checklists/{uuid}/items"
echo " • Update item: PATCH /api/checklists/{uuid}/items/{id}"
echo " • Delete item: DELETE /api/checklists/{uuid}/items/{id}"
echo " • Lock item: POST /api/checklists/{uuid}/items/{id}/lock"
echo " • Real-time updates: GET /api/checklists/{uuid}/sse"
echo ""
echo "Press Ctrl+C to stop the server"
echo ""
# Wait for user to stop
trap "echo ''; echo '🛑 Stopping server...'; kill $SERVER_PID; exit" INT
wait

59
dev.sh
View file

@ -1,8 +1,65 @@
#!/bin/bash #!/bin/bash
# Function to cleanup processes
cleanup() {
echo ""
echo "🛑 Shutting down processes..."
# Kill child processes
if [ ! -z "$AIR_PID" ]; then
echo " Stopping Air server (PID: $AIR_PID)..."
kill $AIR_PID 2>/dev/null || true
fi
if [ ! -z "$VITE_PID" ]; then
echo " Stopping Vite server (PID: $VITE_PID)..."
kill $VITE_PID 2>/dev/null || true
fi
# Kill any remaining processes
pkill -f "gocheck" 2>/dev/null || true
pkill -f "vite" 2>/dev/null || true
pkill -f "esbuild" 2>/dev/null || true
pkill -f "air" 2>/dev/null || true
echo "✅ All processes stopped"
exit 0
}
# Set up signal handlers
trap cleanup SIGINT SIGTERM
# Kill any existing processes
echo "🔄 Cleaning up existing processes..."
pkill -f "gocheck" 2>/dev/null || true
pkill -f "vite" 2>/dev/null || true
pkill -f "esbuild" 2>/dev/null || true
pkill -f "air" 2>/dev/null || true
sleep 1
# Verify processes are killed
if pgrep -f "gocheck\|vite\|esbuild\|air" > /dev/null; then
echo "⚠️ Some processes are still running. Force killing..."
pkill -9 -f "gocheck" 2>/dev/null || true
pkill -9 -f "vite" 2>/dev/null || true
pkill -9 -f "esbuild" 2>/dev/null || true
pkill -9 -f "air" 2>/dev/null || true
sleep 1
fi
echo "✅ Process cleanup completed"
# Run the server # Run the server
echo "🚀 Starting Go server with Air..."
air & air &
AIR_PID=$!
# Run the frontend # Run the frontend
echo "🎨 Starting frontend development server..."
sleep 2 sleep 2
cd frontend && npm run dev cd frontend && npm run dev &
VITE_PID=$!
# Wait for both processes
echo "📡 Development servers running. Press Ctrl+C to stop."
wait