-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathrun.sh
More file actions
executable file
·67 lines (54 loc) · 1.88 KB
/
Copy pathrun.sh
File metadata and controls
executable file
·67 lines (54 loc) · 1.88 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
#!/bin/bash
# Colors for output
GREEN='\033[0;32m'
RED='\033[0;31m'
NC='\033[0m' # No Color
echo -e "${GREEN}Starting Autonomous Procurement Agent Services${NC}"
# Function to handle cleanup on exit
cleanup() {
echo -e "${RED}Stopping all services...${NC}"
kill $(jobs -p) 2>/dev/null
exit
}
trap cleanup SIGINT SIGTERM
# Check for venv
if [ ! -d ".venv" ]; then
echo -e "${RED}Error: Virtual environment not found. Please run ./setup.sh first.${NC}"
exit 1
fi
# Activate venv
source .venv/bin/activate
# ============================================================================
# 1. Run MCP Servers
# ============================================================================
echo -e "${GREEN}Starting MongoDB MCP Server...${NC}"
cd mcp_server/mongodb
python -m uvicorn main:starlette_app --host 0.0.0.0 --port 8081 &
MONGO_PID=$!
cd ../..
echo -e "${GREEN}Starting PDF Generation MCP Server...${NC}"
cd mcp_server/pdf-generation
python -m uvicorn main:starlette_app --host 0.0.0.0 --port 8082 &
PDF_PID=$!
cd ../..
# ============================================================================
# 2. Run Procurement Agent
# ============================================================================
echo -e "${GREEN}Starting Procurement Agent...${NC}"
python -m uvicorn procurement.agent:app --host 0.0.0.0 --port 8000 --reload &
AGENT_PID=$!
# ============================================================================
# 3. Run Frontend
# ============================================================================
echo -e "${GREEN}Starting Frontend...${NC}"
cd app
yarn start &
FRONTEND_PID=$!
cd ..
echo -e "${GREEN}All services started!${NC}"
echo -e "Frontend: http://localhost:4200"
echo -e "Agent API: http://localhost:8000"
echo -e "MongoDB MCP: http://localhost:8081"
echo -e "PDF MCP: http://localhost:8082"
echo -e "${GREEN}Press Ctrl+C to stop all services.${NC}"
wait