-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstart_brain.sh
More file actions
56 lines (47 loc) · 1.49 KB
/
start_brain.sh
File metadata and controls
56 lines (47 loc) · 1.49 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
#!/bin/bash
# Kill existing processes
echo "Stopping existing Brain processes..."
# 1. Kill Python Backend Processes
PIDS=$(ps aux | grep -E "python.*(ingest_daemon.py|app.py)" | grep -v grep | awk '{print $2}')
if [ -n "$PIDS" ]; then
echo "Killing Python PIDs: $PIDS"
kill -9 $PIDS
else
echo "No running Python processes found."
fi
# 2. Kill Port 5002 (Flask)
PORT_PID=$(lsof -t -i :5002)
if [ -n "$PORT_PID" ]; then
echo "Killing process on port 5002 (PID: $PORT_PID)"
kill -9 $PORT_PID
fi
# 3. Kill Port 5173 (Vite Frontend)
VITE_PID=$(lsof -t -i :5173)
if [ -n "$VITE_PID" ]; then
echo "Killing process on port 5173 (PID: $VITE_PID)"
kill -9 $VITE_PID
fi
# Wait for cleanup
sleep 2
# Start Daemon
echo "Starting Ingest Daemon..."
/Users/sheetalssr/Documents/projects/2025/personal\ projects/BrAIn/Brain2.0/venv/bin/python ingest_daemon.py > daemon.log 2>&1 &
DAEMON_PID=$!
echo "Daemon started (PID: $DAEMON_PID)"
# Start Web App (Backend)
echo "Starting Web App (Backend)..."
/Users/sheetalssr/Documents/projects/2025/personal\ projects/BrAIn/Brain2.0/venv/bin/python app.py > app.log 2>&1 &
APP_PID=$!
echo "Web App started (PID: $APP_PID)"
# Start Frontend (React)
echo "Starting Frontend (React)..."
cd frontend
npm run dev > ../frontend.log 2>&1 &
FRONTEND_PID=$!
cd ..
echo "Frontend started (PID: $FRONTEND_PID)"
echo ""
echo "✅ Brain is running!"
echo "Frontend: http://localhost:5173"
echo "Backend: http://localhost:5002"
echo "Logs: tail -f daemon.log app.log frontend.log"