#!/bin/bash # Cursor Full Stack AI IDE - Deployment Preparation Script # This script prepares the application for Cloudflare Pages deployment set -e # Colors GREEN='\033[0;32m' BLUE='\033[0;34m' YELLOW='\033[1;33m' RED='\033[0;31m' NC='\033[0m' echo -e "${BLUE}" echo "==========================================" echo " 🚀 Cursor Full Stack AI IDE" echo " 📦 Deployment Preparation" echo "==========================================" echo -e "${NC}" # Check if we're in the right directory if [ ! -f "package.json" ]; then echo -e "${RED}Error: Please run this script from the project root directory${NC}" exit 1 fi # Clean and create deployment directory echo -e "${YELLOW}Cleaning deployment directory...${NC}" rm -rf deployment-package mkdir -p deployment-package # Build frontend echo -e "${YELLOW}Building frontend...${NC}" cd cloudflare/frontend npm install npm run build # Copy built files echo -e "${YELLOW}Copying built files...${NC}" cp -r dist/* ../../deployment-package/ # Copy configuration files echo -e "${YELLOW}Copying configuration files...${NC}" cd ../.. # The configuration files are already in the deployment-package directory # from when we created them earlier # Create a simple index.html if it doesn't exist if [ ! -f "deployment-package/index.html" ]; then echo -e "${YELLOW}Creating index.html...${NC}" cat > deployment-package/index.html << 'EOF'