-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstart_direct.sh
More file actions
executable file
·76 lines (65 loc) · 2.28 KB
/
start_direct.sh
File metadata and controls
executable file
·76 lines (65 loc) · 2.28 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
# Direct start without venv - for testing
GREEN='\033[0;32m'
YELLOW='\033[0;33m'
RED='\033[0;31m'
NC='\033[0m'
echo "=========================================="
echo " Direct Start (No venv) "
echo "=========================================="
echo ""
# Check if Redis is available
echo -n "Checking Redis... "
if pgrep -x "redis-server" > /dev/null; then
echo -e "${GREEN}✓ Running${NC}"
else
echo -e "${YELLOW}Starting Redis locally...${NC}"
# Start Redis with our config in background
redis-server infrastructure/redis/redis.conf &
REDIS_PID=$!
echo "Redis PID: $REDIS_PID"
sleep 2
fi
# Check if Qdrant is available
echo -n "Checking Qdrant... "
if lsof -i:6333 > /dev/null 2>&1; then
echo -e "${GREEN}✓ Running${NC}"
else
if [ -f ~/qdrant ]; then
echo -e "${YELLOW}Starting Qdrant...${NC}"
# Start Qdrant in background
~/qdrant --storage-path ~/qdrant-storage > logs/qdrant.log 2>&1 &
QDRANT_PID=$!
echo "Qdrant PID: $QDRANT_PID"
sleep 3
else
echo -e "${RED}✗ Qdrant not found${NC}"
echo "Download it first:"
echo " cd ~ && wget https://github.com/qdrant/qdrant/releases/download/v1.12.5/qdrant-x86_64-unknown-linux-gnu.tar.gz"
echo " tar -xzf qdrant-x86_64-unknown-linux-gnu.tar.gz && cd -"
fi
fi
echo ""
echo -e "${GREEN}Starting Backend API...${NC}"
echo "----------------------------------------"
# Set environment variables
export PYTHONPATH=/home/temrjan/project/biotact-production/backend:$PYTHONPATH
export DATABASE_URL="postgresql://biotact_admin:biotact_password@localhost:5432/biotact_production"
export REDIS_URL="redis://localhost:6379/0"
export QDRANT_URL="http://localhost:6333"
# Load .env if exists
if [ -f .env ]; then
export $(cat .env | grep -v '^#' | xargs)
fi
# Install minimal requirements if needed
echo -e "${YELLOW}Installing minimal packages...${NC}"
pip3 install --user --quiet fastapi uvicorn[standard] redis qdrant-client
echo ""
echo "API will be available at: http://localhost:8000"
echo "API docs: http://localhost:8000/docs"
echo ""
echo "Press Ctrl+C to stop all services"
echo "----------------------------------------"
# Start FastAPI
cd backend
python3 -m uvicorn app.main:app --host 0.0.0.0 --port 8000 --reload