#!/bin/bash

set -e

echo "🔨 Rebuilding Calypso API..."
cd /development/calypso/backend
make build

echo ""
echo "🔨 Rebuilding Calypso Frontend..."
cd /development/calypso/frontend
npm run build

echo ""
echo "🔄 Restarting API service..."
systemctl restart calypso-api.service

echo "🔄 Restarting Frontend service..."
systemctl restart calypso-frontend.service

echo ""
echo "✅ Build and restart complete!"
echo ""

systemctl status calypso-api.service calypso-frontend.service --no-pager
