Files
hfb_jysh/README.md
T

83 lines
2.8 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.
# 解忧商行(JIEYOU TRADING HOUSE)
以 `hfb_sys` 的后端能力为基座、前端整体重建的账号租赁与交易平台。
## 当前状态
**Phase 0–2 已完成,当前进入工程质量收口阶段。** 后端已复制并跑通空库迁移、构建、健康检查与全量测试;前端已完成 PC / 移动端 / 后台三端页面迁移,并接入 ESLint、Prettier、Vitest 与统一 `scripts/check.sh` 门禁。支付、短信、实名仍使用 mock,等待真实渠道凭据。
- 前端:`http://localhost:5289/`
- 移动端:`http://localhost:5289/m`
- 后台:`http://localhost:5289/console-jy8k3m/login`
- 后端:`http://localhost:18089/`
- 健康检查:`http://localhost:18089/health/ready`
## 本地启动
```bash
# 1. 启动 MySQL / Redis / MinIO
docker compose -f deploy/docker-compose.dev.yml up -d
# 2. 启动后端(自动按 dotenv 规则加载 backend/.env)
./scripts/run-backend.sh
# 3. 启动前端
cd frontend && npm install && npm run dev
```
开发账号:
- 用户:`13800138000 / Jieyou123`
- 管理员:`admin / JieyouAdmin@2026`
以上仅用于本地开发库。
## 已定配置
- 主域名:`zuhaoc.com`
- 管理后台:环境变量 `VITE_ADMIN_BASE_PATH`,默认 `/console-jy8k3m`
- 分销后台:`distribution.zuhaoc.com`(沿用现有 React + AntD 应用,仅做品牌轻改)
- 数据库:全新数据库 `hfb_jysh`,保留全部 90 个迁移
- 支付 / 短信 / 实名:先留空,开发环境使用 mock
- Logo:无矢量源文件,按现有 PNG 重绘 SVG
## 技术方向
- 后端:Go + Gin + GORM + MySQL + Redis(业务逻辑复用)
- 主前端:React 19 + TypeScript + Vite + Ant Design 5
- 移动端:Ant Design Mobile 5
- 分销后台:React 19 + Ant Design 5
- 部署:Caddy + Docker Compose
## 质量门禁
```bash
# 全量门禁:SQL 约束 + go vet/build/test + 前端格式/lint/类型/测试/构建
./scripts/check.sh
# 前端单独检查
cd frontend
npm run format:check # Prettier
npm run lint # ESLint,--max-warnings=0
npm run typecheck # tsc --noEmit
npm run test # Vitest
npm run test:coverage # Vitest + coverage
npm run build # Vite 生产构建
```
提交前请启用仓库 hooks:`git config core.hooksPath .githooks`。首次推送会由 `pre-push` 自动执行 `scripts/check.sh`(可用 `SKIP_CHECKS=1` 临时跳过,不推荐)。
## 文档
- [项目实施计划](docs/项目计划.md)
- [品牌与 UI 规范](docs/品牌与UI规范.md)
- [Phase 0 验收报告](docs/Phase0-验收报告.md)
- [Phase 1 验收报告](docs/Phase1-验收报告.md)
- [工程质量门禁与优化验收](docs/Phase3-工程质量门禁验收.md)
- [后端数据库设计](docs/backend/database.md)
- [后端业务规则](docs/backend/business-rules.md)
## 视觉关键词
东方商行 · 墨绿 · 朱砂印章 · 米白纸感 · 可信、温润、克制