-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.sh
More file actions
71 lines (57 loc) · 1.73 KB
/
setup.sh
File metadata and controls
71 lines (57 loc) · 1.73 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
#!/bin/bash
# Versus Complete Setup Script
echo "Setting up Versus (Frontend + Backend)..."
# Check if we're in the right directory
if [ ! -f "versus-frontend/package.json" ] || [ ! -f "backend/requirements.txt" ]; then
echo "Error: Please run this script from the Versus project root directory"
exit 1
fi
echo "=== Setting up Frontend (Node.js) ==="
cd versus-frontend
# Use the correct Node.js version (from .nvmrc)
if command -v nvm &> /dev/null; then
echo "Using Node.js version from .nvmrc..."
nvm use
else
echo "nvm not found. Please ensure Node.js >=18 is installed."
fi
# Check Node.js version
echo "Node.js version: $(node --version)"
echo "npm version: $(npm --version)"
# Install frontend dependencies
echo "Installing frontend dependencies..."
npm install
cd ..
echo ""
echo "=== Setting up Backend (Python) ==="
cd backend
# Check if we're in a virtual environment
if [ -z "$VIRTUAL_ENV" ]; then
echo "Warning: No virtual environment detected. Please activate your venv first:"
echo " source your_venv/bin/activate"
exit 1
fi
echo "Using virtual environment: $VIRTUAL_ENV"
# Upgrade pip
echo "Upgrading pip..."
pip install --upgrade pip
# Install Python dependencies
echo "Installing Python dependencies..."
pip install -r requirements.txt
cd ..
echo ""
echo "=== Setup Complete! ==="
echo ""
echo "To start the development servers:"
echo ""
echo "1. Start the backend (make sure your venv is activated):"
echo " cd backend"
echo " python main.py"
echo ""
echo "2. Start the frontend (in a new terminal):"
echo " cd versus-frontend"
echo " nvm use"
echo " npm run dev"
echo ""
echo "The frontend will be available at: http://localhost:5173"
echo "The backend will be available at: http://localhost:8000"