-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup_serp_analysis.sh
More file actions
executable file
·105 lines (92 loc) · 2.79 KB
/
Copy pathsetup_serp_analysis.sh
File metadata and controls
executable file
·105 lines (92 loc) · 2.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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
#!/bin/bash
echo "=================================================="
echo "ContentSwift - SERP Analysis Setup"
echo "=================================================="
echo ""
# Colors for output
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
NC='\033[0m' # No Color
echo -e "${YELLOW}Step 1: Installing Python dependencies...${NC}"
cd backend-crt/src
pip install -r requirements.txt
if [ $? -eq 0 ]; then
echo -e "${GREEN}✓ Dependencies installed successfully${NC}"
else
echo "❌ Error installing dependencies"
exit 1
fi
echo ""
echo -e "${YELLOW}Step 2: Downloading Spacy language models...${NC}"
# Download English model (default)
python -m spacy download en_core_web_sm
if [ $? -eq 0 ]; then
echo -e "${GREEN}✓ English model downloaded${NC}"
else
echo "❌ Error downloading Spacy model"
exit 1
fi
# Optional: Download additional language models
read -p "Do you want to download additional language models? (y/n) " -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]
then
echo ""
echo "Available languages:"
echo " 1. German (de)"
echo " 2. Spanish (es)"
echo " 3. French (fr)"
echo " 4. Italian (it)"
echo " 5. Portuguese (pt)"
echo ""
read -p "Enter language codes (space-separated, e.g., 'de es'): " langs
for lang in $langs; do
case $lang in
de)
python -m spacy download de_core_news_sm
;;
es)
python -m spacy download es_core_news_sm
;;
fr)
python -m spacy download fr_core_news_sm
;;
it)
python -m spacy download it_core_news_sm
;;
pt)
python -m spacy download pt_core_news_sm
;;
*)
echo "Unknown language: $lang"
;;
esac
done
fi
echo ""
echo -e "${YELLOW}Step 3: Checking environment configuration...${NC}"
if [ ! -f ".env" ]; then
echo "Creating .env file from template..."
cp .env.example .env
echo -e "${YELLOW}⚠ Please edit .env file and add your API keys${NC}"
else
echo -e "${GREEN}✓ .env file exists${NC}"
fi
echo ""
echo -e "${YELLOW}Step 4: Setting up database...${NC}"
echo "Please ensure Docker is running and execute:"
echo " cd backend-crt/src"
echo " source env/bin/activate"
echo " python db/models.py"
echo ""
echo "=================================================="
echo -e "${GREEN}Setup Complete!${NC}"
echo "=================================================="
echo ""
echo "Next steps:"
echo " 1. Edit backend-crt/src/.env with your API keys"
echo " 2. Run: cd backend-crt && docker-compose up -d --build"
echo " 3. Test: python backend-crt/src/example_usage.py"
echo ""
echo "For detailed documentation, see: SERP_ANALYSIS_GUIDE.md"
echo ""