anycoder / start_fullstack.sh
akhaliq's picture
akhaliq HF Staff
new UI
b42dfef
raw
history blame
1.17 kB
#!/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