-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
·86 lines (68 loc) · 2.17 KB
/
Copy pathsetup.sh
File metadata and controls
executable file
·86 lines (68 loc) · 2.17 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
#!/bin/bash
echo "🚀 Setting up Project B..."
# Check if we're in the right directory
if [ ! -f "setup.sh" ]; then
echo "❌ Please run this script from the project root directory"
exit 1
fi
echo "📦 Setting up backend..."
cd backend
# Create backend .env file if it doesn't exist
if [ ! -f ".env" ]; then
echo "📝 Creating backend .env file..."
cat > .env << EOF
USER_LOGIN_USERNAME=your_username
USER_LOGIN_PASSWORD=your_password
WEB_PASSWORD=your_web_password
SECRET_KEY=your_secret_key_here
EOF
echo "✅ Backend .env created with placeholder values"
fi
# Remove existing venv if it exists
if [ -d "venv" ]; then
echo "🧹 Removing existing virtual environment..."
rm -rf venv
fi
# Create new virtual environment
echo "🐍 Creating Python virtual environment..."
python3 -m venv venv
# Activate virtual environment and install dependencies
echo "📥 Installing Python dependencies..."
source venv/bin/activate
# Upgrade pip first
pip install --upgrade pip
# Install dependencies with pre-built wheels when possible
pip install --only-binary=:all: fastapi uvicorn sqlalchemy pydantic python-multipart aiofiles bcrypt PyJWT
pip install --only-binary=:all: paramiko asyncssh
# Try to install remaining dependencies
echo "🔧 Installing remaining dependencies..."
pip install -r requirements.txt
# Install playwright browsers
echo "🎭 Installing playwright browsers..."
playwright install
cd ..
echo "📦 Setting up frontend..."
cd frontend
# Create frontend .env file if it doesn't exist
if [ ! -f ".env" ]; then
echo "📝 Creating frontend .env file..."
cat > .env << EOF
NEXT_PUBLIC_API_BASE_URL=http://localhost:8000
JWT_SECRET_KEY=your_jwt_secret_key_here
EOF
echo "✅ Frontend .env created with placeholder values"
fi
# Remove existing node_modules if they exist
if [ -d "node_modules" ]; then
echo "🧹 Removing existing node_modules..."
rm -rf node_modules package-lock.json
fi
# Install frontend dependencies
echo "📥 Installing Node.js dependencies..."
npm install
cd ..
echo "✅ Setup complete!"
echo ""
echo "🎯 To start the application:"
echo "Backend: cd backend && ./run.sh"
echo "Frontend: cd frontend && npm run dev"