-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.sh
More file actions
52 lines (43 loc) · 1.58 KB
/
Copy pathsetup.sh
File metadata and controls
52 lines (43 loc) · 1.58 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
#!/bin/bash
echo "🚀 Setting up EduChain Platform"
echo "================================"
# Check if Node.js is installed
if ! command -v node &> /dev/null; then
echo "❌ Node.js is not installed. Please install Node.js first."
exit 1
fi
# Check if MySQL is installed
if ! command -v mysql &> /dev/null; then
echo "⚠️ MySQL is not installed. Please install MySQL and create a database."
echo " You can install MySQL from: https://dev.mysql.com/downloads/mysql/"
echo " After installation, create a database: CREATE DATABASE educhain_db;"
fi
echo "📦 Installing backend dependencies..."
cd backend
npm install
echo "📦 Installing frontend dependencies..."
cd ../educhain-frontend
npm install
cd ..
echo "📝 Setting up environment files..."
if [ ! -f "backend/.env" ]; then
cp backend/.env.example backend/.env
echo "✅ Created backend/.env - Please edit with your configuration"
fi
if [ ! -f "educhain-frontend/.env" ]; then
cp educhain-frontend/.env.example educhain-frontend/.env
echo "✅ Created educhain-frontend/.env - Please edit with your configuration"
fi
echo ""
echo "🎯 Setup Complete!"
echo "=================="
echo ""
echo "Next steps:"
echo "1. Edit backend/.env with your MySQL credentials"
echo "2. Edit educhain-frontend/.env with your API URL"
echo "3. Create MySQL database: CREATE DATABASE educhain_db;"
echo "4. Run database migrations: cd backend && npm run migrate"
echo "5. Start the backend: cd backend && npm run dev"
echo "6. Start the frontend: cd educhain-frontend && npm run dev"
echo ""
echo "Happy coding! 🎓🚀"