Files
geminiWX/STARTUP.md
2025-12-08 14:39:07 +08:00

76 lines
1.9 KiB
Markdown
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.
# 项目启动文档
本文档说明如何启动 GeminiWX 项目的服务端、管理后台和小程序。
## 1. 目录结构
* `admin/server`: Django 后端服务
* `admin/client`: Vue.js 管理后台前端
* `wechat-mini-program`: 微信小程序前端代码
## 2. 启动服务端 (Django)
服务端基于 Django 框架。
### 步骤
1. 打开终端。
2. 进入项目根目录。
3. 使用 `admin/server/.venv` 中的 Python 解释器启动服务:
```powershell
.\admin\server\.venv\Scripts\python.exe admin/server/manage.py runserver 0.0.0.0:8000
```
或者,如果你已经激活了虚拟环境:
```powershell
cd admin/server
python manage.py runserver 0.0.0.0:8000
```
4. 服务启动后,访问 `http://localhost:8000/` 确认运行正常。
## 3. 启动管理后台 (Vue.js)
管理后台基于 Vue Element Admin 模板。
### 步骤
1. 打开新的终端窗口。
2. 进入前端目录:
```powershell
cd admin/client
```
3. 安装依赖(如果尚未安装):
```powershell
npm install
```
4. 启动开发服务器:
```powershell
npm run dev
```
5. 启动完成后,浏览器会自动打开 `http://localhost:9528` (或其他配置的端口)。
## 4. 启动微信小程序
### 步骤
1. 下载并安装 [微信开发者工具](https://developers.weixin.qq.com/miniprogram/dev/devtools/download.html)。
2. 打开微信开发者工具,选择“导入项目”。
3. 选择目录 `wechat-mini-program`。
4. 设置 AppID如果没有可以使用测试号
5. 在开发者工具中编译并预览。
## 注意事项
* **端口占用**: 确保 8000 (后端) 和 9528 (前端) 端口未被占用。
* **数据库**: 项目默认使用 `db.sqlite3`,无需额外配置数据库服务。
* **Python 环境**: 请使用项目自带的虚拟环境 `admin/server/.venv` 以确保依赖正确。