#!/bin/bash
# Script setup Website Desa Suka Baru
# Jalankan dari folder: F:\web Desa Suka Baru\website-desa-suka-baru

echo "=== SETUP WEBSITE DESA SUKA BARU ==="

echo ""
echo "[1/6] Membuat database MySQL 'desa_suka_baru'..."
echo "Buka phpMyAdmin atau jalankan: mysql -u root -e \"CREATE DATABASE IF NOT EXISTS desa_suka_baru\""

echo ""
echo "[2/6] Install Intervention Image untuk resize/kompres foto..."
composer require intervention/image-laravel

echo ""
echo "[3/6] Install npm dependencies..."
npm install

echo ""
echo "[4/6] Build assets Tailwind CSS..."
npm run build

echo ""
echo "[5/6] Jalankan database migration..."
php artisan migrate

echo ""
echo "[6/7] Buat storage symbolic link..."
php artisan storage:link

echo ""
echo "[7/7] Isi data awal desa (seeder)..."
php artisan db:seed

echo ""
echo "=== SELESAI! ==="
echo ""
echo "Jalankan server: php artisan serve"
echo "Buka: http://localhost:8000"
echo ""
echo "LOGIN ADMIN:"
echo "URL: http://localhost:8000/admin"
echo "Email: admin@desakukaru.desa.id"
echo "Password: Admin123!"
echo ""
echo "PENTING: Ganti password admin setelah login pertama kali!"
