Spaces:
Running
Running
File size: 1,174 Bytes
b42dfef |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 |
#!/bin/bash
# Start both backend and frontend in separate terminal windows
echo "π Starting AnyCoder Full-Stack Application..."
echo ""
# Function to check if a command exists
command_exists() {
command -v "$1" >/dev/null 2>&1
}
# Check for required tools
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
# Make scripts executable
chmod +x start_backend.sh
chmod +x start_frontend.sh
echo "π¦ Starting Backend..."
# Start backend in background with venv activated
(source /Users/ahsenkhaliq/anycoder/.venv/bin/activate && python backend_api.py) &
BACKEND_PID=$!
# Wait for backend to start
sleep 3
echo ""
echo "π¨ Starting Frontend..."
# Start frontend in background
./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"
# Wait for Ctrl+C
trap "kill $BACKEND_PID $FRONTEND_PID; exit" INT
wait
|