Compare commits

..

No commits in common. 'main' and 'src' have entirely different histories.
main ... src

Binary file not shown.

Before

Width:  |  Height:  |  Size: 272 KiB

@ -1,66 +0,0 @@
在项目根目录创建 .env 文件,用于存放 API 配置信息
前端部署步骤
bash
# 进入前端目录
cd frontend
# 安装依赖
pnpm install
# 构建前端项目(清空输出目录)
pnpm build --emptyOutDir
# 返回项目根目录
cd ..
后端部署步骤
bash
# 清理旧的构建文件
rm -r dist
# 复制前端构建文件到后端目录
cp -r frontend/dist/ dist
# 检查 Python 版本
python --version
# 创建 Python 虚拟环境
python3 -m venv ./venv
# 激活虚拟环境Windows PowerShell
venv\Scripts\activate
# 设置执行策略(仅在首次需要时)
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope Process
# 如果上述激活失败,尝试以下命令
python -m venv venv
.\venv\Scripts\Activate.ps1
# 安装 Python 依赖
pip install -r requirements.txt
# 启动应用
python main.py
# 打开网页
http://127.0.0.1:8000/
注意事项
请确保已安装 Node.js、pnpm 和 Python 3
在运行 PowerShell 脚本前,可能需要调整执行策略
.env 文件应包含必要的 API 密钥和配置信息
根据实际环境,可能需要使用 python 或 python3 命令
项目结构
text
项目根目录/
├── frontend/ # 前端源码
├── dist/ # 构建输出目录
├── venv/ # Python 虚拟环境
├── .env # 环境变量文件
├── requirements.txt # Python 依赖
└── main.py # 主程序入口
按照以上步骤操作即可完成项目的部署和启动。

Binary file not shown.
Loading…
Cancel
Save