- Full inventory UI: product list with search/filter, product detail with tabs (details, units, suppliers, stock receipts, price history) - Product filters: category, type (serialized/rental/repair), low stock, active/inactive — all server-side with URL-synced state - Product-supplier junction: link products to multiple suppliers with preferred flag, joined supplier details in UI - Stock receipts: record incoming stock with supplier, qty, cost per unit, invoice number; auto-increments qty_on_hand for non-serialized products - Price history tab on product detail page - categories/all endpoint to avoid pagination limit on dropdown fetches - categoryId filter on product list endpoint - Repair parts and additional inventory items in music store seed data - isDualUseRepair corrected: instruments set to false, strings/parts true - Product-supplier links and stock receipts in seed data - Price history seed data simulating cost increases over past year - 37 API tests covering categories, suppliers, products, units, product-suppliers, and stock receipts - alert-dialog and checkbox UI components - sync-and-deploy.sh script for rsync + remote deploy
28 lines
754 B
Bash
Executable File
28 lines
754 B
Bash
Executable File
#!/usr/bin/env bash
|
|
# LunarFront — Redeploy script (run after pushing changes to main)
|
|
# Usage: sudo bash deploy/deploy.sh
|
|
set -euo pipefail
|
|
|
|
APP_DIR="/opt/lunarfront"
|
|
APP_USER="ubuntu"
|
|
BUN_BIN="/home/${APP_USER}/.bun/bin/bun"
|
|
|
|
cd "$APP_DIR"
|
|
|
|
echo "==> Installing dependencies..."
|
|
sudo -u "$APP_USER" "$BUN_BIN" install --frozen-lockfile
|
|
|
|
echo "==> Building admin frontend..."
|
|
sudo -u "$APP_USER" bash -c "cd ${APP_DIR}/packages/admin && ${BUN_BIN} run build"
|
|
|
|
echo "==> Running migrations..."
|
|
sudo -u "$APP_USER" bash -c \
|
|
"cd ${APP_DIR}/packages/backend && ${BUN_BIN} x drizzle-kit migrate"
|
|
|
|
echo "==> Restarting backend..."
|
|
sudo systemctl restart lunarfront
|
|
|
|
echo "==> Done! Checking status..."
|
|
sleep 2
|
|
sudo systemctl status lunarfront --no-pager
|