-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeploy.sh
More file actions
executable file
·94 lines (78 loc) · 2.5 KB
/
deploy.sh
File metadata and controls
executable file
·94 lines (78 loc) · 2.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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
#!/bin/bash
echo "🚀 Starting deployment process..."
# Check if necessary tools are installed
if ! command -v node &> /dev/null; then
echo "❌ Node.js is not installed. Please install Node.js first."
exit 1
fi
if ! command -v npm &> /dev/null; then
echo "❌ npm is not installed. Please install npm first."
exit 1
fi
echo "📦 Installing dependencies..."
# Install root dependencies
npm install
# Install client dependencies
cd client
npm install
cd ..
# Install server dependencies
cd server
npm install
cd ..
echo "🔨 Building frontend..."
# Build frontend
cd client
npm run build
cd ..
echo "✅ Build completed successfully!"
echo "📋 Deployment options:"
echo "1. Deploy to Vercel (Frontend) + Render (Backend)"
echo "2. Deploy to Netlify (Frontend) + Railway (Backend)"
echo "3. Deploy to local server"
echo "4. Deploy to custom VPS"
read -p "Choose deployment option (1-4): " choice
case $choice in
1)
echo "🚀 Deploying to Vercel + Render..."
echo "Please follow these steps:"
echo "1. Push your code to GitHub"
echo "2. Connect your repository to Vercel for frontend deployment"
echo "3. Connect your repository to Render for backend deployment"
echo "4. Set environment variables in both platforms"
;;
2)
echo "🚀 Deploying to Netlify + Railway..."
echo "Please follow these steps:"
echo "1. Push your code to GitHub"
echo "2. Connect your repository to Netlify for frontend deployment"
echo "3. Connect your repository to Railway for backend deployment"
echo "4. Set environment variables in both platforms"
;;
3)
echo "🚀 Starting local server..."
echo "Frontend will be available at: http://localhost:3000"
echo "Backend will be available at: http://localhost:5000"
# Start backend
cd server
npm run dev &
cd ..
# Start frontend
cd client
npm run dev
;;
4)
echo "🚀 Deploying to custom VPS..."
echo "Please follow these steps:"
echo "1. Upload your code to your VPS"
echo "2. Install Node.js and npm on your VPS"
echo "3. Run: npm install && npm run build"
echo "4. Set up a reverse proxy (nginx) to serve the frontend"
echo "5. Set up PM2 or similar to run the backend"
;;
*)
echo "❌ Invalid option selected"
exit 1
;;
esac
echo "🎉 Deployment process completed!"