Files
dashboard/.qoder/repowiki/knowledge/zh/Audio Dashboard 全栈项目根(前后端 + 部署编排)/编码规范.md
T
2026-07-17 17:17:22 +08:00

5 lines
713 B
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.
- 后端按领域分层:每个实体对应独立的 `models/<Entity>.js``routes/<entity>.js``validators/<entity>.js`,并在 `models/index.js` 中统一注册关联。
- 环境变量通过 `backend/src/config/loadEnv.js` 集中加载,所有模块从该配置对象读取而非直接访问 `process.env`
- 对外响应统一经 `backend/src/utils/response.js` 包装,保持 `{ code, message, data }` 一致结构。
- 前端 API 调用集中在 `frontend/src/service/api/*.ts`,通过统一的 `frontend/src/service/request/` 封装的 alova 实例发起请求。
- Docker 部署时容器内端口固定为 8000,宿主机映射到 8083Nginx 将 `/api` 反向代理到 `http://backend:8000`