#!/bin/bash # # Check Visual Workflow Builder Status - Full Stack # # This script checks the status of both backend and frontend servers # SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" # Colors for output GREEN='\033[0;32m' RED='\033[0;31m' YELLOW='\033[1;33m' BLUE='\033[0;34m' NC='\033[0m' # No Color echo "==========================================" echo "Visual Workflow Builder - Full Status" echo "==========================================" # Check Backend echo -e "${BLUE}BACKEND STATUS${NC}" echo "-----------------------------------" if [ -f "$SCRIPT_DIR/backend/status.sh" ]; then cd "$SCRIPT_DIR/backend" ./status.sh else # Manual check BACKEND_PID=$(lsof -ti:5001 2>/dev/null) if [ -z "$BACKEND_PID" ]; then echo -e "${RED}Status: NOT RUNNING${NC}" echo "Port 5001: FREE" else echo -e "${GREEN}Status: RUNNING${NC}" echo "Port 5001: IN USE (PID: $BACKEND_PID)" # Health check if command -v curl &> /dev/null; then HEALTH=$(curl -s -o /dev/null -w "%{http_code}" http://localhost:5001/health 2>/dev/null) if [ "$HEALTH" = "200" ]; then echo -e "${GREEN}Health Check: OK ✓${NC}" else echo -e "${RED}Health Check: FAILED${NC}" fi fi fi fi echo "" echo "==========================================" # Check Frontend echo -e "${BLUE}FRONTEND STATUS${NC}" echo "-----------------------------------" if [ -f "$SCRIPT_DIR/frontend/status.sh" ]; then cd "$SCRIPT_DIR/frontend" ./status.sh else # Manual check FRONTEND_PID=$(lsof -ti:3000 2>/dev/null) if [ -z "$FRONTEND_PID" ]; then echo -e "${RED}Status: NOT RUNNING${NC}" echo "Port 3000: FREE" echo -e "${YELLOW}Note: Frontend will be implemented in Phase 2${NC}" else echo -e "${GREEN}Status: RUNNING${NC}" echo "Port 3000: IN USE (PID: $FRONTEND_PID)" # Health check if command -v curl &> /dev/null; then HEALTH=$(curl -s -o /dev/null -w "%{http_code}" http://localhost:3000 2>/dev/null) if [ "$HEALTH" = "200" ]; then echo -e "${GREEN}Health Check: OK ✓${NC}" else echo -e "${YELLOW}Health Check: Response code $HEALTH${NC}" fi fi fi fi echo "" echo "==========================================" echo -e "${BLUE}QUICK ACCESS${NC}" echo "-----------------------------------" echo "Backend API: http://localhost:5001" echo "Backend Health: http://localhost:5001/health" echo "Frontend: http://localhost:3000" echo "" echo "Commands:" echo " ./start.sh - Start all services" echo " ./stop.sh - Stop all services" echo " ./restart.sh - Restart all services" echo "=========================================="