Files
meeting-room/start-dev.sh

54 lines
1.4 KiB
Bash
Executable File
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/bin/bash
# 龙虾议事厅 - 开发环境快速启动脚本
echo "🏛️ 启动龙虾议事厅开发环境..."
# 检查并停止旧服务
echo "🧹 清理旧服务..."
pkill -f "meeting-room.*runserver" 2>/dev/null
pkill -f "frontend.*npm start" 2>/dev/null
sleep 2
# 启动后端
echo "📦 启动后端..."
cd backend
nohup python3 manage.py runserver 0.0.0.0:8000 > /tmp/meeting-backend.log 2>&1 &
BACKEND_PID=$!
sleep 2
if ps -p $BACKEND_PID > /dev/null; then
echo "✅ 后端已启动 (PID: $BACKEND_PID)"
else
echo "❌ 后端启动失败,请检查日志:/tmp/meeting-backend.log"
exit 1
fi
# 启动前端
echo "📦 启动前端..."
cd ../frontend
nohup npm start > /tmp/meeting-frontend.log 2>&1 &
FRONTEND_PID=$!
sleep 3
if ps -p $FRONTEND_PID > /dev/null; then
echo "✅ 前端已启动 (PID: $FRONTEND_PID)"
else
echo "❌ 前端启动失败,请检查日志:/tmp/meeting-frontend.log"
exit 1
fi
echo ""
echo "=========================================="
echo "✅ 开发环境启动完成!"
echo "=========================================="
echo ""
echo "📌 访问地址:"
echo " 前端http://localhost:3000/"
echo " 后端 API: http://localhost:8000/api/v1/"
echo ""
echo "📌 日志文件:"
echo " 后端:/tmp/meeting-backend.log"
echo " 前端:/tmp/meeting-frontend.log"
echo ""
echo "📌 停止服务:"
echo " kill $BACKEND_PID $FRONTEND_PID"
echo ""