-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
·62 lines (54 loc) · 1.5 KB
/
setup.sh
File metadata and controls
executable file
·62 lines (54 loc) · 1.5 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
echo "🚀 Setting up DSA Tracker Website..."
echo ""
# Check if Node.js is installed
if ! command -v node &> /dev/null; then
echo "❌ Node.js is not installed. Please install Node.js v16 or higher."
exit 1
fi
# Check if Docker is installed
if ! command -v docker &> /dev/null; then
echo "❌ Docker is not installed. Please install Docker."
exit 1
fi
echo "✅ Prerequisites check passed!"
echo ""
# Install dependencies
echo "📦 Installing dependencies..."
npm install
# Create .env file if it doesn't exist
if [ ! -f .env ]; then
echo "⚙️ Creating environment file..."
cat > .env << EOF
JWT_SECRET=your-super-secret-jwt-key-change-this-in-production-$(openssl rand -hex 32)
PORT=5000
DB_PATH=./server/users.db
EOF
echo "✅ Environment file created!"
else
echo "⚠️ .env file already exists, skipping..."
fi
# Create server directory if it doesn't exist
mkdir -p server
echo ""
echo "🎉 Setup complete!"
echo ""
echo "📋 Next steps:"
echo "1. Start the LeetCode API:"
echo " cd leetcodeapi && docker-compose up -d"
echo ""
echo "2. Start the authentication server:"
echo " npm run server"
echo ""
echo "3. Start the website (in another terminal):"
echo " npm run dev"
echo ""
echo "4. Open your browser and go to:"
echo " http://localhost:3001"
echo ""
echo "🔗 API Endpoints:"
echo " - Website: http://localhost:3001"
echo " - Auth Server: http://localhost:5000"
echo " - LeetCode API: http://localhost:3000"
echo ""
echo "Happy coding! 🚀"