Repository navigation
Expand file tree
/
Copy pathstart.sh
More file actions
executable file
·65 lines (54 loc) · 1.56 KB
/
Copy pathstart.sh
File metadata and controls
executable file
·65 lines (54 loc) · 1.56 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
#!/usr/bin/env bash
# One-command startup for FastAgentFactory Web.
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
source "${SCRIPT_DIR}/web_frontend/lib/runtime_env.sh"
web_require_project_root
cd "${PROJECT_ROOT}"
echo "==================================="
echo "FastAgentFactory Web"
echo "==================================="
echo ""
web_check_env_configuration
echo ""
web_sync_python_dependencies
web_sync_frontend_dependencies
web_ensure_runtime_image
BACKEND_PID=""
cleanup() {
local exit_code=$?
trap - EXIT INT TERM
if [[ -n "${BACKEND_PID}" ]] && kill -0 "${BACKEND_PID}" >/dev/null 2>&1; then
echo ""
echo "Stopping backend service..."
kill "${BACKEND_PID}" >/dev/null 2>&1 || true
wait "${BACKEND_PID}" 2>/dev/null || true
fi
exit "${exit_code}"
}
trap cleanup EXIT INT TERM
echo ""
echo "Starting backend web runtime service on port 8000..."
"${PYTHON_BIN}" web_frontend/backend/event_api_server.py &
BACKEND_PID=$!
echo "Waiting for backend to be ready..."
if ! web_wait_for_backend "${BACKEND_PID}" 45 1; then
echo "Backend failed to start"
exit 1
fi
echo "Backend runtime service ready: http://localhost:8000"
echo ""
echo "Starting frontend development server on port 3000..."
echo ""
echo "==================================="
echo "Application ready"
echo "Frontend: http://localhost:3000"
echo "Backend: http://localhost:8000"
echo "==================================="
echo ""
echo "Press Ctrl+C to stop all services"
echo ""
(
cd "${FRONTEND_DIR}"
npm run dev
)