#!/bin/bash
# Website Bootstrap Script

set -e

echo "🚀 Starting StartupLX Website Bootstrap..."

# Check if running from correct directory
if [ ! -f "docker-compose.yml" ]; then
    echo "❌ Error: Run this script from the /startuplx directory"
    exit 1
fi

# Create services directory if not exists
mkdir -p services/website/public

# Copy template files
echo "📄 Creating project files..."

# Create package.json for website service
cat > services/website/package.json << 'EOF'
{
  "name": "startuplx-website",
  "version": "0.0.1",
  "type": "module",
  "scripts": {
    "dev": "astro dev",
    "build": "astro build",
    "preview": "astro preview"
  },
  "dependencies": {
    "astro": "^4.0.0",
    "tailwindcss": "^3.4.0"
  }
}
EOF

# Create astro.config.mjs
cat > services/website/astro.config.mjs << 'EOF'
import { defineConfig } from 'astro/config'
import tailwind from '@astrojs/tailwind'

export default defineConfig({
  site: 'https://startuplx.com',
  integrations: [tailwind()]
})
EOF

# Create tailwind config
cat > services/website/tailwind.config.js << 'EOF'
export default {
  content: ['./src/**/*.{astro,html,js,jsx,ts,tsx}'],
  theme: { extend: {} },
  plugins: [],
}
EOF

echo "✅ Website scaffold created!"
echo "⏭️ Next steps:"
echo "  1. CD into services/website"
echo "  2. RUN: npm install"
echo "  3. RUN: npm run dev"
echo "  4. Build on VPS: npm run build"