Files
bikeservice/start-servers.sh
2025-08-27 09:17:56 +02:00

69 lines
1.9 KiB
Bash
Executable File

#!/bin/bash
echo "🚲 Fiets Service Applicatie Starten"
echo "===================================="
# Function to check if a port is in use
check_port() {
if lsof -Pi :$1 -sTCP:LISTEN -t >/dev/null ; then
echo "✅ Poort $1 is al in gebruik"
return 0
else
echo "❌ Poort $1 is niet in gebruik"
return 1
fi
}
# Check if ports are already in use
echo "🔍 Poort beschikbaarheid controleren..."
check_port 8000
laravel_running=$?
check_port 3000
vue_running=$?
# Start Laravel backend if not running
if [ $laravel_running -ne 0 ]; then
echo "🔄 Laravel backend server starten op poort 8000..."
cd backend
php artisan serve --host=0.0.0.0 --port=8000 &
LARAVEL_PID=$!
echo "✅ Laravel server gestart met PID: $LARAVEL_PID"
cd ..
else
echo "✅ Laravel backend draait al op poort 8000"
fi
# Start Vue.js frontend if not running
if [ $vue_running -ne 0 ]; then
echo "🔄 Vue.js frontend server starten op poort 3000..."
cd frontend
npm run dev &
VUE_PID=$!
echo "✅ Vue.js server gestart met PID: $VUE_PID"
cd ..
else
echo "✅ Vue.js frontend draait al op poort 3000"
fi
echo ""
echo "🎉 Fiets Service Applicatie wordt opgestart!"
echo "📱 Frontend: http://localhost:3000"
echo "🔧 Backend API: http://localhost:8000"
echo "📚 API Endpoints:"
echo " - Service Aanvragen: http://localhost:8000/api/service-requests"
echo " - Geblokkeerde Data: http://localhost:8000/api/blocked-dates"
echo " - Instellingen: http://localhost:8000/api/settings"
echo ""
echo "🚲 Test de applicatie:"
echo " 1. Open http://localhost:3000 in je browser"
echo " 2. Probeer een service aanvraag te boeken"
echo " 3. Bekijk het beheerpaneel voor beheerfuncties"
echo ""
echo "Druk op Ctrl+C om alle servers te stoppen"
# Wait for user input to stop servers
trap 'echo ""; echo "🛑 Servers stoppen..."; kill $LARAVEL_PID $VUE_PID 2>/dev/null; exit' INT
# Keep script running
wait