#!/bin/bash # # Start Visual Workflow Builder - Full Stack # # This script starts both backend (Flask) and frontend (React) 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 - Start All" echo "==========================================" # Start Backend echo -e "${BLUE}Starting Backend...${NC}" cd "$SCRIPT_DIR/backend" ./start.sh BACKEND_STATUS=$? if [ $BACKEND_STATUS -ne 0 ]; then echo -e "${RED}✗ Backend failed to start${NC}" exit 1 fi # Wait a moment for backend to be ready sleep 2 # Check if frontend exists and has node_modules if [ -d "$SCRIPT_DIR/frontend" ]; then echo "" echo -e "${BLUE}Starting Frontend...${NC}" cd "$SCRIPT_DIR/frontend" # Check if package.json has start script if [ -f "package.json" ] && grep -q '"start"' package.json; then # Check if node_modules exists if [ ! -d "node_modules" ]; then echo -e "${YELLOW}node_modules not found. Please run 'npm install' first.${NC}" echo -e "${YELLOW}Frontend will not be started.${NC}" else # Check if start script exists in frontend if [ -f "start.sh" ]; then ./start.sh FRONTEND_STATUS=$? if [ $FRONTEND_STATUS -ne 0 ]; then echo -e "${YELLOW}Frontend failed to start (this is expected in Phase 1)${NC}" echo -e "${YELLOW}Backend is still running.${NC}" fi else echo -e "${YELLOW}Frontend start script not found.${NC}" echo -e "${YELLOW}Frontend will be implemented in Phase 2.${NC}" fi fi else echo -e "${YELLOW}Frontend not yet configured (Phase 1).${NC}" echo -e "${YELLOW}Frontend will be implemented in Phase 2.${NC}" fi else echo "" echo -e "${YELLOW}Frontend directory not found.${NC}" echo -e "${YELLOW}Frontend will be implemented in Phase 2.${NC}" fi echo "" echo "==========================================" echo -e "${GREEN}✓ Visual Workflow Builder Started!${NC}" echo "==========================================" echo "Backend: http://localhost:5001" echo "Frontend: http://localhost:3000 (when implemented)" echo "" echo "To stop all services: ./stop.sh" echo "To check status: ./status.sh" echo "=========================================="