Spaces:
Running
Running
| # 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 | |