#!/bin/bash set -e echo "🚀 Starting Checkcle Installation..." # Check if npm is installed if ! command -v npm &> /dev/null; then echo "📦 npm is not installed. Installing Node.js and npm..." # Install Node.js and npm (Ubuntu/Debian-based systems) curl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash - sudo apt-get install -y nodejs fi # Clone the repo if [ ! -d "checkcle" ]; then echo "📁 Cloning repository..." git clone https://github.com/operacle/checkcle.git fi cd checkcle # Set up paths PROJECT_DIR=$(pwd) APP_DIR="$PROJECT_DIR/application" PB_DIR="$PROJECT_DIR/server" PB_BINARY="$PB_DIR/pocketbase" # Install web dependencies echo "📦 Installing Web Application dependencies..." cd "$APP_DIR" npm install # Create systemd service for frontend echo "🛠️ Setting up systemd service for Web Application..." sudo tee /etc/systemd/system/checkcle-web.service > /dev/null < /dev/null <