-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstart-fluent.sh
More file actions
110 lines (91 loc) · 2.28 KB
/
start-fluent.sh
File metadata and controls
110 lines (91 loc) · 2.28 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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
#!/bin/bash
echo ""
echo "========================================"
echo " FLUENT - Data Analysis Platform"
echo "========================================"
echo ""
# Function to check if a command exists
command_exists() {
command -v "$1" >/dev/null 2>&1
}
# Check prerequisites
echo "Checking prerequisites..."
if ! command_exists python3; then
echo "❌ Python 3 is not installed. Please install Python 3.8 or higher."
exit 1
fi
if ! command_exists node; then
echo "❌ Node.js is not installed. Please install Node.js 18 or higher."
exit 1
fi
if ! command_exists npm; then
echo "❌ npm is not installed. Please install npm."
exit 1
fi
echo "✅ Prerequisites check passed!"
echo ""
# Install backend dependencies
echo "Installing backend dependencies..."
cd backend
if [ ! -f "requirements.txt" ]; then
echo "❌ requirements.txt not found in backend directory"
exit 1
fi
pip3 install -r requirements.txt
if [ $? -ne 0 ]; then
echo "❌ Failed to install backend dependencies"
exit 1
fi
cd ..
# Install frontend dependencies
echo "Installing frontend dependencies..."
cd frontend
if [ ! -f "package.json" ]; then
echo "❌ package.json not found in frontend directory"
exit 1
fi
npm install
if [ $? -ne 0 ]; then
echo "❌ Failed to install frontend dependencies"
exit 1
fi
cd ..
echo "✅ Dependencies installed successfully!"
echo ""
# Start backend in background
echo "Starting Backend Server..."
cd backend
python3 start.py &
BACKEND_PID=$!
cd ..
# Wait a moment for backend to start
sleep 3
# Start frontend
echo "Starting Frontend Server..."
cd frontend
npm run dev &
FRONTEND_PID=$!
cd ..
echo ""
echo "========================================"
echo " Fluent is running!"
echo ""
echo " Frontend: http://localhost:3000"
echo " Backend API: http://localhost:8000"
echo " API Docs: http://localhost:8000/docs"
echo "========================================"
echo ""
echo "Press Ctrl+C to stop all servers..."
# Function to cleanup background processes
cleanup() {
echo ""
echo "Shutting down servers..."
kill $BACKEND_PID 2>/dev/null
kill $FRONTEND_PID 2>/dev/null
echo "✅ Servers stopped. Goodbye!"
exit 0
}
# Set trap to cleanup on script exit
trap cleanup SIGINT SIGTERM
# Wait for user to press Ctrl+C
wait