-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
·76 lines (63 loc) · 1.98 KB
/
setup.sh
File metadata and controls
executable file
·76 lines (63 loc) · 1.98 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
#!/bin/bash
set -e
# Save the project root directory
PROJECT_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
cd "$PROJECT_ROOT"
echo "🚀 Setting up PASS_ATS project..."
# Load nvm if available
export NVM_DIR="$HOME/.nvm"
if [ -s "$NVM_DIR/nvm.sh" ]; then
source "$NVM_DIR/nvm.sh"
echo "✅ nvm loaded"
# Use Node.js 18 if available, otherwise try to install
if nvm list 18 &>/dev/null; then
echo "📦 Using existing Node.js 18..."
nvm use 18
elif command -v node &> /dev/null; then
echo "✅ Node.js already installed: $(node --version)"
else
echo "⚠️ Node.js not found. Please install Node.js 18+ first."
echo " Run: nvm install 18 && nvm use 18"
echo " Or download from https://nodejs.org/"
exit 1
fi
fi
# Check if Node.js is available
if ! command -v node &> /dev/null; then
echo "❌ Node.js is not installed or not in PATH"
echo " Please install Node.js 18+ and try again"
exit 1
fi
echo "✅ Node.js version: $(node --version)"
echo "✅ npm version: $(npm --version)"
# Install root dependencies
echo "📦 Installing root dependencies..."
npm install
# Install frontend dependencies
echo "📦 Installing frontend dependencies..."
cd frontend
npm install
cd ..
# Install backend dependencies
echo "📦 Installing backend dependencies..."
cd server
npm install
cd ..
# Install Python dependencies
echo "📦 Installing Python dependencies..."
cd "$PROJECT_ROOT/server/python-service"
if [ -f "requirements.txt" ]; then
pip3 install -r requirements.txt
fi
# Generate Prisma client
echo "📦 Generating Prisma client..."
cd "$PROJECT_ROOT/server"
npx prisma generate
cd "$PROJECT_ROOT"
echo "✅ Setup complete!"
echo ""
echo "Next steps:"
echo "1. Copy .env.example to .env and configure your environment variables"
echo "2. Run database migrations: cd server && npx prisma migrate dev"
echo "3. Start the server: npm run dev"
echo "4. Start the frontend: cd frontend && npm run dev"