-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstart_dev.sh
More file actions
executable file
·77 lines (64 loc) · 2.04 KB
/
Copy pathstart_dev.sh
File metadata and controls
executable file
·77 lines (64 loc) · 2.04 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
#!/bin/bash
# Proposal Master Development Startup Script
# This script starts both the backend API and frontend development servers
echo "🚀 Starting Proposal Master Development Environment"
echo "================================================="
# Function to cleanup background processes on exit
cleanup() {
echo ""
echo "🛑 Shutting down development servers..."
if [ ! -z "$BACKEND_PID" ]; then
kill $BACKEND_PID 2>/dev/null
echo " ✅ Backend server stopped"
fi
if [ ! -z "$FRONTEND_PID" ]; then
kill $FRONTEND_PID 2>/dev/null
echo " ✅ Frontend server stopped"
fi
exit 0
}
# Set up signal handlers
trap cleanup SIGINT SIGTERM
# Check if Python is available
if ! command -v python3 &> /dev/null; then
echo "❌ Python 3 is required but not installed"
exit 1
fi
# Check if Node.js is available
if ! command -v node &> /dev/null; then
echo "❌ Node.js is required but not installed"
exit 1
fi
# Start the backend API server
echo "🔧 Starting backend API server..."
cd "$(dirname "$0")"
uvicorn simple_dev_api:app --host 0.0.0.0 --port 8000 &
BACKEND_PID=$!
echo " ✅ Backend server started (PID: $BACKEND_PID)"
echo " 🌐 API available at: http://localhost:8000"
# Wait a moment for the backend to start
sleep 2
# Start the frontend development server
echo "🔧 Starting frontend development server..."
cd Frontend
# Install dependencies if node_modules doesn't exist
if [ ! -d "node_modules" ]; then
echo " 📦 Installing frontend dependencies..."
npm install
fi
# Start the frontend server
npm run dev &
FRONTEND_PID=$!
echo " ✅ Frontend server started (PID: $FRONTEND_PID)"
echo " 🌐 Frontend available at: http://localhost:5173"
echo ""
echo "🎉 Development environment ready!"
echo "================================================="
echo "Frontend: http://localhost:5173"
echo "Backend: http://localhost:8000"
echo "Health: http://localhost:8000/health"
echo ""
echo "Press Ctrl+C to stop both servers"
echo ""
# Wait for background processes
wait