-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest-setup.sh
More file actions
executable file
·195 lines (152 loc) · 6.3 KB
/
test-setup.sh
File metadata and controls
executable file
·195 lines (152 loc) · 6.3 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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
#!/bin/bash
echo "🚀 Testing Cast.dread.technology Setup"
echo "======================================"
# Colors for output
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
NC='\033[0m' # No Color
# Function to check if a command exists
command_exists() {
command -v "$1" >/dev/null 2>&1
}
# Function to print status
print_status() {
if [ $1 -eq 0 ]; then
echo -e "${GREEN}✅ $2${NC}"
else
echo -e "${RED}❌ $2${NC}"
fi
}
# Check system dependencies
echo -e "${YELLOW}Checking system dependencies...${NC}"
command_exists node
print_status $? "Node.js installed"
command_exists npm
print_status $? "npm installed"
command_exists python3
print_status $? "Python 3 installed"
command_exists ffmpeg
print_status $? "ffmpeg installed"
# Check Node.js version
if command_exists node; then
NODE_VERSION=$(node --version | cut -d 'v' -f 2 | cut -d '.' -f 1)
if [ "$NODE_VERSION" -ge 18 ]; then
echo -e "${GREEN}✅ Node.js version $NODE_VERSION (>= 18)${NC}"
else
echo -e "${RED}❌ Node.js version $NODE_VERSION (< 18 required)${NC}"
fi
fi
# Check Python packages
echo -e "${YELLOW}Checking Python dependencies...${NC}"
python3 -c "import google.generativeai" 2>/dev/null
print_status $? "google-generativeai package"
python3 -c "import requests" 2>/dev/null
print_status $? "requests package"
python3 -c "import jinja2" 2>/dev/null
print_status $? "jinja2 package"
python3 -c "import openai" 2>/dev/null
print_status $? "openai package"
python3 -c "import librosa" 2>/dev/null
print_status $? "librosa package (for speaker extraction)"
python3 -c "import numpy" 2>/dev/null
print_status $? "numpy package (for audio processing)"
python3 -c "import dotenv" 2>/dev/null
print_status $? "python-dotenv package (for environment variables)"
python3 -c "import anthropic" 2>/dev/null
print_status $? "anthropic package (for bio generation)"
# Check directory structure
echo -e "${YELLOW}Checking directory structure...${NC}"
[ -d "frontend" ]
print_status $? "frontend directory exists (integrated frontend + backend)"
[ -d "scripts" ]
print_status $? "scripts directory exists"
[ -f "scripts/podcast2jsonl.py" ]
print_status $? "podcast2jsonl.py script exists"
[ -f "scripts/extract_speaker_audio.py" ]
print_status $? "extract_speaker_audio.py speaker extraction tool exists"
[ -f "scripts/SPEAKER_EXTRACTION_README.md" ]
print_status $? "speaker extraction documentation exists"
[ -d "generated_podcasts" ]
print_status $? "generated_podcasts directory exists"
mkdir -p generated_podcasts speaker_clips
echo -e "${GREEN}✅ Created required directories (generated_podcasts, speaker_clips)${NC}"
# Check for package.json files
[ -f "frontend/package.json" ]
print_status $? "frontend/package.json exists (integrated dependencies)"
[ -f "requirements.txt" ]
print_status $? "requirements.txt exists"
# Check unified dependencies
echo -e "${YELLOW}Checking integrated frontend + backend dependencies...${NC}"
if [ -d "frontend/node_modules" ]; then
echo -e "${GREEN}✅ Integrated dependencies installed${NC}"
else
echo -e "${YELLOW}⚠️ Dependencies not installed. Run: cd frontend && npm install${NC}"
fi
# Check environment files
echo -e "${YELLOW}Checking environment configuration...${NC}"
if [ -f "frontend/.env" ]; then
echo -e "${GREEN}✅ Frontend .env file exists (optional)${NC}"
# Check for API keys
if grep -q "GEMINI_API_KEY=" frontend/.env; then
echo -e "${GREEN}✅ GEMINI_API_KEY configured${NC}"
else
echo -e "${YELLOW}⚠️ GEMINI_API_KEY not found in frontend/.env${NC}"
fi
if grep -q "OPENAI_API_KEY=" frontend/.env; then
echo -e "${GREEN}✅ OPENAI_API_KEY configured${NC}"
else
echo -e "${YELLOW}⚠️ OPENAI_API_KEY not found in frontend/.env${NC}"
fi
else
echo -e "${YELLOW}⚠️ Frontend .env file missing (optional - API keys are hardcoded for development)${NC}"
fi
# Check for environment variable
echo -e "${YELLOW}Checking speaker extraction tool environment...${NC}"
if [ -n "$GEMINI_API_KEY" ]; then
echo -e "${GREEN}✅ GEMINI_API_KEY environment variable set${NC}"
else
echo -e "${YELLOW}⚠️ GEMINI_API_KEY environment variable not set (required for speaker extraction tool)${NC}"
echo " Set with: export GEMINI_API_KEY=\"your-api-key-here\""
fi
# Test Python scripts basic functionality
echo -e "${YELLOW}Testing Python scripts...${NC}"
python3 scripts/podcast2jsonl.py --help >/dev/null 2>&1
print_status $? "Main podcast processing script can run"
python3 scripts/extract_speaker_audio.py --help >/dev/null 2>&1
print_status $? "Speaker extraction tool can run"
echo ""
echo -e "${YELLOW}Setup Summary:${NC}"
echo "============="
if command_exists node && command_exists npm && command_exists python3 && command_exists ffmpeg; then
echo -e "${GREEN}✅ All system dependencies are installed${NC}"
if [ -d "frontend/node_modules" ]; then
echo -e "${GREEN}✅ All Node.js dependencies are installed${NC}"
# Check Python dependencies
python3 -c "import google.generativeai, librosa, numpy" >/dev/null 2>&1
if [ $? -eq 0 ]; then
echo -e "${GREEN}✅ Essential Python dependencies are available${NC}"
echo ""
echo -e "${GREEN}🎉 Setup appears to be complete!${NC}"
echo ""
echo "To start the application:"
echo "1. Main platform: cd frontend && npm run dev"
echo "2. Open http://localhost:5173"
echo ""
echo "To use speaker extraction tool:"
echo "3. Set API key: export GEMINI_API_KEY=\"your-key-here\""
echo "4. Extract clips: python scripts/extract_speaker_audio.py \"SOURCE_URL\" --output-dir ./clips"
else
echo -e "${YELLOW}⚠️ Please install Python dependencies: pip install -r requirements.txt${NC}"
fi
else
echo -e "${YELLOW}⚠️ Please install Node.js dependencies: cd frontend && npm install${NC}"
fi
else
echo -e "${RED}❌ Some system dependencies are missing${NC}"
echo "Install missing dependencies:"
if ! command_exists node; then echo " - Node.js 18+"; fi
if ! command_exists npm; then echo " - npm"; fi
if ! command_exists python3; then echo " - Python 3.8+"; fi
if ! command_exists ffmpeg; then echo " - ffmpeg"; fi
fi