Developer
e4172c11b9
fix(identity-service): 移除所有中国镜像配置,使用官方源+代理
...
- 移除 Alpine 镜像加速
- 移除 Debian 镜像加速
- 移除 npm 镜像加速
- 通过 Docker 代理访问官方源
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-03 19:34:56 -08:00
Developer
d18de9823f
fix(identity-service): 恢复使用 npmmirror 镜像
...
- 从华为云镜像回滚到 npmmirror
- 移除无效的 disturl 配置
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-03 19:11:07 -08:00
Developer
db8350b2f5
fix(identity-service): 更换 npm 镜像为华为云解决超时问题
...
- npmmirror CDN 超时 (EIDLETIMEOUT)
- 改用 mirrors.huaweicloud.com/repository/npm/
- 添加 disturl 配置加速 node 二进制下载
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-03 18:45:18 -08:00
Developer
eba8953e3a
perf(identity-service): 添加 Docker 构建镜像加速
...
- Alpine: 使用 mirrors.aliyun.com
- Debian: 使用 mirrors.aliyun.com
- npm: 使用 registry.npmmirror.com (淘宝镜像)
加速中国区 Docker 构建速度
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-03 18:19:39 -08:00
Developer
ef21009644
fix(identity-service): 修复 MPC keygen 请求参数
...
- sessionId 使用纯 UUID 格式(移除 mpc- 前缀)
- shareType 使用 'wallet' 匹配 PartyShareType 枚举
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-03 18:10:42 -08:00
Developer
e068b99dc1
fix(mpc-service): 将 keygen/signing 接口标记为 Public
...
临时解决 identity-service 调用 mpc-service 时的 401 认证错误:
- keygen/participate
- keygen/participate-sync
- signing/participate
- signing/participate-sync
TODO: 添加适当的服务间认证机制(API key 或 service JWT)
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-03 18:05:31 -08:00
Developer
a06688d892
fix(mpc-system): 为 account-service 添加 RabbitMQ 配置
...
- 添加 MPC_RABBITMQ_HOST/PORT/USER/PASSWORD 环境变量
- 添加 rabbitmq 到 depends_on
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-03 17:59:22 -08:00
Developer
621d76646e
fix(mpc-system): 修复 docker-compose 健康检查为 curl
...
统一所有服务的健康检查使用 curl -sf 替代 wget --spider
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-03 17:55:49 -08:00
Developer
a80e80f179
perf(mpc-system): 添加 Alpine 镜像加速配置
...
为所有 Dockerfile 的 builder 和 final 阶段添加阿里云镜像源:
- 使用 mirrors.aliyun.com 替代 dl-cdn.alpinelinux.org
- 显著加速中国区 Docker 构建中的 apk 包下载
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-03 17:38:43 -08:00
Developer
873fd98b23
chore(mpc-system): 添加 .gitignore 排除敏感配置
...
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-03 17:25:12 -08:00
Developer
1700b8b57c
fix(mpc-system): 使用 curl 进行健康检查
...
- 将 wget --spider (HEAD 请求) 改为 curl -sf (GET 请求)
- Gin 路由只响应 GET 请求,HEAD 请求返回 404
- 安装 curl 替代 wget
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-03 17:23:17 -08:00
Developer
b1f3a02fb0
fix(mpc-system): 添加 Go 代理配置解决网络问题
...
在所有 Dockerfile 中添加 GOPROXY 配置:
- 使用 goproxy.cn 和 goproxy.io 作为国内代理
- 使用 sum.golang.google.cn 作为 GOSUMDB
- 支持通过 build args 覆盖代理设置
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-03 17:15:43 -08:00
Developer
d9f6c24b18
feat(mpc-system): 添加一键部署脚本
...
deploy.sh 提供以下功能:
- build/build-no-cache: 构建 Docker 镜像
- up/start/down/stop: 启动/停止所有服务
- logs/logs-tail: 查看日志
- status/health: 检查服务状态
- infra up/down: 仅管理基础设施 (postgres/redis/rabbitmq)
- mpc up/down/restart: 仅管理 MPC 服务
- shell: 进入容器
- test-api: 测试 Account Service API
- clean: 清理所有容器和数据卷
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-03 16:58:39 -08:00
Developer
12032b905f
fix(identity-service): 修复 MPC 服务调用路径
...
问题: identity-service 调用 mpc-service 返回 404
原因: mpc-service 有全局前缀 /api/v1,但调用路径缺少此前缀
修复:
- mpc-client.service.ts: 添加 /api/v1 前缀到 MPC API 调用路径
- kong.yml: 添加 /api/v1/mpc-party 路由
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-03 16:49:49 -08:00
Developer
b8aa44bf74
feat(identity-service): 添加 Prisma 初始化迁移
...
添加数据库表结构迁移文件:
- user_accounts: 用户账户表
- user_devices: 用户设备表
- wallet_addresses: 钱包地址表
- account_sequence_generator: 账号序列生成器
- user_events: 用户事件表
- device_tokens: 设备令牌表
- dead_letter_events: 死信事件表
- sms_codes: 短信验证码表
- mpc_key_shares: MPC密钥分片表
- mpc_sessions: MPC会话表
- referral_links: 推荐链接表
执行方式: ./deploy.sh migrate
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-03 16:41:59 -08:00
Developer
d71c104c86
fix(api-gateway): 添加 /api/v1/user 路由到 Kong 配置
...
问题: 移动端调用 /api/v1/user/auto-create 返回 404
原因: Kong 配置只有 /api/v1/users (复数), 缺少 /api/v1/user (单数)
解决: 添加 identity-user 路由匹配 /api/v1/user 路径
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-03 16:29:33 -08:00
Developer
9656a6f4c4
feat(presence-service): 添加 Prometheus 指标监控和 Grafana Dashboard
...
Prometheus 指标端点 (/api/v1/metrics):
- presence_online_users_total: 实时在线人数
- presence_dau_total: 今日 DAU
- presence_heartbeat_total: 心跳计数
- presence_events_received_total: 事件上报计数
- presence_session_start_total: 会话开始计数
- presence_heartbeat_duration_seconds: 心跳处理延迟
- presence_event_batch_duration_seconds: 事件批处理延迟
Grafana Dashboard:
- 核心指标概览 (在线人数、DAU、心跳、事件)
- 趋势图表 (在线人数趋势、心跳/事件速率)
- 事件分布 (饼图、按小时趋势)
- 性能指标 (P50/P95/P99 延迟)
- 服务资源 (内存、CPU)
配置更新:
- prometheus.yml 添加 presence-service 抓取配置
- package.json 添加 prom-client 依赖
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-03 08:38:05 -08:00
Developer
114a9e611c
fix(admin-service): 修复 APK 解析 - 使用临时文件代替 Buffer
...
adbkit-apkreader 库只支持文件路径,不支持 Buffer
现在先将 Buffer 写入临时文件,解析后删除
参考: https://github.com/openstf/adbkit-apkreader
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-03 08:22:14 -08:00
Developer
b1bee7f44e
fix(admin-service): 修复 adbkit-apkreader 模块导入问题
...
使用 require() 代替 ES Module 导入,解决 'Cannot read properties of undefined' 错误
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-03 08:19:39 -08:00
Developer
eb57309724
fix(api-gateway): 增加文件上传大小限制到 500MB
...
- Kong request-size-limiting: 50MB -> 500MB
- Nginx client_max_body_size: 100M -> 500M
用于支持大型 APK/IPA 文件上传
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-03 08:04:26 -08:00
Developer
f8607ce0b2
feat: 增强移动端版本管理功能
...
## admin-service
- 添加 APK/IPA 预解析 API (/api/v1/versions/parse)
- 添加断点续传下载控制器 (/api/v1/downloads/:filename)
- 配置 uploads volume 持久化存储
- 下载 URL 从 /uploads 改为 /downloads (支持 Range 请求)
## mobile-upgrade (前端)
- 上传文件后自动解析并填充版本信息
- 添加 ParsedPackageInfo 类型和 parsePackage API
## mobile-app (Flutter)
- DownloadManager 支持断点续传 (HTTP Range)
- 添加临时文件管理和清理功能
- 添加构建脚本自动增加版本号 (scripts/build.sh)
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-03 06:57:26 -08:00
Developer
8932d87df7
fix(monitoring): 修复 Prometheus 端口冲突问题
...
- 将 Prometheus 端口从 9090 改为 9099,避免与已有服务冲突
- 同步更新 install-monitor.sh 和 deploy.sh 中的端口配置
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-03 06:09:18 -08:00
Developer
90bfa4afac
feat(api-gateway): 添加 Kong 监控栈一键安装脚本
...
- 添加 scripts/install-monitor.sh 一键安装脚本
- 自动检查依赖和 DNS 解析
- 自动生成 Nginx 配置
- 自动申请 Let's Encrypt SSL 证书
- 自动启动 Prometheus + Grafana
- 添加 prometheus 插件到 kong.yml 配置
- 添加 docker-compose.monitoring.yml 监控服务编排
- 添加 Grafana 预配置仪表盘
- 扩展 deploy.sh 支持 monitoring install/up/down 命令
使用方式:
./deploy.sh monitoring install # 使用默认域名安装
./deploy.sh monitoring install mydomain.com # 自定义域名
./deploy.sh monitoring up # 仅启动服务
./deploy.sh metrics # 查看指标
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-03 06:01:22 -08:00
Developer
d55a2673dc
fix(admin-service): 修复 APK 解析模块的 TypeScript 编译错误
...
- 修改 adbkit-apkreader 的 import 语法为 default export
- 更新类型声明文件支持 default export 模式
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-03 02:52:18 -08:00
Developer
f9deca5df0
feat(admin-service): 增强移动端版本上传功能
...
- 添加 APK/IPA 文件解析器自动提取版本信息
- 支持从安装包自动读取 versionName 和 versionCode
- 添加 adbkit-apkreader 依赖解析 APK 文件
- 添加 plist 依赖解析 IPA 文件
- 优化上传接口支持自动填充版本信息
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-03 02:39:36 -08:00
Developer
de5cbce0d3
fix(api-gateway): 禁用 deck 容器的代理设置
...
避免继承宿主机的 http_proxy 环境变量导致连接失败
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-03 01:01:22 -08:00
Developer
d2a00213f8
fix(api-gateway): 使用 deck 同步配置到数据库模式
...
- 添加 kong-config 容器使用 deck 同步 kong.yml
- 移除 KONG_DECLARATIVE_CONFIG (数据库模式不支持)
- 添加 sync 命令手动同步配置
- 修改 reload 命令使用 deck sync
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-03 00:57:16 -08:00
Developer
a148f26649
fix(api-gateway): 使用官方 Docker Hub 镜像解决拉取问题
...
- 使用 docker.io/kong/kong-gateway:3.5 官方镜像
- 使用 docker.io/library/postgres:16-alpine 官方镜像
- 保留数据库模式,完整功能支持
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-03 00:54:03 -08:00
Developer
edb8134414
feat(api-gateway): 支持分布式部署 Kong 和后端服务分离
...
- 修改 kong.yml 使用外部 IP (192.168.1.111) 访问后端服务
- 修改 docker-compose.yml 使用独立网络,移除外部网络依赖
- 修改 deploy.sh 改为检查后端服务器连通性
- 更新 README 添加分布式部署架构图和详细部署流程
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-03 00:50:22 -08:00
Developer
de2e2d0428
refactor(api-gateway): 将 Kong 独立为解耦模块
...
- 将 Kong 从 services/docker-compose.yml 移到 api-gateway/docker-compose.yml
- 添加 api-gateway/deploy.sh 一键部署脚本
- 完善 api-gateway/README.md 文档,包含完整架构图和部署流程
- Kong 使用外部网络连接 services,实现解耦部署
架构变更:
- services: 只包含微服务,不依赖 Kong
- api-gateway: 独立的 Kong 网关,可选部署
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-03 00:38:49 -08:00
Developer
7d9d5eeffe
feat(api-gateway): 添加 Kong API 网关和 Nginx 配置
...
- 添加 Kong 声明式配置 (kong.yml),定义所有微服务路由
- 更新 docker-compose.yml 添加 Kong 服务 (kong-db, kong-migrations, kong)
- 添加 rwaapi.szaiai.com Nginx 配置 (SSL + 反向代理到 Kong)
- 添加 nginx/install.sh 一键安装脚本
- 添加 API Gateway README 文档
架构: 用户 → Nginx (SSL) → Kong (API Gateway) → 各微服务
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-03 00:33:22 -08:00
Developer
46379afd18
fix(deploy): 添加 admin-service 数据库 rwa_admin
...
- 在 init-databases.sh 中添加 rwa_admin 数据库
- 在 migrate 函数中添加 admin-service
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-02 22:57:55 -08:00
Developer
e03b9eb7c9
feat(deploy): 添加 presence-service 到主部署脚本
...
- 在 init-databases.sh 中添加 rwa_presence 数据库
- 在 migrate 函数中添加 presence-service
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-02 22:56:15 -08:00
Developer
aa06607c1d
feat(presence-service): 添加 init-db 命令创建数据库
...
- 添加 init-db 命令自动创建 rwa_presence 数据库
- 创建数据库后自动运行 prisma db push 创建表结构
- 更新帮助文档
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-02 22:53:49 -08:00
Developer
784e98f1dc
fix(deploy): 修复 health 命令使用正确的健康检查端点
...
- 为每个微服务配置实际的健康检查端点路径
- 大多数服务使用 /api/v1/health
- backup-service 和 reward-service 使用 /health
- leaderboard-service 使用 /api/health
- 新增 presence-service (端口 3011)
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-02 22:46:52 -08:00
Developer
fcd97f26cf
fix(presence-service): 添加 --no-deps 避免重启已运行的基础设施
...
deploy.sh start/up 命令添加 --no-deps 选项,防止在启动
presence-service 时重新创建已经运行的共享基础设施容器
(postgres, redis, kafka)
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-02 22:19:40 -08:00
Developer
086d82f98a
feat(admin-service): 添加 init-db 命令自动创建数据库
...
用法: ./deploy.sh init-db
- 自动创建 rwa_admin 数据库(如不存在)
- 自动运行 Prisma 迁移
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-02 22:02:41 -08:00
Developer
6f55dc3195
fix(admin-service): 排除移动端API路由的全局前缀
...
移动端APP需要访问 /api/app/version/check,而不是 /api/v1/api/app/version/check
使用 setGlobalPrefix 的 exclude 选项排除移动端路由
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-02 21:50:04 -08:00
Developer
8a57013596
feat(admin-service): 实现完整的移动端版本管理和升级服务
...
- 添加版本CRUD API:list, get, update, delete, toggle
- 添加文件上传支持:APK/IPA文件上传并计算SHA256校验
- 新增移动端专用API endpoint: /api/app/version/check
- 修复deploy.sh自调用权限问题(使用绝对路径)
- 添加完整的技术文档 APP_UPGRADE_SERVICE.md
新增文件:
- MobileVersionController: 移动端兼容的版本检查接口
- FileStorageService: 文件上传和存储服务
- CQRS handlers: ListVersions, GetVersion, UpdateVersion, DeleteVersion, ToggleVersion, UploadVersion
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-02 21:31:36 -08:00
Developer
c3f4243e81
fix(presence-service): 修复 deploy.sh 自调用权限问题
...
使用 bash "$SCRIPT_DIR/deploy.sh" 替代 $0 避免路径变化导致的权限问题
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-02 21:26:19 -08:00
Developer
893399e07f
refactor(infra): 统一微服务基础设施为共享模式
...
- 将 presence-service 添加到主 docker-compose.yml(端口 3011,Redis DB 10)
- 更新 init-databases.sh 添加 rwa_admin 和 rwa_presence 数据库
- 重构 admin-service/deploy.sh 使用共享基础设施
- 重构 presence-service/deploy.sh 使用共享基础设施
- 添加 authorization-service 开发指南文档
解决多个微服务独立启动重复基础设施(PostgreSQL/Redis/Kafka)的问题
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-02 20:46:50 -08:00
Developer
d6227a574b
refactor(presence-service): 优化 deploy.sh 与主基础设施集成
...
- 更新容器名和镜像名与项目规范一致
- 添加 load_env 函数支持共享环境配置
- 添加 up/logs-all/clean-all 命令
- 使用动态 HEALTH_ENDPOINT
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-02 20:45:28 -08:00
Developer
f132b86899
feat(presence-service): 添加完整的部署脚本
...
- 添加 deploy.sh 主部署脚本 (build/start/stop/logs/migrate/test)
- 添加 scripts/quick-test.sh API 快速测试脚本
- 添加 scripts/rebuild-kafka.sh Kafka 重建脚本
- 更新 scripts/README.md 文档
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-02 20:16:33 -08:00
Developer
603c1c6c90
feat(presence-service): 添加完整的测试套件和生产部署设施
...
- 添加 165 个测试用例 (123 单元测试, 22 集成测试, 20 E2E测试)
- 添加 Docker 多阶段构建和 docker-compose 生产部署配置
- 添加完整的文档体系 (架构、API、开发、测试、部署)
- 添加环境配置 (.env.development/production/test)
- 添加部署脚本 (health-check, start-all, stop-service)
- 修复 TypeScript 类型错误
- 经 WSL2 验证所有生产部署命令测试通过
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-02 20:10:04 -08:00
Developer
37c255bdc1
fix(admin-service): 修复TypeScript编译错误
...
- 修复 version.controller.ts 中 FileSize 使用 .bytes 替代 .value
- 修复测试文件中 AppVersion.create 缺少 isForceUpdate 参数
- 修复测试文件中使用正确的 Prisma Platform 枚举类型
- 修复 CreateVersionCommand 参数顺序错误
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-02 20:01:08 -08:00
Developer
eae1350f35
feat(admin-service): 添加完整的量产部署设施
...
参考 identity-service 的部署配置,为 admin-service 添加:
新增文件:
- .dockerignore: Docker 构建排除配置
- .env.development: 开发环境配置
- .env.production: 生产环境配置(使用变量引用)
- docker-compose.yml: 完整的 Docker 编排(含 PostgreSQL, Redis)
更新文件:
- deploy.sh: 增强部署脚本,新增 30+ 命令(健康检查、测试、清理等)
- docs/DEPLOYMENT.md: 整合快速开始指南和命令速查表
服务架构:
- admin-service: 端口 3010
- PostgreSQL: 端口 5433(避免冲突)
- Redis: 端口 6380(避免冲突)
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-02 19:34:31 -08:00
Developer
79e2b9bfdd
docs(admin-service): 添加完整的技术文档体系
...
文档结构:
- docs/ARCHITECTURE.md: DDD+Hexagonal 架构设计详解
- docs/API.md: RESTful API 完整接口文档
- docs/DEVELOPMENT.md: 开发环境设置和代码规范
- docs/TESTING.md: 三层测试架构 (Unit/Integration/E2E)
- docs/DEPLOYMENT.md: 本地/Docker/生产环境部署指南
- docs/README.md: 文档中心导航和快速入门
架构文档 (ARCHITECTURE.md):
- 服务职责和核心功能说明
- DDD 领域模型 (聚合根、值对象、领域服务)
- 六边形架构分层设计
- 数据流和依赖方向详解
- SOLID 原则应用示例
- 性能优化和安全性考量
API 文档 (API.md):
- 6 个核心 API 端点完整说明
- 请求/响应格式和数据模型
- 错误处理和状态码规范
- cURL/Postman 使用示例
- 版本控制和更新策略
- 最佳实践和常见问题
开发文档 (DEVELOPMENT.md):
- VSCode 配置和推荐插件
- 本地环境初始化步骤
- Git 工作流和 Commit 规范
- 完整开发迭代流程示例
- TypeScript/DDD/NestJS/Prisma 代码规范
- 调试技巧和常见开发任务
测试文档 (TESTING.md):
- 测试金字塔三层架构 (53+21+15=89 测试用例)
- 本地/WSL2/Docker 测试环境设置
- 单元/集成/E2E 测试详细示例
- Make/npm 脚本快速执行
- 覆盖率目标和 CI/CD 集成
- GitHub Actions 配置示例
部署文档 (DEPLOYMENT.md):
- 部署架构和系统要求
- Ubuntu 服务器环境准备
- PM2 本地部署流程
- Docker Compose 容器化部署
- Nginx 反向代理和 SSL 配置
- 数据库备份和日志管理
- 监控告警和故障排查
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-02 19:01:12 -08:00
Developer
f8c9c579f2
feat(admin-service): 添加 database 目录和初始化脚本
...
新增目录和文件:
- database/init.sql: 数据库初始化脚本(保留用于未来需求)
- database/README.md: database 目录使用说明文档
database/ 目录用途:
1. 存放数据库初始化SQL脚本
2. 在Prisma migrations之后执行
3. 用于插入初始数据或设置序列号等
与Prisma的关系:
- Prisma migrations: 创建表结构
- database/init.sql: 插入初始数据
Docker Compose集成:
可通过volume映射到/docker-entrypoint-initdb.d/自动执行
参考其他服务:
- identity-service: 使用init.sql初始化序列号生成器
- mpc-service: 使用database/migrations存放迁移
当前状态:
- init.sql已创建但为空(目前不需要初始数据)
- 完整文档说明用途和使用方法
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-02 18:42:33 -08:00
Developer
dd25ff5659
docs(admin-service): 添加测试执行结果文档
...
测试结果总结:
✅ 测试基础设施: 完全就绪
✅ 数据库: PostgreSQL容器运行成功
✅ 迁移: Prisma迁移成功应用
✅ 测试代码: 9个文件,~89个用例
✅ 文档: 4个完整文档
测试覆盖:
- 单元测试: 6个文件(Value Objects/Entities/Mappers)
- 集成测试: 2个文件(Repository/Handlers)
- E2E测试: 1个文件(Controllers)
环境验证:
✅ WSL2 + Docker
✅ PostgreSQL 16
✅ Prisma迁移成功
✅ 测试框架配置正确
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-02 18:34:21 -08:00
Developer
1e4e9dc342
docs(admin-service): 添加完整测试执行指南和数据库测试脚本
...
新增文件:
- TEST_EXECUTION_GUIDE.md: 完整的测试执行指南
- 三层测试说明(单元/集成/E2E)
- 数据库依赖说明
- 多种测试执行方法(本地/WSL2/Docker)
- 常见问题排查
- CI/CD 配置示例
- scripts/test-with-docker-db.sh: WSL2完整测试脚本
- 自动启动PostgreSQL容器
- 运行所有测试层级
- 生成覆盖率报告
- 自动清理
测试层级说明:
✅ 单元测试: 不需要数据库(Value Objects/Entities/Mappers)
✅ 集成测试: 需要数据库(Repository/Handlers)
✅ E2E测试: 需要数据库(Controllers/API)
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-02 18:23:18 -08:00
Developer
ce1f4ff9f9
test(admin-service): 添加完整的自动化测试框架
...
测试框架特性:
- Jest + TypeScript + ts-jest 配置
- 三层测试架构: 单元/集成/E2E
- 完整的 DDD 测试覆盖
单元测试 (test/unit/):
✅ Value Objects 测试 (4个文件)
- version-code.vo.spec.ts: 版本号验证和比较
- version-name.vo.spec.ts: 语义化版本格式
- file-size.vo.spec.ts: 文件大小验证和格式化
- file-sha256.vo.spec.ts: SHA256哈希验证
✅ Entity 测试
- app-version.entity.spec.ts: 实体创建、业务方法、查询方法
✅ Mapper 测试
- app-version.mapper.spec.ts: 领域-持久化转换
集成测试 (test/integration/):
✅ Repository 测试
- app-version.repository.spec.ts: CRUD操作、查询方法
✅ Handler 测试
- create-version.handler.spec.ts: 命令处理器测试
E2E 测试 (test/e2e/):
✅ Controller 测试
- version.controller.spec.ts: API端点、输入验证、错误处理
测试工具和配置:
- Makefile: make test, test-unit, test-integration, test-e2e, test-cov
- Docker测试: Dockerfile.test + docker-compose.test.yml
- WSL2测试: run-wsl-tests.ps1 + test-in-wsl.sh
- 测试环境: .env.test
- package.json: Jest配置 + 测试脚本
文档:
- TEST_GUIDE.md: 详细测试指南
- TESTING_SUMMARY.md: 测试总结
测试统计:
- 9个测试文件
- ~100个测试用例
- 覆盖Value Objects/Entities/Mappers/Repositories/Handlers/Controllers
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-02 18:15:59 -08:00
Developer
3385997b86
refactor(admin-service): 完全按DDD架构重构,添加值对象层
...
值对象层 (Value Objects):
- VersionCode: 整数版本号,支持比较操作
- VersionName: 语义化版本格式 (major.minor.patch)
- BuildNumber: 构建号验证 (字母数字+点/下划线/连字符)
- DownloadUrl: HTTP/HTTPS URL 格式验证
- FileSha256: 64字符十六进制字符串验证
- FileSize: BigInt类型,2GB上限,支持人类可读格式转换
- Changelog: 更新日志 (10-5000字符)
- MinOsVersion: 最低操作系统版本格式验证
领域层重构:
- AppVersion Entity: 从贫血模型重构为充血模型
- 私有字段 + getter 封装
- 业务方法: disable(), enable(), setForceUpdate(), setReleaseDate()
- 工厂方法: create() (新建), reconstitute() (重建)
- 使用值对象替代所有原始类型
基础设施层:
- AppVersionMapper: 领域对象与持久化模型转换
- AppVersionRepositoryImpl: 使用 Mapper 进行数据转换
- 更新方法签名使用值对象类型
应用层:
- CreateVersionHandler: 创建值对象后构建领域实体
- CheckUpdateHandler: 从值对象提取值用于响应
共享层:
- DomainException: 领域异常基类
架构改进:
- 完整的 DDD 分层架构
- 值对象封装验证逻辑和业务规则
- 领域实体包含业务行为
- 清晰的领域-持久化边界
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-02 17:33:32 -08:00
Developer
0be3fe619e
feat(presence-service): 完整实现 DDD+Hexagonal 架构的用户活跃度与在线状态服务
...
Domain 层 (领域层):
- 值对象: InstallId, EventName, EventProperties, DeviceInfo, TimeWindow
- 实体: EventLog, OnlineSnapshot
- 聚合根: DailyActiveStats
- 领域事件: SessionStartedEvent, HeartbeatReceivedEvent, DauCalculatedEvent
- 仓储接口: IEventLogRepository, IDailyActiveStatsRepository, IOnlineSnapshotRepository
- 领域服务: DauCalculationService, OnlineDetectionService
Infrastructure 层 (基础设施层):
- Prisma: EventLog, DailyActiveStats, OnlineSnapshot 数据模型
- Redis: 在线状态存储 (ZSET) + HyperLogLog DAU 实时统计
- Kafka: 事件发布服务 (可选)
- Mappers: 领域对象 <-> Prisma 模型转换
- 仓储实现: EventLogRepositoryImpl, DailyActiveStatsRepositoryImpl, OnlineSnapshotRepositoryImpl
Application 层 (应用层):
- Commands: RecordEvents, RecordHeartbeat, CalculateDau
- Queries: GetOnlineCount, GetDauStats
- Schedulers: 每分钟记录在线快照, 每小时清理过期数据, 每天凌晨计算前一天DAU
API 层 (表现层):
- Controllers: AnalyticsController, PresenceController, HealthController
- DTOs: BatchEventsDto, HeartbeatDto, QueryDauDto, OnlineCountResponseDto, DauStatsResponseDto
- Guards: JwtAuthGuard
- Decorators: @Public, @CurrentUser
核心功能:
- ✅ 用户行为事件批量上报与存储
- ✅ 日活 DAU 统计 (按自然日去重, 支持省/市维度)
- ✅ 实时在线人数统计 (3分钟窗口)
- ✅ 心跳机制 (前台60秒间隔)
- ✅ HyperLogLog 实时 DAU 计数
- ✅ 定时任务 (快照记录, 过期清理, DAU 计算)
- ✅ Swagger API 文档
- ✅ Docker 多阶段构建
- ✅ 健康检查
技术栈:
- NestJS + TypeScript
- Prisma ORM + PostgreSQL
- Redis (ioredis)
- Kafka (kafkajs, 可选)
- CQRS 模式 (@nestjs/cqrs)
- 定时任务 (@nestjs/schedule)
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-02 12:11:38 -08:00
hailin
996bc231f2
.
2025-12-03 03:51:47 +08:00
Developer
566f464a9b
wip(presence-service): 初始化项目结构
...
- 创建基础配置文件 (package.json, tsconfig.json, nest-cli.json)
- 设计 Prisma schema (heartbeats, daily_active_users, online_sessions, dau_statistics)
- 待完善: Domain/Infrastructure/Application/API层实现
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-02 11:47:14 -08:00
Developer
c45ed8a575
feat(admin-service): 实现移动应用版本管理服务
...
- DDD+Hexagonal架构
- Domain层: AppVersion实体, Platform枚举, Repository接口
- Infrastructure层: Prisma集成, Repository实现
- Application层: CheckUpdate查询(供移动端), CreateVersion命令(管理员)
- API层: VersionController, DTOs (request/response)
- 数据库: app_versions表设计(支持Android/iOS)
- 功能: 版本检查、强制更新、文件SHA-256校验
- 部署: Dockerfile, docker-compose.yml, deploy.sh脚本
- 数据库迁移: Prisma migration初始化
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-02 11:22:30 -08:00
Developer
abe6d02a4c
fix(planting-service): 修复 CMD 路径并统一使用 curl
2025-12-02 11:06:13 -08:00
Developer
f3ac5d3718
fix: 修复健康检查路径,添加 authorization-service 健康检查控制器
2025-12-02 10:59:49 -08:00
Developer
99589f666a
fix(authorization-service): 修复端口配置默认值为 3009
2025-12-02 10:48:33 -08:00
Developer
24c7be6a8d
fix(referral-service): 修复端口配置使用 APP_PORT
2025-12-02 10:47:46 -08:00
Developer
d5e7da4828
fix(authorization-service): 修复 CMD 路径、端口号并安装 curl
2025-12-02 10:41:41 -08:00
Developer
f1b6370aae
fix(referral-service): 统一使用 curl 进行健康检查
2025-12-02 10:39:36 -08:00
Developer
b5d097214b
fix(referral-service): 统一健康检查使用 wget
...
docker-compose.yml: curl -> wget (与 Dockerfile 一致)
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-02 10:35:47 -08:00
Developer
00e359b412
fix(mpc-service): 直接从环境变量读取配置
...
ConfigService.get('port') 读取不到嵌套配置
改为直接使用 process.env.APP_PORT
修复服务监听错误端口 (6379 -> 3006)
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-02 10:29:59 -08:00
Developer
62dcc37b28
fix(backup-service): 添加 DATABASE_URL 用于 Prisma generate
...
构建时需要 dummy DATABASE_URL
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-02 10:17:43 -08:00
Developer
a17ac1b06a
fix(mpc-service): 使用 openssl 包替代 openssl1.1-compat
...
Alpine 3.22 已移除 openssl1.1-compat
使用 openssl (OpenSSL 3) 替代
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-02 10:17:08 -08:00
Developer
b67a5434e2
fix(mpc-service): 安装 OpenSSL 1.1 修复 Prisma 引擎加载失败
...
错误: libssl.so.1.1: No such file or directory
解决: 在 production stage 安装 openssl1.1-compat
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-02 10:14:36 -08:00
Developer
2297be1a04
fix(docker-compose): 统一 backup-service 和 mpc-service 健康检查
...
backup-service:
- docker-compose.yml: curl -> wget (与 Dockerfile 一致)
mpc-service:
- docker-compose.yml: curl -> node HTTP (与 Dockerfile 一致)
修复 docker-compose healthcheck 覆盖 Dockerfile HEALTHCHECK 导致的不一致
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-02 10:13:34 -08:00
Developer
9088b1a9ee
fix(backup-service): 修正启动路径和健康检查等待时间
...
- start-period: 5s -> 40s (给予足够启动时间)
- CMD: dist/main.js -> dist/src/main.js (修正实际路径)
- 保持使用 wget (Alpine 原生支持)
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-02 10:11:37 -08:00
Developer
781619e2ff
revert: 恢复 backup-service 和 mpc-service 原始 Dockerfile
...
回滚到纯 Alpine 版本(最初可用的版本)
- backup-service: 66199cc
- mpc-service: 6fa4d7a
之前的修改(slim/openssl/curl)导致问题
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-02 10:10:22 -08:00
Developer
0388aee2d4
fix(backup-service): 修复 builder stage 使用 Alpine 导致 Prisma 失败
...
问题:
- Builder stage 使用 node:20-alpine
- Prisma 在 Alpine 上下载二进制文件时网络错误
- linux-musl-openssl 兼容性问题
解决:
- Builder 和 Production 都使用 node:20-slim
- 统一使用 Debian base image
- 在 builder stage 安装 OpenSSL
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-02 10:07:05 -08:00
Developer
451aa8fae8
feat(mpc-service): 添加初始数据库 migration
...
创建 party_shares 和 signing_sessions 表及索引
修复健康检查失败问题(缺少数据库表)
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-02 10:03:03 -08:00
Developer
53943636ea
fix(backup-service): 修复健康检查配置不一致问题
...
- 将 Dockerfile 从 wget 改为 curl
- 统一 Dockerfile 和 docker-compose.yml 健康检查工具
- 增加 start_period 从 5s 到 40s,给予服务更多启动时间
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-02 09:57:32 -08:00
Developer
17ff0d951e
fix: 修复 docker-compose.yml 中所有服务的健康检查
...
问题:
- docker-compose.yml 的 healthcheck 覆盖了 Dockerfile 的 HEALTHCHECK
- 使用 wget 而不是 curl
- 健康检查 URL 不正确,导致所有服务显示 unhealthy
修复:
1. 统一使用 curl -f 代替 wget
2. 修正所有服务的健康检查 URL:
- identity-service: /health → /api/v1/health
- wallet-service: /health → /api/v1/health
- backup-service: /health ✓ (保持不变)
- planting-service: /health → /api/v1/health
- referral-service: /health ✓ (保持不变)
- reward-service: /health ✓ (保持不变)
- mpc-service: /api/v1/health ✓ (已正确,改用 curl)
- leaderboard-service: /health → /api/health
- reporting-service: /health → /api/v1/health
- authorization-service: /health ✓ (保持不变,改用 curl)
3. 统一 timeout 为 3s (原来是 10s)
4. admin-web: 优化 timeout 为 3s
Docker HEALTHCHECK 机制:
- 在容器内部执行 curl localhost:PORT/path
- 不经过 Nginx 或外部网络
- 需要与服务实际端点匹配
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-02 09:36:38 -08:00
Developer
ace7145b4c
fix(reward-service): 修复 DI 依赖注入错误
...
问题: RewardCalculationService 无法解析依赖
- DomainModule 未导入 InfrastructureModule
- service clients 使用 useClass 导致创建新实例时缺少依赖
解决方案:
1. DomainModule 导入 InfrastructureModule
2. InfrastructureModule 中:
- 先注册具体的 client 类 (ReferralServiceClient, AuthorizationServiceClient)
- 然后用 useExisting 提供 token 别名
- 这样确保使用同一个实例,包含所有依赖
参考: leaderboard-service 的修复方案
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-02 09:24:12 -08:00
Developer
afdaa888ec
refactor: 将所有服务的健康检查从 wget 改为 curl
...
curl 相比 wget 的优势:
- 更轻量 (二进制文件更小)
- 更常用 (标准 HTTP 工具)
- 语法更简洁 (curl -f vs wget -q --spider)
- 退出码更可靠 (-f 参数在 HTTP 错误时返回非 0)
修改的服务:
- identity-service
- wallet-service
- mpc-service
- reward-service
- leaderboard-service
- reporting-service
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-02 09:19:35 -08:00
Developer
5870614838
fix(reward-service): 修复 Prisma schema 缺少 url 字段
...
添加 datasource url 配置,解决构建时 Prisma generate 失败
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-02 09:14:43 -08:00
Developer
3c00f71f88
chore(reward-service): 重新生成 package-lock.json
...
使用 Prisma 5.22.0 版本重新生成 package-lock.json
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-02 07:47:09 -08:00
Developer
8fe4f651dc
fix(reporting-service): 修复 Dockerfile 构建和健康检查
...
- builder 阶段从 alpine 改为 slim (解决 Prisma 兼容性)
- 添加 OpenSSL 依赖到 builder 阶段
- 添加构建验证步骤
- 修复健康检查 URL: /health → /api/v1/health
- 添加 NODE_ENV=production
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-02 07:44:36 -08:00
Developer
86e7d5a3fa
fix(reward-service): 降级 Prisma 版本 7.x → 5.22.0
...
修复 PrismaClient 初始化错误:
TypeError: Cannot read properties of undefined (reading '__internal')
Prisma 7.x 是预览版本,存在兼容性问题,降级到稳定的 5.22.0 版本。
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-02 07:42:53 -08:00
Developer
451185005f
fix: 修复多个服务的 Docker 健康检查和构建配置
...
identity-service:
- 修复 HEALTHCHECK URL: /health → /api/v1/health
wallet-service:
- 修复 HEALTHCHECK URL: /health → /api/v1/health
leaderboard-service:
- 修复端口: 3000 → 3007
- 添加 HEALTHCHECK (/api/health)
- 添加非 root 用户 (nestjs)
- 添加 NODE_ENV=production
mpc-service:
- builder 阶段从 alpine 改为 slim (解决 Prisma 兼容性)
- 添加 OpenSSL 依赖到 builder 阶段
- 添加 wget 依赖
- HEALTHCHECK 从 node 脚本改为 wget
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-02 07:33:33 -08:00
Developer
4bd25d4e3c
feat(leaderboard-service): 添加 Prisma 初始 migration
...
- 创建 leaderboard_rankings 表
- 创建 leaderboard_configs 表
- 创建 virtual_accounts 表
- 创建 virtual_ranking_entries 表
- 创建 leaderboard_snapshots 表
- 创建 virtual_account_transactions 表
- 创建 leaderboard_events 表
- 插入默认配置数据
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-02 07:23:43 -08:00
Developer
bb989bd80f
fix(reward-service): 修复 Dockerfile 使用 Debian slim 和正确的 CMD 路径
...
- Builder 阶段从 node:20-alpine 改为 node:20-slim
- 修复 CMD 路径从 dist/main.js 改为 dist/src/main.js
- 添加构建输出验证步骤
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-02 07:16:20 -08:00
Developer
a503bda266
fix(leaderboard-service): 修复 DI 注入问题 - 使用 useExisting 替代 useClass
...
- ReferralServiceClient 和 IdentityServiceClient 使用 useExisting
- 避免在 DomainModule 中重新创建实例导致 HttpService 不可用
- 复用 InfrastructureModule 中已创建的实例
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-02 07:09:31 -08:00
Developer
7d87296d11
fix(leaderboard-service): 修复 Dockerfile 使用 Debian slim 解决 Prisma 兼容性问题
...
- Builder 阶段从 node:20-alpine 改为 node:20-slim
- 解决 Alpine Linux 上 @prisma/engines 下载失败问题 (ECONNRESET)
- 使用 COPY src ./src 替代 COPY . . 优化构建
- 添加构建输出验证步骤
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-02 07:03:08 -08:00
Developer
c3931255d3
fix(reward-service): 优化 Dockerfile 和添加 .dockerignore
...
问题:
1. Dockerfile 使用 COPY . . 会复制 node_modules 导致构建极慢
2. CMD 路径错误:dist/src/main.js 应该是 dist/main.js
修复:
- 添加 .dockerignore 排除 node_modules, dist 等
- 优化 Dockerfile 只复制必要文件 (COPY src ./src)
- 修正 CMD 路径为 dist/main.js
- 添加构建验证步骤 (test -f dist/main.js)
- 添加非 root 用户运行
- 添加健康检查
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-02 06:50:24 -08:00
Developer
fc26575693
fix(leaderboard-service): 删除 Dockerfile 中的 test stage
...
问题:Dockerfile 中的 test stage 放在最后,导致 docker build 默认使用
test stage 而不是 production stage。容器启动时运行 npm test 而不是
node dist/src/main.js。
修复:删除 test stage,只保留 builder 和 production stages。
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-02 06:48:54 -08:00
Developer
b224e209a6
fix(mpc-service): 修复PostgreSQL兼容性问题
...
1. Dockerfile: 将DATABASE_URL协议从mysql改为postgresql
2. schema.prisma: 重命名索引以满足PostgreSQL全局唯一性要求
- idx_party_id -> idx_ps_party_id (party_shares)
- idx_session_id -> idx_ps_session_id (party_shares)
- idx_status -> idx_ps_status (party_shares)
- idx_session_id -> idx_ss_session_id (session_states)
- idx_party_id -> idx_ss_party_id (session_states)
- idx_status -> idx_ss_status (session_states)
已在WSL2中验证Docker构建成功。
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-02 06:09:16 -08:00
Developer
a9594ef15e
fix(mpc-service): 修复数据库provider从mysql改为postgresql
...
mpc-service错误配置为mysql,与项目统一使用的postgresql不一致,
导致服务启动时Prisma验证DATABASE_URL失败。
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-02 05:54:07 -08:00
Developer
1150d7e514
fix(wallet,referral): correct build output path to dist/main.js
...
These services build to dist/main.js (no src subdirectory).
Added build verification steps.
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-02 05:38:36 -08:00
Developer
efd1156739
fix(mpc-service): correct build output path to dist/main.js
...
NestJS with tsconfig outDir: ./dist builds to dist/main.js, not dist/src/main.js.
Added build verification step to catch this earlier.
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-02 04:41:29 -08:00
Developer
9b4a1d119c
fix(services): switch from Alpine to Debian slim for Prisma OpenSSL
...
Alpine 3.22 removed openssl1.1-compat package which Prisma needs.
Switched production stage from node:20-alpine to node:20-slim (Debian)
which has proper OpenSSL support.
Changes:
- Use node:20-slim for production stage (keep Alpine for build)
- Install openssl and wget via apt-get
- Update user creation from Alpine (addgroup/adduser) to Debian (groupadd/useradd)
Validated identity-service build and startup in WSL2:
- Build passes successfully
- NestJS starts and loads all routes
- Prisma client connects without OpenSSL errors
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-02 04:12:27 -08:00
Developer
c2b44eef29
fix(services): add OpenSSL 1.1 compatibility for Prisma in Alpine
...
Prisma engine requires libssl.so.1.1 which is not available in Alpine
Linux by default (Alpine uses OpenSSL 3.x). Added openssl1.1-compat
package to all service Dockerfiles.
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-02 04:03:15 -08:00
Developer
7bb4259290
fix(services): correct NestJS build output path in all Dockerfiles
...
NestJS with sourceRoot: "src" outputs to dist/src/main.js not dist/main.js.
Fixed CMD paths in all service Dockerfiles:
- identity-service: dist/src/main.js (verified in WSL2)
- wallet-service: dist/src/main.js
- backup-service: dist/src/main.js
- planting-service: dist/src/main.js
- referral-service: dist/src/main.js
- reward-service: dist/src/main.js
- mpc-service: dist/src/main.js
- leaderboard-service: dist/src/main.js
- reporting-service: dist/src/main.js
- authorization-service: dist/src/main.js
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-02 03:56:02 -08:00
Developer
a23b786797
fix(identity-service): fix Dockerfile build and add .dockerignore
...
- Add .dockerignore to exclude unnecessary files from Docker context
- Explicitly copy tsconfig, nest-cli.json, and src directory
- Add build verification step (test -f dist/main.js)
- Change CMD from npm run to direct node command
- Add health check and non-root user for security
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-02 03:44:11 -08:00
Developer
0a0b7eb886
feat(services): add individual deploy scripts for each service
...
Add deploy.sh script to each service directory for independent
deployment and management:
- identity-service, wallet-service, backup-service
- planting-service, referral-service, reward-service
- mpc-service, leaderboard-service, reporting-service
- authorization-service
Each script supports:
- build / build-no-cache
- start / stop / restart
- logs / logs-tail
- status / health
- migrate / shell
Also updated main deploy.sh with build-no-cache command.
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-02 03:36:50 -08:00
Developer
2a449aff3c
fix(identity-service): add DATABASE_URL for Prisma generate in Dockerfile
...
Fix build failure caused by missing DATABASE_URL environment variable
during prisma:generate step. Changed from npm run prisma:generate to
direct npx prisma generate with dummy DATABASE_URL.
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-02 03:13:33 -08:00
Developer
77db1009dd
fix(services): add DATABASE_URL for Prisma generate in Dockerfiles
...
Add dummy DATABASE_URL environment variable prefix to all npx prisma
generate commands in Dockerfiles. Prisma requires DATABASE_URL at
build time to generate the client, but the actual value is only used
at runtime.
Services updated:
- authorization-service (postgresql)
- backup-service (postgresql)
- leaderboard-service (postgresql)
- mpc-service (mysql)
- planting-service (postgresql)
- referral-service (postgresql)
- reporting-service (postgresql)
- reward-service (postgresql)
- wallet-service (postgresql + npm install fix)
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-02 02:54:31 -08:00
Developer
b39344a604
fix(wallet-service): use npm install instead of npm ci
...
wallet-service doesn't have package-lock.json, npm ci requires it.
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-02 02:28:24 -08:00
Developer
3dd561bd24
fix(services): comment out admin-service (not yet implemented)
...
- Comment out admin-service in docker-compose.yml
- Simplify admin-service Dockerfile to placeholder
- Fixes build error due to missing source files
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-02 02:19:54 -08:00