Refactor frontend setup in guardian-install.sh to streamline installation process and update service configuration

This commit is contained in:
Vincent 2025-09-30 15:11:18 -04:00
parent c520602fcb
commit f48609011b

View File

@ -43,12 +43,11 @@ npm ci
npm run build npm run build
msg_ok "Built backend" msg_ok "Built backend"
# ===== Build Frontend ===== # ===== Install Frontend Dependencies =====
msg_info "Building frontend" msg_info "Installing frontend dependencies"
cd /opt/Guardian/frontend cd /opt/Guardian/frontend
npm ci npm ci
npm run build msg_ok "Installed frontend dependencies"
msg_ok "Built frontend"
# ===== Backend Service ===== # ===== Backend Service =====
msg_info "Creating Backend Service" msg_info "Creating Backend Service"
@ -81,7 +80,8 @@ Wants=guardian-backend.service
[Service] [Service]
WorkingDirectory=/opt/Guardian/frontend WorkingDirectory=/opt/Guardian/frontend
Environment=NODE_ENV=development Environment=NODE_ENV=development
ExecStart=/usr/bin/npm run start Environment=PORT=3000
ExecStart=/usr/bin/npm run dev
Restart=always Restart=always
RestartSec=3 RestartSec=3