forked from HKUDS/DeepCode
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstart_dev.sh
More file actions
executable file
·74 lines (60 loc) · 1.8 KB
/
start_dev.sh
File metadata and controls
executable file
·74 lines (60 loc) · 1.8 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
#!/bin/bash
# DeepCode New UI - Development Startup Script
set -e
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
PROJECT_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
echo "🚀 Starting DeepCode New UI Development Environment..."
echo ""
# Colors
GREEN='\033[0;32m'
BLUE='\033[0;34m'
NC='\033[0m' # No Color
# Check if we're in the right directory
if [ ! -f "$PROJECT_ROOT/backend/main.py" ]; then
echo "❌ Error: Please run this script from the new_ui directory"
exit 1
fi
# Function to cleanup on exit
cleanup() {
echo ""
echo "🛑 Shutting down..."
pkill -P $$ 2>/dev/null || true
}
trap cleanup EXIT
# Start Backend
echo -e "${BLUE}📦 Starting FastAPI Backend...${NC}"
cd "$PROJECT_ROOT/backend"
# Check if pydantic-settings is installed
if ! python -c "import pydantic_settings" 2>/dev/null; then
echo "Installing pydantic-settings..."
pip install pydantic-settings
fi
# Start uvicorn in background
python -m uvicorn main:app --reload --host 0.0.0.0 --port 8000 &
BACKEND_PID=$!
echo -e "${GREEN}✓ Backend started on http://localhost:8000${NC}"
echo ""
# Start Frontend
echo -e "${BLUE}📦 Starting React Frontend...${NC}"
cd "$PROJECT_ROOT/frontend"
# Check if node_modules exists
if [ ! -d "node_modules" ]; then
echo "Installing npm dependencies..."
npm install
fi
# Start vite in background
npm run dev &
FRONTEND_PID=$!
echo -e "${GREEN}✓ Frontend started on http://localhost:5173${NC}"
echo ""
echo "=========================================="
echo -e "${GREEN}🎉 DeepCode New UI is running!${NC}"
echo ""
echo " Frontend: http://localhost:5173"
echo " Backend: http://localhost:8000"
echo " API Docs: http://localhost:8000/docs"
echo ""
echo "Press Ctrl+C to stop all services"
echo "=========================================="
# Wait for both processes
wait