-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstart.sh
More file actions
executable file
Β·52 lines (44 loc) Β· 1.27 KB
/
start.sh
File metadata and controls
executable file
Β·52 lines (44 loc) Β· 1.27 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
#!/bin/bash
# AI Chat System Startup Script
echo "π Starting AI Chat System..."
# Check if .env exists (optional now)
if [ ! -f "backend/.env" ]; then
echo "π Creating backend/.env from template..."
cp backend/env.example backend/.env
echo "βΉοΈ Note: You can configure models through the web interface!"
echo " Environment variables are now optional."
echo ""
fi
# Start backend
echo ""
echo "π§ Starting Backend Server..."
cd backend
source venv/bin/activate 2>/dev/null || python3.12 -m venv venv && source venv/bin/activate
pip install -q -r requirements.txt
python main.py &
BACKEND_PID=$!
cd ..
# Wait for backend to start
echo "β³ Waiting for backend to initialize..."
sleep 3
# Start frontend
echo ""
echo "π¨ Starting Frontend Server..."
cd frontend
if [ ! -d "node_modules" ]; then
echo "π¦ Installing frontend dependencies..."
npm install
fi
npm start &
FRONTEND_PID=$!
cd ..
echo ""
echo "β
AI Chat System is starting!"
echo "π Backend: http://localhost:8000"
echo "π Frontend: http://localhost:3000"
echo "π API Docs: http://localhost:8000/docs"
echo ""
echo "Press Ctrl+C to stop both servers"
# Wait for Ctrl+C
trap "echo ''; echo 'π Stopping servers...'; kill $BACKEND_PID $FRONTEND_PID 2>/dev/null; exit" INT
wait