-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstart.sh
More file actions
executable file
·76 lines (64 loc) · 2.05 KB
/
Copy pathstart.sh
File metadata and controls
executable file
·76 lines (64 loc) · 2.05 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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#!/bin/bash
# HyperLogic AI ChatBot Startup Script
echo "🚀 Starting HyperLogic AI ChatBot..."
# Check if Python is installed
if ! command -v python3 &> /dev/null; then
echo "❌ Python 3 is not installed. Please install Python 3.8+ and try again."
exit 1
fi
# Check Python version
PYTHON_VERSION=$(python3 -c "import sys; print(f'{sys.version_info.major}.{sys.version_info.minor}')")
REQUIRED_VERSION="3.8"
if [ "$(printf '%s\n' "$REQUIRED_VERSION" "$PYTHON_VERSION" | sort -V | head -n1)" != "$REQUIRED_VERSION" ]; then
echo "❌ Python 3.8+ is required. Current version: $PYTHON_VERSION"
exit 1
fi
# Check if .env file exists
if [ ! -f .env ]; then
echo "⚠️ .env file not found. Creating from template..."
cp env.example .env
echo "📝 Please edit .env file and add your API keys before running again."
echo " Required: GOOGLE_API_KEY"
exit 1
fi
# Create virtual environment if it doesn't exist
if [ ! -d "server/venv" ]; then
echo "🐍 Creating Python virtual environment..."
cd server
python3 -m venv venv
cd ..
fi
# Activate virtual environment and install dependencies
if [ ! -f "server/venv/.deps_installed" ]; then
echo "📦 Installing Python dependencies..."
cd server
source venv/bin/activate
pip install --upgrade pip
pip install -r requirements.txt
touch venv/.deps_installed
cd ..
fi
# Install frontend dependencies if needed
if [ ! -d "web/node_modules" ]; then
echo "📦 Installing frontend dependencies..."
cd web
npm install
cd ..
fi
# Check if API keys are set
if ! grep -q "GOOGLE_API_KEY=" .env; then
echo "⚠️ No API keys found in .env file."
echo " Please add the following:"
echo " - GOOGLE_API_KEY=your_google_key"
exit 1
fi
echo "✅ All checks passed!"
echo "🌐 Starting HyperLogic AI ChatBot..."
echo " Frontend: http://localhost:3000"
echo " Backend: http://localhost:5000"
echo " API Docs: http://localhost:5000/docs"
echo ""
echo "Press Ctrl+C to stop the application"
echo ""
# Start the application
npm run dev