-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstart_server.sh
More file actions
executable file
Β·55 lines (46 loc) Β· 1.67 KB
/
start_server.sh
File metadata and controls
executable file
Β·55 lines (46 loc) Β· 1.67 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
#!/bin/bash
# QueryGPT Server Startup Script
echo "π― Starting QueryGPT Server..."
echo ""
# Check if .env file exists
if [ ! -f .env ]; then
echo "β οΈ Warning: .env file not found!"
echo "π Creating .env from template..."
cp env_template.txt .env
echo ""
echo "β‘ IMPORTANT: Please edit .env and add your GEMINI_API_KEY before continuing!"
echo " Get your API key from: https://makersuite.google.com/app/apikey"
echo ""
read -p "Press Enter once you've added your API key to .env..."
fi
# Check if GEMINI_API_KEY is set
source .env
if [ -z "$GEMINI_API_KEY" ] || [ "$GEMINI_API_KEY" = "your_gemini_api_key_here" ]; then
echo ""
echo "β Error: GEMINI_API_KEY is not configured in .env"
echo " Please edit .env and add your actual Gemini API key"
echo " Get one from: https://makersuite.google.com/app/apikey"
exit 1
fi
# Check if Python is installed
if ! command -v python3 &> /dev/null; then
echo "β Error: Python 3 is not installed"
echo " Please install Python 3.8 or higher"
exit 1
fi
# Check if requirements are installed
if ! python3 -c "import flask" 2> /dev/null; then
echo "π¦ Installing dependencies..."
pip3 install -r requirements.txt
echo ""
fi
echo "β
All checks passed!"
echo ""
echo "π Starting Flask server on http://localhost:5000"
echo "π± Open index.html in your browser to use QueryGPT"
echo ""
echo "Press Ctrl+C to stop the server"
echo "βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ"
echo ""
# Start the server
python3 backend/app.py