-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeploy.sh
More file actions
90 lines (80 loc) · 2.68 KB
/
deploy.sh
File metadata and controls
90 lines (80 loc) · 2.68 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
#!/bin/bash
# SkillExchange Deployment Script
# This script helps you deploy your SkillExchange application
echo "🚀 SkillExchange Deployment Helper"
echo "=================================="
# Check if git is initialized
if [ ! -d ".git" ]; then
echo "❌ Git repository not initialized. Please run 'git init' first."
exit 1
fi
# Check if changes are committed
if [ -n "$(git status --porcelain)" ]; then
echo "⚠️ You have uncommitted changes. Please commit them first:"
echo " git add ."
echo " git commit -m 'Prepare for deployment'"
echo ""
read -p "Do you want to continue anyway? (y/N): " -n 1 -r
echo
if [[ ! $REPLY =~ ^[Yy]$ ]]; then
exit 1
fi
fi
echo "📋 Deployment Checklist:"
echo "1. ✅ Git repository initialized"
echo "2. 📝 Environment variables configured"
echo "3. 🗄️ MongoDB Atlas cluster created"
echo "4. ☁️ Cloudinary account set up"
echo "5. 📧 Email service configured"
echo ""
# Check for environment files
if [ ! -f "Backend/env.example" ]; then
echo "❌ Backend environment template not found"
exit 1
fi
if [ ! -f "Frontend/env.example" ]; then
echo "❌ Frontend environment template not found"
exit 1
fi
echo "📁 Environment templates found:"
echo " - Backend/env.example"
echo " - Frontend/env.example"
echo ""
echo "🔧 Next Steps:"
echo "=============="
echo ""
echo "1. 🗄️ Set up MongoDB Atlas:"
echo " - Create cluster at https://mongodb.com/atlas"
echo " - Get connection string"
echo " - Update Backend/env.example with your MongoDB URI"
echo ""
echo "2. ☁️ Set up Cloudinary:"
echo " - Create account at https://cloudinary.com"
echo " - Get API credentials"
echo " - Update Backend/env.example with Cloudinary details"
echo ""
echo "3. 📧 Configure Email Service:"
echo " - Set up Gmail App Password or SendGrid"
echo " - Update Backend/env.example with email credentials"
echo ""
echo "4. 🚀 Deploy Backend on Render:"
echo " - Go to https://render.com"
echo " - Connect GitHub repository"
echo " - Create Web Service"
echo " - Set Root Directory: Backend"
echo " - Add environment variables from Backend/env.example"
echo ""
echo "5. 🎨 Deploy Frontend on Vercel:"
echo " - Go to https://vercel.com"
echo " - Import GitHub repository"
echo " - Set Root Directory: Frontend"
echo " - Add environment variables from Frontend/env.example"
echo " - Update VITE_API_URL with your Render backend URL"
echo ""
echo "6. 🔄 Update Backend CORS:"
echo " - Update CLIENT_URL in Render with your Vercel frontend URL"
echo " - Redeploy backend"
echo ""
echo "📖 For detailed instructions, see DEPLOYMENT.md"
echo ""
echo "🎉 Happy Deploying!"