-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstart.sh
More file actions
executable file
·71 lines (60 loc) · 1.59 KB
/
Copy pathstart.sh
File metadata and controls
executable file
·71 lines (60 loc) · 1.59 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#!/bin/bash
echo "=========================================="
echo " Starting Quantum Compiler"
echo "=========================================="
echo ""
# Colors
GREEN='\033[0;32m'
BLUE='\033[0;34m'
YELLOW='\033[1;33m'
NC='\033[0m' # No Color
# Check if dependencies are installed
if [ ! -d "backend/node_modules" ] || [ ! -d "frontend/node_modules" ]; then
echo -e "${YELLOW}⚠ Dependencies not found. Running setup first...${NC}"
./setup.sh
echo ""
fi
# Kill any existing processes on ports 5000 and 3000
echo -e "${YELLOW}Cleaning up existing processes...${NC}"
pkill -f "node server.js" 2>/dev/null
lsof -ti:3000 | xargs kill -9 2>/dev/null
sleep 1
echo ""
# Function to cleanup on exit
cleanup() {
echo ""
echo -e "${YELLOW}Shutting down servers...${NC}"
kill $BACKEND_PID $FRONTEND_PID 2>/dev/null
exit 0
}
trap cleanup SIGINT SIGTERM
# Start backend
echo -e "${BLUE}Starting backend server...${NC}"
cd backend
npm start > ../backend.log 2>&1 &
BACKEND_PID=$!
cd ..
# Wait a moment for backend to start
sleep 2
# Start frontend
echo -e "${BLUE}Starting frontend server...${NC}"
cd frontend
npm start > ../frontend.log 2>&1 &
FRONTEND_PID=$!
cd ..
echo ""
echo "=========================================="
echo -e "${GREEN}✓ Quantum Compiler is starting!${NC}"
echo "=========================================="
echo ""
echo "Backend: http://localhost:5000"
echo "Frontend: http://localhost:3000"
echo ""
echo "Logs:"
echo " Backend: tail -f backend.log"
echo " Frontend: tail -f frontend.log"
echo ""
echo "Press Ctrl+C to stop all servers"
echo ""
# Wait for processes
wait