-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
·59 lines (48 loc) · 1.38 KB
/
setup.sh
File metadata and controls
executable file
·59 lines (48 loc) · 1.38 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
#!/bin/bash
echo "🚀 Setting up Hot or Slop - Full Stack Setup"
echo "============================================="
echo
# Function to check if command exists
command_exists() {
command -v "$1" >/dev/null 2>&1
}
# Check prerequisites
echo "🔍 Checking prerequisites..."
if ! command_exists node; then
echo "❌ Node.js is not installed. Please install Node.js 18+ and try again."
exit 1
fi
if ! command_exists npm; then
echo "❌ npm is not installed. Please install npm and try again."
exit 1
fi
echo "✅ Node.js $(node --version) and npm $(npm --version) found"
# Install frontend dependencies
echo
echo "📦 Installing frontend dependencies..."
npm install
if [ $? -ne 0 ]; then
echo "❌ Failed to install frontend dependencies"
exit 1
fi
echo "✅ Frontend dependencies installed"
# Setup backend
echo
echo "🔧 Setting up backend server..."
if [ -f server/setup.sh ]; then
cd server && bash setup.sh
cd ..
else
echo "❌ Backend setup script not found"
exit 1
fi
echo
echo "🎉 Full setup complete!"
echo
echo "📋 Next steps:"
echo "1. Start the backend server: npm run server"
echo "2. Start the frontend dev server: npm run dev"
echo "3. Open http://localhost:5173 to play the game"
echo
echo "📊 Backend API will be available at: http://localhost:3001"
echo "🔗 The frontend will automatically connect to the backend for score persistence"