Commit Graph

763 Commits

Author SHA1 Message Date
hailin b36987fee1 feat(mobile-app): implement profile editing with backend API
- Add updateProfile() and getMyProfile() methods to AccountService
- Load real user data (nickname, avatar) in EditProfilePage
- Call PUT /user/update-profile API to save nickname changes
- Display SVG avatar from backend
- Add loading state while fetching user data

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-07 20:51:59 -08:00
hailin 1f852d1fca feat(mobile-app): use real user data in profile page
- Load username, serial number, and avatar from account service
- Display SVG avatar from backend instead of static image
- Show loading state while fetching user data

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-07 20:47:42 -08:00
hailin d05ff9ee17 style(mobile-app): add gradient background and card background to ranking page
- Change page background from white to gradient (light beige to light orange)
- Change card background to light white (#FFFDF8) for better contrast

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-07 20:44:53 -08:00
hailin 9ae8516179 style(mobile-app): reduce ranking list item spacing from 12px to 4px
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-07 20:41:33 -08:00
hailin 93fc648268 fix(mobile-app): align back button to left in import mnemonic page
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-07 20:26:24 -08:00
hailin 747c81164e style(mobile-app): make serial number TextField fully transparent
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-07 20:23:50 -08:00
hailin 81bfead8f1 style(mobile-app): make mnemonic input TextField fully transparent
- Add all border states as InputBorder.none
- Set filled: false to remove background
- Add cursorColor matching theme

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-07 20:21:45 -08:00
hailin cfd5bd9bde feat(mobile-app): add import mnemonic page and fix share URL
- Add import mnemonic page for account recovery
- Add serial number input field for recovery
- Add RecoverAccountResponse class for API response parsing
- Fix share page URL path (remove duplicate /api)
- Fix bottom nav bar height for better adaptability
- Update routes for import mnemonic page

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-07 13:35:40 -08:00
hailin c1670d2439 feat(mnemonic): add recovery mnemonic generation and backup confirmation
Backend (blockchain-service):
- Add RecoveryMnemonicAdapter to generate 12-word BIP39 mnemonic
- Generate mnemonic when wallet addresses are derived (linked to public key)
- Include mnemonic in WalletAddressCreated event

Backend (identity-service):
- Add RecoveryMnemonic table with revocation/replacement support
- Save encrypted mnemonic to database on WalletAddressCreated event
- Add PUT /user/mnemonic/backup API to mark mnemonic as backed up
- Clear plaintext mnemonic from Redis after backup confirmation

Frontend (mobile-app):
- Update markMnemonicBackedUp() to call backend API
- Fix verify_mnemonic_page validation logic:
  - Checkbox checked → pass directly
  - Not checked → must select correct word

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-07 12:32:10 -08:00
hailin f1390a85c8 fix(mobile-app): skip backup mnemonic page for MPC wallet mode
- Fix mnemonic parsing: empty string "" now correctly becomes empty list
- MPC mode (no mnemonic) skips backup page and navigates directly to home
- Apply fix to both initial load and polling logic

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-07 12:00:38 -08:00
hailin 72c49ffe7a fix(mobile-app): fix API response parsing for auto-create and wallet
- Extract 'data' field from API response before parsing
- Fix createAccount() to parse responseData['data']
- Fix getWalletInfo() to parse responseData['data']
- Resolves: type 'Null' is not a subtype of type 'int' in type cast

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-07 11:55:41 -08:00
hailin 8e9eb0ef19 fix(identity): add device_info columns to user_devices migration
- Add device_info JSONB column for storing complete device info
- Add platform, device_model, os_version, app_version columns
- Add screen_width, screen_height, locale, timezone columns
- Add idx_platform index

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-07 11:42:55 -08:00
hailin 29f2dc0524 fix(identity): remove address from updateProfile and fix deviceInfo type
- Remove dto.address parameter from updateProfile controller
- Remove address property from updateProfile service
- Fix deviceInfo JSON serialization for Prisma InputJsonValue type

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-07 11:29:51 -08:00
hailin 79345a20cf fix(identity): update migration to TEXT avatar and remove province/city/address
- Change avatar_url column from VARCHAR(500) to TEXT
- Remove province_code, city_code, address columns from user_accounts
- Remove idx_province_city index

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-07 11:28:09 -08:00
hailin 2705812826 refactor(identity): remove province/city/address fields
- Remove provinceCode, cityCode, address from UserAccount aggregate
- Remove ProvinceCode, CityCode value objects
- Remove UserLocationUpdatedEvent domain event
- Update Prisma schema to drop province/city/address columns
- Update repository, mapper, handlers, services and DTOs
- Clean up tests and factory files

Province/city should belong to adoption-service as transaction data,
not identity-service user data.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-07 11:23:26 -08:00
hailin fbec0b9112 feat(identity): store complete deviceInfo JSON from frontend
- Add deviceInfo JSON field to UserDevice table (Prisma schema)
- Update DeviceInfo value object to use deviceInfo instead of HardwareInfo
- Update repository to save complete JSON with redundant fields for queries
- Update mapper to read deviceInfo from database
- Update aggregate and handlers to pass deviceInfo through
- Allow any fields in DeviceNameInput interface with index signature

100% preserve original device info JSON from frontend without extraction

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-07 11:08:37 -08:00
hailin 592f13e939 refactor(identity-service): 简化DeviceNameDto为接收任意JSON对象
- 将DeviceNameDto从class改为interface
- 使用@IsObject()验证,允许前端传递任意设备信息字段
- 添加index signature允许扩展字段
- 后端只提取需要的字段存储到数据库

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-07 10:59:45 -08:00
hailin 0c7f9b6da9 feat(identity-service): 扩展DeviceNameDto支持更多设备信息字段
添加以下可选字段:
- brand: 品牌
- manufacturer: 厂商
- device: 设备名
- product: 产品名
- hardware: 硬件名
- sdkInt: SDK版本(Android)
- isPhysicalDevice: 是否真机

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-07 10:58:47 -08:00
hailin 7a0e83dac5 Revert "fix(mobile-app): 修复deviceName只发送后端接受的字段"
This reverts commit 1b4901ea68.
2025-12-07 10:58:24 -08:00
hailin 1b4901ea68 fix(mobile-app): 修复deviceName只发送后端接受的字段
后端DeviceNameDto只接受model/platform/osVersion三个字段
移除brand/manufacturer/device/product/hardware/sdkInt/isPhysicalDevice

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-07 10:57:38 -08:00
hailin 657b66c9e5 fix: 修复钱包API路径和avatarUrl字段长度问题
- identity-service: avatarUrl字段从VarChar(2000)改为Text类型
- mobile-app: 修复getWalletInfo API路径从/user/$id/wallet改为/user/wallet
- mobile-app: 添加userWallet端点常量

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-07 10:53:40 -08:00
hailin 51be55d315 feat(reward): 补全10种认种奖励分配规则
新增4种系统费用类权益:
- COST_FEE: 成本费 400 USDT → 成本账户(userId=2)
- OPERATION_FEE: 运营费 300 USDT → 运营账户(userId=3)
- HEADQUARTERS_BASE_FEE: 总部社区基础费 9 USDT → 总部社区(userId=1)
- RWAD_POOL_INJECTION: RWAD底池注入 800 USDT → 底池账户(userId=4)

原有6种用户权益类保持不变:
- SHARE_RIGHT: 分享权益 500 USDT
- PROVINCE_AREA_RIGHT: 省区域权益 15 USDT + 1%算力
- PROVINCE_TEAM_RIGHT: 省团队权益 20 USDT
- CITY_AREA_RIGHT: 市区域权益 35 USDT + 2%算力
- CITY_TEAM_RIGHT: 市团队权益 40 USDT
- COMMUNITY_RIGHT: 社区权益 80 USDT

总计: 400 + 300 + 9 + 800 + 500 + 15 + 20 + 35 + 40 + 80 = 2199 USDT

同时更新seed脚本创建4个系统账户

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-07 09:19:20 -08:00
hailin 667ca1527a feat(blockchain-service): add Prisma migration files
Add initial migration 20241207000000_init with all database tables:
- monitored_addresses
- deposit_transactions
- block_checkpoints
- transaction_requests
- blockchain_events

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-07 09:08:31 -08:00
hailin 54d3533c18 feat(services): add infra-clean and infra-reset commands
- infra-clean: Remove infrastructure containers and volumes (DELETES DATA)
- infra-reset: Clean and reinstall infrastructure (DELETES DATA)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-07 08:56:36 -08:00
hailin bfddd203ca feat(services): add --no-cache option to rebuild-svc command
Usage: ./deploy.sh rebuild-svc <name> --no-cache

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-07 08:46:00 -08:00
hailin fdb3c132de feat(services): add infrastructure management commands to deploy.sh
Add commands for managing infrastructure services separately:
- infra-up: Start postgres, redis, zookeeper, kafka
- infra-down: Stop infrastructure services
- infra-restart: Restart infrastructure
- infra-status: Show infrastructure status with health checks
- infra-logs: View infrastructure service logs

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-07 08:32:30 -08:00
hailin 3dc0fb15d8 feat(blockchain-service): add Prisma migration for init schema
- Create migration 20241207000000_init with all 5 tables
- Tables: monitored_addresses, deposit_transactions, block_checkpoints, transaction_requests, blockchain_events
- Mark migration as applied to existing database

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-07 08:23:14 -08:00
hailin 0c00382a98 fix: convert deploy.sh CRLF to LF and add executable permission
- Convert Windows CRLF line endings to Unix LF for all deploy.sh files
- Add executable permission to all deploy.sh scripts

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-07 07:01:13 -08:00
hailin e76adcbe8d . 2025-12-07 14:56:13 +00:00
hailin b25a893d37 docs(config): update .env.example files for production deployment
- Update all .env.example files with production topology documentation
- Add network configuration for Server A (119.145.15.38/192.168.1.100) and Server B (192.168.1.111)
- Document service ports and connection URLs for all microservices
- Add architecture diagrams in comments for easy reference
- Include security notes and key generation commands

Files updated:
- backend/services/.env.example (main config)
- backend/services/identity-service/.env.example
- backend/services/mpc-service/.env.example
- backend/services/blockchain-service/.env.example
- backend/mpc-system/.env.example
- backend/api-gateway/.env.example
- backend/infrastructure/.env.example

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-07 04:55:21 -08:00
hailin ab8852907d fix(mpc-service): increase Kafka consumer session timeout
- Increase sessionTimeout from 30s to 5 minutes
- Increase heartbeatInterval from 3s to 10s
- Add rebalanceTimeout of 5 minutes
- This prevents consumer from being kicked out during long MPC keygen operations

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-07 03:58:40 -08:00
hailin 493a76117a fix(identity-service): ensure BlockchainWalletHandler is initialized
- Add BlockchainEventConsumerService to InfrastructureModule
- Add BlockchainWalletHandler and MpcKeygenCompletedHandler to ApplicationModule
- Inject event handlers into UserApplicationService to force NestJS initialization
- This ensures onModuleInit is called for event handlers, enabling Kafka event consumption

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-07 03:46:55 -08:00
hailin 106137224a fix(identity-service): add BlockchainEventConsumerService to InfrastructureModule
The consumer was not being initialized because it was not registered in the module.
2025-12-07 03:30:26 -08:00
hailin bad6ba2232 fix(mpc-service): use @unique on username field for Prisma upsert compatibility 2025-12-07 02:19:17 -08:00
hailin 84e653d284 fix(mpc-service): add /api/v1 prefix to blockchain-service calls
blockchain-service uses global API prefix, need to include it in URLs.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-07 02:11:57 -08:00
hailin 845dd857b0 fix(mpc-service): add BLOCKCHAIN_SERVICE_URL config
Configure correct blockchain-service URL (port 3012) for address derivation.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-07 02:08:43 -08:00
hailin 3925b19229 fix(mpc-service): use JWT auth instead of X-API-Key
mpc-account-service expects JWT Bearer tokens, not X-API-Key header.
Added JWT token generation and use MPC_JWT_SECRET env var.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-07 02:02:17 -08:00
hailin 7588c9efb7 fix(mpc-service): use explicit container names for rwa services
When mpc-service joins mpc-system network, 'postgres' resolves to mpc-postgres.
Use explicit names (rwa-postgres, rwa-redis, rwa-kafka) to avoid conflicts.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-07 01:55:52 -08:00
hailin 63e543933f fix(mpc-service): connect to mpc-system network
- Changed MPC URLs from 192.168.1.111 to Docker internal names
- Added mpc-system_mpc-network to mpc-service for cross-network communication

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-07 01:52:25 -08:00
hailin 2ae174692e fix(mpc-service): use correct env var name MPC_ACCOUNT_SERVICE_URL
Changed from MPC_SYSTEM_URL to MPC_ACCOUNT_SERVICE_URL to match docker-compose config.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-07 01:48:02 -08:00
hailin 3332124250 fix(identity-service): change dynamic import to static import
Dynamic imports with path aliases (@/domain/events) don't work at runtime.
Changed to static import to fix module resolution error.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-07 01:40:46 -08:00
hailin 742cc21395 fix(identity-service): extend avatar_url column to 2000 chars
SVG avatars can be up to 745+ characters, exceeding the previous 500 char limit.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-07 01:31:44 -08:00
hailin 34fc008f9d fix(blockchain-service): add global API prefix and increase healthcheck start_period
- Add app.setGlobalPrefix('api/v1') to main.ts so health endpoint
  is at /api/v1/health consistent with other services
- Increase healthcheck start_period to 60s to allow time for
  Prisma migrations on first startup

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-07 01:20:35 -08:00
hailin be6abd3034 fix(blockchain-service): standardize Dockerfile with other services
- Use node:20-slim instead of alpine for OpenSSL compatibility
- Add startup script with prisma migrate/push
- Increase healthcheck start-period to 60s
- Add non-root user for security

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-07 01:17:55 -08:00
hailin 1125dd98ef fix(blockchain-service): auto-create database and run migrations on startup
- Add rwa_blockchain to init-databases.sh script
- Change Dockerfile CMD to run prisma db push before starting app

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-07 01:14:50 -08:00
hailin e20e3cb7af fix(blockchain-service): add openssl and curl for Prisma and healthcheck 2025-12-07 01:09:25 -08:00
hailin 9eb2d5a206 fix(blockchain-service): import DomainModule for ConfirmationPolicyService 2025-12-07 01:06:45 -08:00
hailin 3af4234c89 feat: add blockchain-service to root docker-compose.yml 2025-12-07 00:58:23 -08:00
hailin dba9d16074 . 2025-12-07 00:40:19 -08:00
hailin 6451cd6fc3 refactor: unify docker-compose configs to use shared infrastructure
All microservices now use the shared rwa-network and connect to:
- rwa-postgres: Shared PostgreSQL database server
- rwa-redis: Shared Redis cache
- rwa-kafka: Shared Kafka message broker

Each service's docker-compose.yml now only defines the application
container and uses `networks: external: true` to connect to the
shared infrastructure defined in the root docker-compose.yml.

This prevents duplicate infrastructure containers and ensures all
services can communicate via Kafka and share the same Redis/PostgreSQL.

Services updated:
- admin-service
- backup-service
- blockchain-service
- identity-service
- leaderboard-service
- mpc-service
- presence-service

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-07 00:35:56 -08:00