-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstart.sh
More file actions
executable file
·77 lines (61 loc) · 1.69 KB
/
Copy pathstart.sh
File metadata and controls
executable file
·77 lines (61 loc) · 1.69 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
#!/bin/bash
# PostgreSQL Data Migration Tool Startup Script
echo "🚀 Starting PostgreSQL Data Migration Tool..."
# Check if Python is installed
if ! command -v python3 &> /dev/null; then
echo "❌ Python 3 is required but not installed."
exit 1
fi
# Check if Node.js is installed
if ! command -v node &> /dev/null; then
echo "❌ Node.js is required but not installed."
exit 1
fi
# Check if npm is installed
if ! command -v npm &> /dev/null; then
echo "❌ npm is required but not installed."
exit 1
fi
echo "✅ Prerequisites check passed"
# Install Python dependencies if needed
if [ ! -d "venv" ]; then
echo "📦 Creating Python virtual environment..."
python3 -m venv venv
fi
echo "📦 Installing Python dependencies..."
source venv/bin/activate
pip install -r requirements.txt
# Install Node.js dependencies if needed
if [ ! -d "node_modules" ]; then
echo "📦 Installing Node.js dependencies..."
npm install
fi
echo "🔧 Starting backend server..."
# Start backend in background
source venv/bin/activate && python main.py &
BACKEND_PID=$!
# Wait a moment for backend to start
sleep 3
echo "🎨 Starting frontend server..."
# Start frontend
npm start &
FRONTEND_PID=$!
echo ""
echo "🎉 Application is starting up!"
echo ""
echo "📍 Backend API: http://localhost:8000"
echo "🌐 Frontend UI: http://localhost:3000"
echo ""
echo "Press Ctrl+C to stop both servers"
# Function to cleanup background processes
cleanup() {
echo ""
echo "🛑 Shutting down servers..."
kill $BACKEND_PID 2>/dev/null
kill $FRONTEND_PID 2>/dev/null
exit 0
}
# Set trap to cleanup on script exit
trap cleanup SIGINT SIGTERM
# Wait for either process to exit
wait