Files
dashboard/.qoder/repowiki/knowledge/zh/Luxsin 音频设备管理后台(前后端单体仓库)/架构设计.md
T
2026-07-16 16:34:18 +08:00

7 lines
1.5 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.
仓库采用前后端分离、Docker Compose 编排的单体部署形态:
- `backend/src` 为 Express 应用,入口 `app.js` 通过 `routes/index.js` 聚合各业务路由(auth、brands、models、ota、blacklist、users 等),按 MVC 分层组织:`models/` 使用 Sequelize 定义数据模型并统一由 `models/index.js` 初始化连接;`services/` 封装外部依赖(S3、Redis EQ 缓存、Meilisearch、squiglink 曲线服务、OTA 存储);`middleware/` 注入认证与请求体大小限制;`validators/` 用 zod 校验入参。
- `frontend/` 为 Vue 3 + Element Plus SPAVite 构建产物 `dist/` 由 Nginx 容器静态托管,并通过 `/api` 反向代理到后端 8000 端口;`src/api/` 按领域拆分 API 调用,`views/` 对应功能页面,`components/` 存放通用组件(TabsView、ChangePasswordDialog 等)。
- `frontend_v2/` 是基于 Soybean Admin 模板的重构分支,采用 pnpm workspace 多包结构(@soybeanjs/axios、hooks、scripts 等),尚未替换主前端。
- `autoeq/` 存放第三方测量 CSV/TXT 数据及日期归档,供 OTA 推送时读取频响曲线。
- 根级 `docker-compose.yml` 编排 backendNode 22 Alpine 镜像)与 frontendnginx:alpine)两个服务,共享 `audio-network` 网络,宿主机卷挂载 `/data/projects/source` 用于 X9 OTA 包本地存储。
- 部署脚本 `scripts/upload.sh` 负责将 dist、后端源码、compose 文件上传至服务器 `/data/project/dashboard/`,环境变量集中维护在根 `.env`