-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstart-dev.sh
More file actions
executable file
·91 lines (72 loc) · 2.12 KB
/
start-dev.sh
File metadata and controls
executable file
·91 lines (72 loc) · 2.12 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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
#!/bin/bash
echo "================================================"
echo " GWorkspace Toolbox - Development Environment "
echo "================================================"
echo ""
# Check if Python is installed
if ! command -v python3 &> /dev/null; then
echo "❌ Python 3 is not installed. Please install Python 3.11 or higher."
exit 1
fi
# Check if Node.js is installed
if ! command -v node &> /dev/null; then
echo "❌ Node.js is not installed. Please install Node.js 18 or higher."
exit 1
fi
echo "✅ Python version: $(python3 --version)"
echo "✅ Node.js version: $(node --version)"
echo ""
# Backend setup
echo "📦 Setting up Backend..."
cd backend
if [ ! -d "venv" ]; then
echo "Creating Python virtual environment..."
python3 -m venv venv
fi
echo "Activating virtual environment..."
source venv/bin/activate
echo "Installing Python dependencies..."
pip install -q -r requirements.txt
echo "✅ Backend setup complete!"
echo ""
# Frontend setup
echo "📦 Setting up Frontend..."
cd ../frontend
if [ ! -d "node_modules" ]; then
echo "Installing Node.js dependencies..."
npm install
else
echo "Node modules already installed."
fi
echo "✅ Frontend setup complete!"
echo ""
# Start services
echo "================================================"
echo " Starting GWorkspace Toolbox Services "
echo "================================================"
echo ""
cd ..
echo "🚀 Starting Backend on http://localhost:8000..."
cd backend
./venv/bin/python main.py &
BACKEND_PID=$!
cd ..
echo "🚀 Starting Frontend on http://localhost:3000..."
cd frontend
npm run dev &
FRONTEND_PID=$!
echo ""
echo "================================================"
echo " GWorkspace Toolbox is Running! "
echo "================================================"
echo ""
echo "📍 Frontend: http://localhost:3000"
echo "📍 Backend API: http://localhost:8000"
echo "📍 API Docs: http://localhost:8000/docs"
echo ""
echo "Press Ctrl+C to stop all services..."
echo ""
# Trap Ctrl+C and kill both processes
trap "echo ''; echo 'Stopping services...'; kill $BACKEND_PID $FRONTEND_PID; exit" INT
# Wait for processes
wait