#!/bin/bash

# Build the project
echo "Building project..."
npm run build

# Create a deployment folder
echo "Preparing deployment files..."
rm -rf deploy deploy.zip
mkdir -p deploy
cp -r .next deploy/
cp -r public deploy/
cp server.js deploy/
cp package.json deploy/
cp next.config.ts deploy/

# Optional: Zip the files
echo "Zipping deployment files..."
cd deploy && zip -r ../deploy.zip . && cd ..

echo "Done! Upload 'deploy.zip' to your cPanel directory and follow the guide."
