
# One-time server dependencies (run once per new server, not every deploy)

## PHP Imagick extension (required for SKU Diagram JPEG generation)
```bash
sudo apt install -y php8.3-imagick
sudo systemctl restart php8.3-fpm
sudo supervisorctl restart cydekick-worker:*
```

## SVG font rendering (required for readable badge text in generated diagrams)
Without Liberation Sans, Imagick/librsvg falls back to a bitmap font — badge numbers
and SKU pill text will be blurry and unreadable.
```bash
sudo apt install -y fonts-liberation && fc-cache -fv
```

---

# Regular deploy

cd ..
cd var/www/html/Cydekick

git pull
composer install --no-dev --optimize-autoloader

npm ci --production=false && npm run build

php artisan migrate --force
php artisan view:clear
php artisan optimize:clear
php artisan optimize

# Restart PHP-FPM — required for web/Filament requests to pick up changed PHP
# classes. OPcache caches compiled bytecode at the PHP engine level; none of
# the artisan commands above touch it, only Laravel's own framework caches.
# Without this, the web process can keep serving old code indefinitely after
# a deploy even though the queue workers below get fresh code on restart.
sudo systemctl restart php8.3-fpm

# Restart all workers and scheduler
sudo supervisorctl restart cydekick-worker:*
sudo supervisorctl restart cydekick-scheduler

# Check everything is running
sudo supervisorctl status


# Running local workers

php artisan queue:work --queue=high,default --tries=1 --timeout=120





REMOVE ALL ORDERS

SET FOREIGN_KEY_CHECKS = 0;
TRUNCATE TABLE channel_orders_order_lines;
TRUNCATE TABLE channel_orders_orders;
SET FOREIGN_KEY_CHECKS = 1;

DELETE FROM cache WHERE `key` LIKE '%shopify_order_sync_since_id%';
DELETE FROM cache WHERE `key` LIKE '%shopify_order_sync_%';