File size: 1,774 Bytes
a0a0034
 
 
771f178
a0a0034
 
771f178
a0a0034
771f178
a0a0034
 
 
 
 
 
 
 
771f178
 
a0a0034
 
771f178
 
a0a0034
771f178
 
a0a0034
 
 
 
 
771f178
 
a0a0034
771f178
a0a0034
 
 
771f178
 
 
 
 
 
 
 
 
 
 
 
a0a0034
771f178
 
 
 
 
 
a0a0034
 
 
771f178
a0a0034
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
#!/bin/bash

echo "======================================"
echo "  Starting Darak AI Platform..."
echo "======================================"

cd "$(dirname "$0")"

# 1. Python Virtual Environment
if [ ! -d "venv" ]; then
    echo "[*] Creating Python Virtual Environment..."
    python3 -m venv venv
fi

echo "[*] Activating Virtual Environment..."
source venv/bin/activate

echo "[*] Upgrading pip..."
pip install --upgrade pip setuptools wheel -q

# 2. Install Backend Dependencies
echo "[*] Installing Backend Dependencies..."
pip install -r backend/requirements.txt -q

# 3. Start Backend API on port 8000
echo "[*] Starting AI Backend on port 8000..."
cd backend
uvicorn main:app --reload --host 0.0.0.0 --port 8000 &
BACKEND_PID=$!
cd ..

# 4. Start Frontend Dev Server on port 8765
echo "[*] Starting Frontend Server on port 8765..."
cd front
python3 -m http.server 8765 &
FRONTEND_PID=$!
cd ..

# 5. Start Aggregator Service on port 9000 (optional, if node_modules exist)
if [ -d "aggregator_service/node_modules" ]; then
    echo "[*] Starting Aggregator Service on port 9000..."
    cd aggregator_service
    PORT=9000 node src/server.js &
    AGGREGATOR_PID=$!
    cd ..
else
    echo "[!] Aggregator node_modules not found. Run: cd aggregator_service && npm install"
    AGGREGATOR_PID=""
fi

echo "======================================"
echo "  Darak AI Platform is LIVE!"
echo ""
echo "  Frontend:    http://localhost:8765"
echo "  Backend API: http://localhost:8000"
echo "  API Docs:    http://localhost:8000/docs"
echo "  Aggregator:  http://localhost:9000"
echo "======================================"
echo "Press CTRL+C to stop all servers."

trap "echo 'Shutting down...'; kill $BACKEND_PID $FRONTEND_PID $AGGREGATOR_PID 2>/dev/null; exit" INT
wait