-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstart-dev.sh
More file actions
executable file
·90 lines (73 loc) · 2.23 KB
/
start-dev.sh
File metadata and controls
executable file
·90 lines (73 loc) · 2.23 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
# SyllabusSync Development Startup Script
# This script starts the application using free services
echo "🚀 Starting SyllabusSync Development Environment"
echo "================================================"
# Check if Java is installed
if ! command -v java &> /dev/null; then
echo "❌ Java is not installed. Please install Java 17+ first."
exit 1
fi
# Check if Node.js is installed
if ! command -v node &> /dev/null; then
echo "❌ Node.js is not installed. Please install Node.js 18+ first."
exit 1
fi
echo "✅ Java and Node.js are installed"
# Create environment file if it doesn't exist
if [ ! -f .env ]; then
echo "📝 Creating environment file from template..."
cp env.example .env
echo "⚠️ Please edit .env file with your Google OAuth credentials"
fi
# Start backend
echo "🔧 Starting Spring Boot backend..."
cd backend
# Use Maven if available, otherwise use Gradle wrapper
if command -v mvn &> /dev/null; then
echo "Using Maven..."
mvn spring-boot:run &
elif [ -f "mvnw" ]; then
echo "Using Maven wrapper..."
./mvnw spring-boot:run &
else
echo "❌ No Maven installation found. Please install Maven or use the Maven wrapper."
exit 1
fi
BACKEND_PID=$!
echo "Backend started with PID: $BACKEND_PID"
# Wait for backend to start
echo "⏳ Waiting for backend to start..."
sleep 10
# Start frontend
echo "⚛️ Starting React frontend..."
cd ../frontend
if [ ! -d "node_modules" ]; then
echo "📦 Installing frontend dependencies..."
npm install
fi
npm start &
FRONTEND_PID=$!
echo "Frontend started with PID: $FRONTEND_PID"
echo ""
echo "🎉 SyllabusSync is starting up!"
echo "================================"
echo "📊 Backend: http://localhost:8080"
echo "🌐 Frontend: http://localhost:3000"
echo "🗄️ H2 Console: http://localhost:8080/h2-console"
echo "📚 API Docs: http://localhost:8080/swagger-ui.html"
echo ""
echo "Press Ctrl+C to stop all services"
# Function to cleanup on exit
cleanup() {
echo ""
echo "🛑 Stopping services..."
kill $BACKEND_PID 2>/dev/null
kill $FRONTEND_PID 2>/dev/null
echo "✅ Services stopped"
exit 0
}
# Set trap to cleanup on script exit
trap cleanup SIGINT SIGTERM
# Wait for user to stop
wait