-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun_local.sh
More file actions
69 lines (54 loc) · 1.79 KB
/
Copy pathrun_local.sh
File metadata and controls
69 lines (54 loc) · 1.79 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
#!/bin/bash
# WeAD Platform - Local Development Runner
# This script runs the platform on localhost:5000
echo "🚀 Starting WeAD Platform (Local Development)..."
# Colors
GREEN='\033[0;32m'
BLUE='\033[0;34m'
YELLOW='\033[1;33m'
NC='\033[0m' # No Color
# Check if .env exists
if [ ! -f .env ]; then
echo -e "${YELLOW}⚠️ .env file not found. Creating from template...${NC}"
if [ -f env.local.example ]; then
cp env.local.example .env
echo -e "${GREEN}✅ Created .env from env.local.example${NC}"
echo -e "${YELLOW}📝 Please edit .env with your configuration${NC}"
else
echo -e "${YELLOW}⚠️ env.local.example not found. Using default values.${NC}"
fi
fi
# Activate virtual environment if it exists
if [ -d "venv" ]; then
echo -e "${BLUE}📦 Activating virtual environment...${NC}"
source venv/bin/activate
else
echo -e "${YELLOW}⚠️ Virtual environment not found. Creating one...${NC}"
python3 -m venv venv
source venv/bin/activate
echo -e "${BLUE}📦 Installing dependencies...${NC}"
pip install -r requirements.txt
fi
# Check if required services are running
echo -e "${BLUE}🔍 Checking required services...${NC}"
# Check PostgreSQL
if ! pg_isready -q 2>/dev/null; then
echo -e "${YELLOW}⚠️ PostgreSQL is not running. Please start it:${NC}"
echo " sudo service postgresql start"
fi
# Check Redis
if ! redis-cli ping > /dev/null 2>&1; then
echo -e "${YELLOW}⚠️ Redis is not running. Please start it:${NC}"
echo " sudo service redis-server start"
fi
echo ""
echo -e "${GREEN}✅ Starting WeAD Platform...${NC}"
echo ""
echo "📍 Local URLs:"
echo " http://localhost:5000"
echo " http://127.0.0.1:5000"
echo ""
echo "🛑 Press CTRL+C to stop"
echo ""
# Run the application
python bot.py