-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstart-dev.sh
More file actions
executable file
Β·63 lines (52 loc) Β· 1.3 KB
/
start-dev.sh
File metadata and controls
executable file
Β·63 lines (52 loc) Β· 1.3 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
#!/bin/bash
echo "π Starting Whiteboard App Development Environment..."
# Check if backend directory exists
if [ ! -d "backend" ]; then
echo "β Backend directory not found!"
exit 1
fi
# Check if frontend directory exists
if [ ! -d "frontend" ]; then
echo "β Frontend directory not found!"
exit 1
fi
# Install backend dependencies
echo "π¦ Installing backend dependencies..."
cd backend
npm install
if [ $? -ne 0 ]; then
echo "β Failed to install backend dependencies"
exit 1
fi
# Install frontend dependencies
echo "π¦ Installing frontend dependencies..."
cd ../frontend
npm install
if [ $? -ne 0 ]; then
echo "β Failed to install frontend dependencies"
exit 1
fi
# Start backend in background
echo "π§ Starting backend server..."
cd ../backend
npm start &
BACKEND_PID=$!
# Wait a moment for backend to start
sleep 3
# Start frontend
echo "π¨ Starting frontend development server..."
cd ../frontend
npm start &
FRONTEND_PID=$!
echo "β
Development environment started!"
echo "π Frontend: http://localhost:3000"
echo "π§ Backend: http://localhost:5010"
echo ""
echo "Press Ctrl+C to stop both servers"
# Wait for user to stop
wait
# Cleanup
echo "π Stopping servers..."
kill $BACKEND_PID 2>/dev/null
kill $FRONTEND_PID 2>/dev/null
echo "β
Servers stopped"