-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.sh
More file actions
64 lines (54 loc) · 1.48 KB
/
Copy pathsetup.sh
File metadata and controls
64 lines (54 loc) · 1.48 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
# setup.sh - Complete setup script for WildGuard AI
set -e
echo "🦁 WildGuard AI - Setup Script"
echo "================================"
# Check Python version
echo "✓ Checking Python..."
PYTHON_VERSION=$(python3 --version 2>&1 | awk '{print $2}')
echo " Python version: $PYTHON_VERSION"
# Create virtual environment
echo "✓ Creating virtual environment..."
python3 -m venv venv
source venv/bin/activate
# Install dependencies
echo "✓ Installing Python dependencies..."
pip install --upgrade pip
pip install -r requirements.txt
# Copy environment file
echo "✓ Setting up environment..."
if [ ! -f .env ]; then
cp .env.example .env
echo " Created .env file (edit it for custom config)"
fi
# Initialize database
echo "✓ Initializing database..."
python3 -c "
from business_logic import init_db
db = init_db()
print(' Database initialized successfully')
"
# Setup frontend
echo "✓ Setting up frontend..."
cd frontend
npm install
cd ..
# Verify model files
echo "✓ Verifying model files..."
for file in animal_classifier.h5 class_indices.json risk_dictionary.json; do
if [ -f "$file" ]; then
echo " ✓ $file"
else
echo " ✗ $file NOT FOUND"
fi
done
# Print next steps
echo ""
echo "🎉 Setup complete!"
echo ""
echo "Next steps:"
echo "1. Start backend: python api.py"
echo "2. Start frontend: cd frontend && npm run dev"
echo "3. Open browser: http://localhost:5173"
echo ""
echo "For more info, see README.md or DEPLOYMENT.md"