-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstart.sh
More file actions
executable file
Β·60 lines (49 loc) Β· 1.31 KB
/
start.sh
File metadata and controls
executable file
Β·60 lines (49 loc) Β· 1.31 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
#!/bin/bash
# CalBot Full Stack Startup Script
echo "π Starting CalBot..."
# Check if backend virtual environment exists
if [ ! -d "backend/venv" ]; then
echo "β Backend virtual environment not found"
echo "Please run: cd backend && python -m venv venv && source venv/bin/activate && pip install -r requirements.txt"
exit 1
fi
# Check if frontend node_modules exists
if [ ! -d "frontend/node_modules" ]; then
echo "β Frontend node_modules not found"
echo "Please run: cd frontend && npm install"
exit 1
fi
# Start backend in background
echo "π§ Starting Backend..."
cd backend
source venv/bin/activate
uvicorn app.main:app --reload --host 0.0.0.0 --port 8000 &
BACKEND_PID=$!
cd ..
# Wait a moment for backend to initialize
sleep 2
# Start frontend in background
echo "βοΈ Starting Frontend..."
cd frontend
npm run dev &
FRONTEND_PID=$!
cd ..
echo ""
echo "β
CalBot is running!"
echo "π Backend: http://localhost:8000"
echo "π Frontend: http://localhost:3000"
echo ""
echo "Press Ctrl+C to stop both servers"
# Function to cleanup on exit
cleanup() {
echo ""
echo "π Stopping CalBot..."
kill $BACKEND_PID 2>/dev/null
kill $FRONTEND_PID 2>/dev/null
echo "β
Stopped"
exit 0
}
# Trap Ctrl+C and call cleanup
trap cleanup INT TERM
# Wait for both processes
wait