From a6cc23f88c47681caa675b2068e97f078122828e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=A6=82=E5=A8=81?= Date: Tue, 30 Sep 2025 16:34:21 +0800 Subject: [PATCH] feat: start.sh --- frontend/index.html | 3 ++- frontend/public/creepy.svg | 1 + start.sh | 20 ++++++++++++++++++++ 3 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 frontend/public/creepy.svg create mode 100644 start.sh diff --git a/frontend/index.html b/frontend/index.html index ddb4168..9e2d5bd 100644 --- a/frontend/index.html +++ b/frontend/index.html @@ -2,7 +2,8 @@ - + + 工作流 diff --git a/frontend/public/creepy.svg b/frontend/public/creepy.svg new file mode 100644 index 0000000..5967a84 --- /dev/null +++ b/frontend/public/creepy.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/start.sh b/start.sh new file mode 100644 index 0000000..214e644 --- /dev/null +++ b/start.sh @@ -0,0 +1,20 @@ +#!/bin/bash + +# 切换 Node.js 版本 +nvm use v22.18.0 + +# 激活 Python 虚拟环境 +source backend/venv/bin/activate + +# 启动前端 (后台运行,日志写入 frontend.log) +cd frontend +nohup npm run dev > ../frontend.log 2>&1 & + +# 启动后端 (后台运行,日志写入 backend.log) +cd ../backend +nohup python3 app/main.py > ../backend.log 2>&1 & + +# 提示 +echo "前端和后端已经在后台启动!" +echo "前端日志: frontend.log" +echo "后端日志: backend.log"