-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.sh
More file actions
62 lines (53 loc) Β· 1.45 KB
/
setup.sh
File metadata and controls
62 lines (53 loc) Β· 1.45 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
#!/bin/bash
# Arabian Nights Quiz - Setup Script
# This script checks for Node.js and installs dependencies
set -e
echo "π Arabian Nights Quiz Setup π"
echo "================================"
echo ""
# Check if Node.js is installed
if ! command -v node &> /dev/null; then
echo "β Node.js is not installed!"
echo ""
echo "Please install Node.js first:"
echo " 1. Visit https://nodejs.org/ and download Node.js LTS (v18 or v20)"
echo " 2. Or use Homebrew: brew install node"
echo " 3. Or use nvm: https://github.com/nvm-sh/nvm"
echo ""
exit 1
fi
# Check Node version
NODE_VERSION=$(node -v)
echo "β
Node.js detected: $NODE_VERSION"
# Check if npm is available
if ! command -v npm &> /dev/null; then
echo "β npm is not installed!"
exit 1
fi
NPM_VERSION=$(npm -v)
echo "β
npm detected: $NPM_VERSION"
echo ""
# Install dependencies
echo "π¦ Installing dependencies..."
npm install
if [ $? -eq 0 ]; then
echo ""
echo "β
Dependencies installed successfully!"
echo ""
echo "π Ready to start!"
echo ""
echo "Run the development server:"
echo " npm run dev"
echo ""
echo "Then open http://localhost:3000 in your browser"
echo ""
echo "Other commands:"
echo " npm run build - Build for production"
echo " npm start - Run production server"
echo " npm run seed - Seed demo data"
echo ""
else
echo ""
echo "β Installation failed!"
exit 1
fi