-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstart.sh
More file actions
executable file
·53 lines (42 loc) · 1.28 KB
/
Copy pathstart.sh
File metadata and controls
executable file
·53 lines (42 loc) · 1.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
#!/bin/bash
# Healthmap Unified Startup Script
# This script coordinates the startup of all application components
echo "Starting Healthmap Application..."
# Check if postgresql is running and initialize database if needed
echo "Checking database status..."
if ! pg_isready > /dev/null 2>&1; then
echo "Database not running, initializing..."
# Add initialization code here if needed
fi
# Start all processes in background
echo "Starting backend services..."
# Start Express.js server
echo "Starting Express server..."
npm run dev &
EXPRESS_PID=$!
# Start Flask API server
echo "Starting Flask API server..."
python app.py &
FLASK_PID=$!
# Start Streamlit application
echo "Starting Streamlit application..."
streamlit run streamlit_app.py &
STREAMLIT_PID=$!
echo "All services started successfully!"
echo "Express server running with PID: $EXPRESS_PID"
echo "Flask API running with PID: $FLASK_PID"
echo "Streamlit app running with PID: $STREAMLIT_PID"
# Function to handle script termination
cleanup() {
echo "Shutting down all services..."
kill $EXPRESS_PID
kill $FLASK_PID
kill $STREAMLIT_PID
echo "All services terminated."
exit 0
}
# Register the cleanup function for script termination
trap cleanup INT TERM
# Keep the script running
echo "Press Ctrl+C to stop all services"
wait