-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstart.sh
More file actions
executable file
·58 lines (51 loc) · 1.42 KB
/
start.sh
File metadata and controls
executable file
·58 lines (51 loc) · 1.42 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
#!/bin/bash
echo "🔍 Checking CortexOS Prerequisites..."
echo ""
# Check PostgreSQL
if pg_isready > /dev/null 2>&1; then
echo "✅ PostgreSQL is running"
else
echo "❌ PostgreSQL is NOT running"
echo " Start with: brew services start postgresql (macOS)"
echo " Or: sudo systemctl start postgresql (Linux)"
exit 1
fi
# Check Redis
if redis-cli ping > /dev/null 2>&1; then
echo "✅ Redis is running"
else
echo "❌ Redis is NOT running"
echo " Start with: brew services start redis (macOS)"
echo " Or: sudo systemctl start redis (Linux)"
exit 1
fi
# Check .env file
if [ ! -f .env ]; then
echo "❌ .env file not found"
exit 1
fi
# Check for LLM API key
if grep -q "GROQ_API_KEY=gsk_" .env || \
grep -q "ANTHROPIC_API_KEY=sk-ant-" .env || \
grep -q "GEMINI_API_KEY=AI" .env || \
grep -q "MISTRAL_API_KEY=" .env; then
echo "✅ LLM API key found"
else
echo "❌ No valid LLM API key found in .env"
echo " Add one of: GROQ_API_KEY, ANTHROPIC_API_KEY, GEMINI_API_KEY, or MISTRAL_API_KEY"
exit 1
fi
# Check database exists
if psql -lqt | cut -d \| -f 1 | grep -qw cortexos; then
echo "✅ Database 'cortexos' exists"
else
echo "⚠️ Database 'cortexos' not found"
echo " Creating database..."
createdb cortexos
echo "✅ Database created"
fi
echo ""
echo "✅ All prerequisites met!"
echo ""
echo "Starting backend server..."
npm run dev