-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstart.sh
More file actions
executable file
·86 lines (68 loc) · 2.46 KB
/
start.sh
File metadata and controls
executable file
·86 lines (68 loc) · 2.46 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
#!/bin/bash
# Doc Processor Fullstack Startup Script (macOS)
# Launches backend, frontend, and ngrok tunnel for backend
echo "🚀 Starting Doc Processor Fullstack Application..."
echo "================================================="
# Get the directory where this script is located
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
BACKEND_DIR="$SCRIPT_DIR/backend"
FRONTEND_DIR="$SCRIPT_DIR/frontend"
# Check if directories exist
if [ ! -d "$BACKEND_DIR" ]; then
echo "❌ Backend directory not found at: $BACKEND_DIR"
exit 1
fi
if [ ! -d "$FRONTEND_DIR" ]; then
echo "❌ Frontend directory not found at: $FRONTEND_DIR"
exit 1
fi
echo "✅ Backend directory found: $BACKEND_DIR"
echo "✅ Frontend directory found: $FRONTEND_DIR"
# Check if start scripts exist
if [ ! -f "$BACKEND_DIR/start.sh" ]; then
echo "❌ Backend start script not found at: $BACKEND_DIR/start.sh"
exit 1
fi
if [ ! -f "$FRONTEND_DIR/start.sh" ]; then
echo "❌ Frontend start script not found at: $FRONTEND_DIR/start.sh"
exit 1
fi
echo "✅ Start scripts found"
# Function to launch commands in macOS Terminal
launch_in_terminal() {
local title="$1"
local command="$2"
local dir="$3"
osascript <<EOF
tell application "Terminal"
do script "cd '$dir' && echo '🎯 $title' && $command"
set custom title of front window to "$title"
end tell
EOF
}
echo ""
echo "🎯 Launching Backend Server..."
launch_in_terminal "Doc Processor Backend" "./start.sh" "$BACKEND_DIR"
# Give backend a moment to start
sleep 2
echo "🎯 Launching Frontend Development Server..."
launch_in_terminal "Doc Processor Frontend" "./start.sh" "$FRONTEND_DIR"
# Give frontend a moment to start
sleep 1
# Launch ngrok tunnel for backend
echo ""
echo "🎯 Launching ngrok tunnel for backend..."
ngrok http --url=mammoth-stirring-remarkably.ngrok-free.app 8000 > /dev/null &
NGROK_BACKEND_PID=$!
echo "✅ ngrok tunnel started"
echo "🔗 Backend Public URL: https://mammoth-stirring-remarkably.ngrok-free.app"
echo ""
echo "🎉 Fullstack application is starting!"
echo "🔗 Backend API (local): http://localhost:8000"
echo "🔗 Frontend App (local): http://localhost:8080"
echo "📖 API Docs (local): http://localhost:8000/docs"
echo ""
echo "💡 Backend is publicly accessible via ngrok"
echo "💡 Both services are running in separate terminal windows"
echo "💡 Close those terminal windows to stop the services"
echo "💡 Use Ctrl+C in each terminal to gracefully shut down"