|
|
#!/bin/bash |
|
|
|
|
|
|
|
|
echo "π Starting AnyCoder Full-Stack Application..." |
|
|
echo "" |
|
|
|
|
|
|
|
|
command_exists() { |
|
|
command -v "$1" >/dev/null 2>&1 |
|
|
} |
|
|
|
|
|
|
|
|
if ! command_exists python3; then |
|
|
echo "β Python 3 is not installed" |
|
|
exit 1 |
|
|
fi |
|
|
|
|
|
if ! command_exists node; then |
|
|
echo "β Node.js is not installed" |
|
|
exit 1 |
|
|
fi |
|
|
|
|
|
|
|
|
chmod +x start_backend.sh |
|
|
chmod +x start_frontend.sh |
|
|
|
|
|
echo "π¦ Starting Backend..." |
|
|
|
|
|
(source /Users/ahsenkhaliq/anycoder/.venv/bin/activate && python backend_api.py) & |
|
|
BACKEND_PID=$! |
|
|
|
|
|
|
|
|
sleep 3 |
|
|
|
|
|
echo "" |
|
|
echo "π¨ Starting Frontend..." |
|
|
|
|
|
./start_frontend.sh & |
|
|
FRONTEND_PID=$! |
|
|
|
|
|
echo "" |
|
|
echo "β
Full-stack application started!" |
|
|
echo "" |
|
|
echo "π Backend API: http://localhost:8000" |
|
|
echo "π API Docs: http://localhost:8000/docs" |
|
|
echo "π Frontend: http://localhost:3000" |
|
|
echo "" |
|
|
echo "Press Ctrl+C to stop both services" |
|
|
|
|
|
|
|
|
trap "kill $BACKEND_PID $FRONTEND_PID; exit" INT |
|
|
wait |
|
|
|
|
|
|