diff --git a/.claude/DEPLOYMENT_QUICK_REFERENCE.md b/.claude/DEPLOYMENT_QUICK_REFERENCE.md index ed4a56b6..60eadfd5 100644 --- a/.claude/DEPLOYMENT_QUICK_REFERENCE.md +++ b/.claude/DEPLOYMENT_QUICK_REFERENCE.md @@ -29,7 +29,7 @@ deployments/production/kubernetes/ 14 YAML files (core services) - `catalog-service.yaml`, `inventory-service.yaml`, `wallet-service.yaml`, `booking-service.yaml` - `redis.yaml`, `ingress.yaml`, `namespace.yaml`, `configmap.yaml`, `secrets.yaml` -### Database Migrations +### Cơ Sở Dữ Liệu Migrations All 22 .NET services: ``` @@ -89,7 +89,7 @@ infra/docker/docker-compose.prod.yml ## Key Secrets (GitHub Actions + kubectl) -### Database URLs (23 services) +### Cơ Sở Dữ Liệu URLs (23 services) ``` REMOTE_IAM_DATABASE_URL_STAGING REMOTE_MERCHANT_DATABASE_URL_STAGING @@ -167,7 +167,7 @@ docs/ --- -## Database Connection Strings +## Cơ Sở Dữ Liệu Connection Strings ### Format ``` @@ -215,7 +215,7 @@ mkt_facebook_service, mkt_whatsapp_service, mkt_x_service, mkt_zalo_service ## Pre-Deployment Checklist (Key Items) -### Infrastructure +### Hạ Tầng - [ ] K8s cluster ≥3 nodes provisioned - [ ] Namespace `production` created - [ ] Resource limits configured @@ -270,7 +270,7 @@ storage-service, mining-service --- -## Tech Stack Summary +## Công Nghệ Sử Dụng Summary - **Runtime**: .NET 10.0 (C# 14) - **Framework**: ASP.NET Core 10.0 @@ -310,7 +310,7 @@ docker compose up -d ./scripts/dev/logs.sh [service-name] ``` -### Database Access +### Cơ Sở Dữ Liệu Access ```bash # Local PGPASSWORD=goodgo-local-2024 psql -h localhost -U postgres -d [service_database] @@ -349,6 +349,6 @@ kubectl rollout undo deployment/[service-name] -n production --- ## Created By -- **Analysis Date**: 2026-04-09 +- **Analysis Ngày**: 2026-04-09 - **Analysis Scope**: Complete deployment infrastructure review - **Output**: 2 comprehensive documents in `.claude/` diff --git a/.claude/LOCAL_DEV_INDEX.md b/.claude/LOCAL_DEV_INDEX.md index 76034420..4770ac9a 100644 --- a/.claude/LOCAL_DEV_INDEX.md +++ b/.claude/LOCAL_DEV_INDEX.md @@ -1,6 +1,6 @@ -# GoodGo POS - Local Development Documentation Index -**Created**: 2026-04-12 -**Status**: Complete Investigation ✅ +# GoodGo POS - Chỉ Mục Tài Liệu Phát Triển Cục Bộ +**Ngày tạo**: 2026-04-12 +**Trạng thái**: Khảo sát hoàn tất ✅ --- @@ -51,7 +51,7 @@ Contains: --- ### 3. **POS_DEPLOYMENT_STATE.md** (EXISTING) -**Purpose**: Comprehensive deployment state for staging/production +**Mục đích**: Comprehensive deployment state for staging/production Contains information about: - Kubernetes (RKE2) deployment @@ -129,7 +129,7 @@ docker compose up -d postgres redis rabbitmq minio ## 🔧 INFRASTRUCTURE REFERENCE -| Component | Port | Docker Image | Purpose | +| Component | Port | Docker Image | Mục đích | |-----------|------|------|---------| | PostgreSQL | 5432 | postgres:16-alpine | Database server | | Redis | 6379 | redis:7-alpine | Cache & backplane | @@ -173,7 +173,7 @@ infra/traefik/ ## 🌐 ACCESS AFTER STARTUP -| URL | What | Purpose | +| URL | What | Mục đích | |-----|------|---------| | http://localhost:3001 | Main App | POS frontend | | http://localhost/api/v1/* | API Gateway | Traefik routes services | @@ -205,8 +205,8 @@ docker compose restart psql -h localhost -U goodgo -d iam_service dotnet ef database update --project services/iam-service-net -# Status -docker ps --format "table {{.Names}}\t{{.Status}}" +# Trạng thái +docker ps --format "table {{.Names}}\t{{.Trạng thái}}" docker compose ps ``` @@ -316,7 +316,7 @@ I need to deploy ## 🔄 DOCUMENT STATUS -| Document | Created | Lines | Status | +| Document | Created | Lines | Trạng thái | |----------|---------|-------|--------| | LOCAL_DEV_QUICK_REFERENCE.md | 2026-04-12 | 391 | ✅ Complete | | LOCAL_DEV_SETUP_INVESTIGATION.md | 2026-04-12 | 821 | ✅ Complete | diff --git a/.claude/LOCAL_DEV_QUICK_REFERENCE.md b/.claude/LOCAL_DEV_QUICK_REFERENCE.md index efde7d7a..d78e09f8 100644 --- a/.claude/LOCAL_DEV_QUICK_REFERENCE.md +++ b/.claude/LOCAL_DEV_QUICK_REFERENCE.md @@ -1,5 +1,5 @@ -# GoodGo POS - Local Development Quick Reference -**Last Updated**: 2026-04-12 +# GoodGo POS - Tham Chiếu Nhanh Phát Triển Cục Bộ +**Cập nhật lần cuối**: 2026-04-12 --- @@ -83,7 +83,7 @@ docker compose down -v docker compose restart iam-service-net ``` -### Logs & Status +### Logs & Trạng thái ```bash # Smart log viewer ./scripts/dev/logs.sh iam-service @@ -94,10 +94,10 @@ docker logs -f postgres-local docker logs -f iam-service-net-local # Container status -docker ps --format "table {{.Names}}\t{{.Status}}" +docker ps --format "table {{.Names}}\t{{.Trạng thái}}" ``` -### Database +### Cơ Sở Dữ Liệu ```bash # Connect to PostgreSQL psql -h localhost -p 5432 -U goodgo -d iam_service @@ -127,7 +127,7 @@ export $(grep -v '^#' ../../deployments/local/.env.local | xargs) ## 🌐 ACCESS POINTS (After Services Start) -| URL | Purpose | +| URL | Mục đích | |-----|---------| | http://localhost | Main POS App (web-client-tpos-net) | | http://localhost:8080 | Traefik Dashboard | @@ -151,7 +151,7 @@ fnb-engine: http://localhost:5019 ## 📁 KEY FILES -| Path | Purpose | +| Path | Mục đích | |------|---------| | `deployments/local/docker-compose.yml` | Main config (1,645 lines) | | `deployments/local/.env` | Environment variables (checked in) | @@ -358,7 +358,7 @@ ASPNETCORE_ENVIRONMENT=Development dotnet watch run ```bash # Get auth token curl -X POST http://localhost:5001/api/v1/auth/login \ - -H "Content-Type: application/json" \ + -H "Content-Loại: application/json" \ -d '{"username":"test","password":"test"}' # Use token in other requests diff --git a/.claude/LOCAL_DEV_SETUP_INVESTIGATION.md b/.claude/LOCAL_DEV_SETUP_INVESTIGATION.md index f4430ca7..3e8e0210 100644 --- a/.claude/LOCAL_DEV_SETUP_INVESTIGATION.md +++ b/.claude/LOCAL_DEV_SETUP_INVESTIGATION.md @@ -1,6 +1,6 @@ -# GoodGo POS System - Local Development Setup Investigation -**Generated**: 2026-04-12 -**Base Path**: /Users/velikho/Desktop/WORKING/pos-system +# Hệ Thống GoodGo POS - Khảo Sát Cài Đặt Phát Triển Cục Bộ +**Ngày tạo**: 2026-04-12 +**Đường dẫn gốc**: /Users/velikho/Desktop/WORKING/pos-system --- @@ -25,7 +25,7 @@ The GoodGo POS system uses a **sophisticated multi-tier Docker Compose setup** f #### **Shared Infrastructure Tier** (6 services) Services that all microservices depend on: -| Service | Image | Port | Network | Purpose | +| Service | Image | Port | Network | Mục đích | |---------|-------|------|---------|---------| | `postgres` | postgres:16-alpine | 5432 | microservices-network | Central PostgreSQL 16 database server | | `redis` | redis:7-alpine | 6379 | microservices-network | Cache & SignalR backplane for all services | @@ -47,7 +47,7 @@ Services that all microservices depend on: | mining-service-net | 5006 | mining_service | iam-service, redis | **Engagement & Social Services (5)** -| Service | Port | Database | Purpose | +| Service | Port | Database | Mục đích | |---------|------|----------|---------| | mission-service-net | 5007 | mission_service | Gamification (check-ins, tasks) | | promotion-service-net | 5008 | promotion_service | Vouchers, campaigns, gift cards | @@ -65,7 +65,7 @@ Services that all microservices depend on: | catalog-service-net | 5016 | catalog_service | Product management | **Multi-Vertical Services (4)** -| Service | Port | Database | Purpose | +| Service | Port | Database | Mục đích | |---------|------|----------|---------| | order-service-net | 5017 | order_service | Order orchestration (Strategy pattern) | | inventory-service-net | 5018 | inventory_service | Stock management (retail + FnB) | @@ -81,12 +81,12 @@ Services that all microservices depend on: | mkt-zalo-service-net | 5024 | mkt_zalo_service | **Frontend BFF (1)** -| Service | Port | Purpose | +| Service | Port | Mục đích | |---------|------|---------| | web-client-tpos-net | 3001 | Blazor WebAssembly Hosted + YARP proxy | #### **Observability Tier** (6 services) -| Service | Port | Purpose | +| Service | Port | Mục đích | |---------|------|---------| | prometheus | 9090 | Metrics collection (15d retention) | | grafana | 3002 | Dashboards & visualization | @@ -107,7 +107,7 @@ goodgo-network (bridge driver) ## 2. INITIALIZATION SCRIPTS -### Database Initialization +### Cơ Sở Dữ Liệu Initialization **File**: `deployments/local/init-databases.sh` Creates 24 databases on PostgreSQL startup: @@ -187,7 +187,7 @@ $ ./scripts/dev/logs.sh docker # Legacy #### `.env` (Auto-generated) **Location**: `deployments/local/.env` -**Purpose**: Default environment for Docker Compose (checked in) +**Mục đích**: Default environment for Docker Compose (checked in) **Database URLs**: Remote PostgreSQL at 212.28.186.239:30992 ``` @@ -228,7 +228,7 @@ JWT_REFRESH_TOKEN_EXPIRY_DAYS=7 #### `.env.local` (Per-developer override) **Template**: `deployments/local/env.local.example` -**Purpose**: Local overrides (NOT committed) +**Mục đích**: Local overrides (NOT committed) Key differences from template: - Replace placeholders with real values @@ -236,7 +236,7 @@ Key differences from template: - Can adjust feature flags per developer #### Environment Files Summary -| File | Type | Purpose | Committed | +| File | Loại | Mục đích | Committed | |------|------|---------|-----------| | `.env` | Generated | Docker Compose defaults | ✅ Yes | | `.env.local` | Manual | Developer overrides | ❌ No (.gitignore) | @@ -287,9 +287,9 @@ http://localhost/api/v1/orders/* → order-service-net ... [etc for all services] ``` -### Access Points Summary +### Điểm Truy Cập Summary -| URL | Service | Purpose | +| URL | Service | Mục đích | |-----|---------|---------| | http://localhost | web-client-tpos-net:3001 | Main POS frontend | | http://localhost:8080 | Traefik | Dashboard | @@ -449,7 +449,7 @@ MERCHANT_DATABASE_URL=Host=localhost;Port=5432;Database=merchant_service;Usernam IAM_DATABASE_URL=Host=postgres;Port=5432;Database=iam_service;Username=goodgo;Password=goodgo-local-2024;SSL Mode=Disable ``` -### Database Initialization +### Cơ Sở Dữ Liệu Initialization Migrations are handled via Entity Framework: ```bash # Services auto-migrate on startup (if configured in Startup.cs) @@ -531,7 +531,7 @@ healthcheck: ### Monitoring Health ```bash # Check container health status -docker ps --format "table {{.Names}}\t{{.Status}}" +docker ps --format "table {{.Names}}\t{{.Trạng thái}}" # View health check logs docker inspect --format='{{json .State.Health}}' postgres-local | jq . @@ -541,7 +541,7 @@ docker inspect --format='{{json .State.Health}}' postgres-local | jq . ## 11. PORTS USED (Complete Inventory) -### Infrastructure Ports +### Hạ Tầng Ports | Port | Service | Access | |------|---------|--------| | 80 | Traefik HTTP | http://localhost | @@ -593,7 +593,7 @@ docker inspect --format='{{json .State.Health}}' postgres-local | jq . ### `.claude/` Directory Contents -| File | Purpose | Last Updated | +| File | Mục đích | Last Updated | |------|---------|--------------| | POS_DEPLOYMENT_STATE.md | Comprehensive deployment state analysis | 2026-04-11 | | DEPLOYMENT_QUICK_REFERENCE.md | Quick reference guide | 2026-04-11 | @@ -613,7 +613,7 @@ These files contain excellent context on staging/production setup. They referenc ## 13. LOCAL DEVELOPMENT QUICK START -### Prerequisites +### Yêu Cầu Trước Khi Bắt Đầu ```bash # macOS specific brew install docker docker-compose @@ -657,7 +657,7 @@ cd apps/web-client-tpos-net pnpm dev ``` -### Access Points After Startup +### Điểm Truy Cập After Startup ``` Main App: http://localhost:3001 API Gateway: http://localhost/api/v1/... diff --git a/.claude/LOCAL_DEV_STATE.md b/.claude/LOCAL_DEV_STATE.md index 8b7b3495..37db6aea 100644 --- a/.claude/LOCAL_DEV_STATE.md +++ b/.claude/LOCAL_DEV_STATE.md @@ -1,23 +1,23 @@ -# Local Dev Environment State +# Trạng Thái Môi Trường Phát Triển Cục Bộ -## Setup Info -- **Date**: 2026-04-12 -- **Machine**: MacBook M-series, 64GB RAM +## Thông Tin Cài Đặt +- **Ngày**: 2026-04-12 +- **Máy**: MacBook M-series, 64GB RAM - **Docker**: Docker Desktop 4.55, Engine 29.1.3 (darwin/arm64) - **Compose file**: `deployments/local/docker-compose.yml` - **Env file**: `deployments/local/.env` -## Database -- **Type**: Remote Neon PostgreSQL +## Cơ Sở Dữ Liệu +- **Loại**: Remote Neon PostgreSQL - **Host**: 212.28.186.239:30992 - **User**: cloud_admin - **Databases**: 23 per-service databases (iam_service, merchant_service, etc.) - **Note**: Shared with staging — changes here affect staging data -## Running Services (36 containers) +## Các Service Đang Chạy (36 containers) -### Infrastructure -| Service | Port | Status | +### Hạ Tầng +| Service | Port | Trạng thái | |---------|------|--------| | PostgreSQL 16 | 5432 | healthy (local container, but services use remote Neon) | | Redis 7 | 6379 | healthy | @@ -26,7 +26,7 @@ | Traefik v3.3 | 80 / 8080 (Dashboard) | running | ### Microservices -| Service | Port | Status | +| Service | Port | Trạng thái | |---------|------|--------| | iam-service | 5001 | healthy | | merchant-service | 5005 | healthy | @@ -53,13 +53,13 @@ | mkt-x-service | 5023 | healthy | | mkt-zalo-service | 5024 | healthy | -### Frontend -| Service | Port | Status | +### Giao Diện +| Service | Port | Trạng thái | |---------|------|--------| | pos-web (Blazor WASM) | 3001 | healthy | -### Observability -| Service | Port | Status | +### Quan Sát Hệ Thống +| Service | Port | Trạng thái | |---------|------|--------| | Prometheus | 9090 | healthy | | Grafana | 3002 | healthy | @@ -67,8 +67,8 @@ | Promtail | — | running | | Alertmanager | 9093 | healthy | -## Access Points -| URL | Purpose | +## Điểm Truy Cập +| URL | Mục đích | |-----|---------| | http://localhost:3001 | POS App (Blazor WASM) | | http://localhost:8080 | Traefik Dashboard | @@ -121,10 +121,10 @@ docker compose down 5. Gitea Actions → Kaniko build → Harbor → K8s deploy 6. Verify on https://platform.techbi.org -## Known Issues +## Vấn Đề Đã Biết - PostgreSQL container runs locally but all services point to remote Neon DB - Homebrew postgres/redis must be stopped before starting Docker (they grab ports 5432/6379) - `brew services stop postgresql@17 && brew services stop redis` -## Last Updated +## Cập Nhật Lần Cuối 2026-04-12 — Initial setup, 36 containers running healthy diff --git a/.claude/POS_DEPLOYMENT_STATE.md b/.claude/POS_DEPLOYMENT_STATE.md index 18a907a5..92f68703 100644 --- a/.claude/POS_DEPLOYMENT_STATE.md +++ b/.claude/POS_DEPLOYMENT_STATE.md @@ -1,6 +1,6 @@ # GoodGo POS System Deployment State - Comprehensive Analysis -**Generated**: 2026-04-09 | **Last Updated**: 2026-04-11 +**Ngày tạo**: 2026-04-09 | **Cập nhật lần cuối**: 2026-04-11 **Working Directory**: `/Users/velikho/Desktop/WORKING/pos-system` **Project**: GoodGo Platform - Monorepo with 26 microservices @@ -20,9 +20,9 @@ The GoodGo platform is a **enterprise-scale microservices POS system** built on: - **Staging**: Kubernetes with Neon PostgreSQL (self-hosted on K8s) - **Production**: Kubernetes with Neon PostgreSQL (cloud) -### Current Staging Live Status (2026-04-11) +### Current Staging Live Trạng thái (2026-04-11) -| Component | Status | Details | +| Component | Trạng thái | Details | |-----------|--------|---------| | **DNS** | ✅ Live | `api.techbi.org` + `platform.techbi.org` → 212.28.186.239 | | **TLS** | ✅ Valid | Let's Encrypt, expires Jul 2026 | @@ -124,7 +124,7 @@ deployments/ **Secrets Inventory (35 total entries)**: -| Secret Type | Count | Examples | +| Secret Loại | Count | Examples | |-------------|-------|----------| | **JWT Keys** | 2 | Jwt__Secret, Jwt__RefreshSecret | | **Database URLs** | 23 | One per service (iam_service, merchant_service, ...) | @@ -203,7 +203,7 @@ docs/ ### Key Documents -| Document | Purpose | Updated | +| Document | Mục đích | Updated | |----------|---------|---------| | **README.md** | Project overview & quick start | Current | | **CLAUDE.md** | Agent configuration & full architecture | Current | @@ -212,7 +212,7 @@ docs/ | **CTO_DEPLOYMENT_REPORT.md** | Deployment analysis | 2026-03-14 | | **CTO_FIX_TRACKER.md** | Bug fixes & tracking | 2026-03-13 | -### Architecture Documentation +### Kiến Trúc Documentation 1. system-design.md - Overall architecture 2. microservices-communication.md - Service-to-service patterns @@ -238,7 +238,7 @@ docs/ - Traefik v3 (API gateway) - Full observability stack (Prometheus, Grafana, Loki, Promtail) -### Infrastructure Directories +### Hạ Tầng Directories ``` infra/ @@ -271,7 +271,7 @@ fnb-engine → fnb_engine ... (23 total services) ``` -### Database Providers +### Cơ Sở Dữ Liệu Providers | Environment | Provider | Details | |-------------|----------|---------| @@ -394,7 +394,7 @@ ServiceName/ - Load testing completed - Rollback plan approved -### Infrastructure (13) +### Hạ Tầng (13) - K8s cluster ≥3 nodes - Namespace created - Resource limits configured @@ -450,7 +450,7 @@ ServiceName/ ## 11. Key Files Summary -| File | Lines | Purpose | +| File | Lines | Mục đích | |------|-------|---------| | deployments/local/docker-compose.yml | 1349 | Local dev environment | | CLAUDE.md | 500+ | Agent config & architecture | @@ -496,4 +496,4 @@ The GoodGo POS system is a **production-grade microservices platform** with: - ✓ Extensive documentation - ✓ Clear staging → production path -**Status**: Mature, well-documented system ready for production operation. +**Trạng thái**: Mature, well-documented system ready for production operation. diff --git a/.claude/README.md b/.claude/README.md index 2b38f170..18f7e281 100644 --- a/.claude/README.md +++ b/.claude/README.md @@ -1,7 +1,7 @@ # GoodGo POS System - Deployment Analysis Documents -**Generated**: 2026-04-09 -**Status**: ✓ Complete +**Ngày tạo**: 2026-04-09 +**Trạng thái**: ✓ Complete This directory contains comprehensive analysis of the GoodGo POS system deployment infrastructure. @@ -188,7 +188,7 @@ kubectl apply -f deployments/production/kubernetes/ kubectl rollout status deployment -n production ``` -### Database Access +### Cơ Sở Dữ Liệu Access ```bash # Local PGPASSWORD=goodgo-local-2024 psql -h localhost -U postgres @@ -237,10 +237,10 @@ Use this to verify deployment state understanding: | Services Analyzed | 26 microservices | | Documentation Files | 3 (this directory) + 60+ in docs/ | | Total Documentation | ~100 KB | -| Status | ✓ Complete & Current | +| Trạng thái | ✓ Complete & Current | --- -**Last Updated**: 2026-04-09 +**Cập nhật lần cuối**: 2026-04-09 **Maintainer**: VelikHo **Project**: GoodGo Platform - Enterprise POS System diff --git a/.claude/TROUBLESHOOTING.md b/.claude/TROUBLESHOOTING.md index e10feb9b..d8f79acd 100644 --- a/.claude/TROUBLESHOOTING.md +++ b/.claude/TROUBLESHOOTING.md @@ -1,12 +1,12 @@ -# Troubleshooting Guide - GoodGo POS System +# Hướng Dẫn Xử Lý Sự Cố - GoodGo POS System -**Last Updated**: 2026-04-11 +**Cập nhật lần cuối**: 2026-04-11 --- ## Quick Reference -| Symptom | Likely Cause | Fix | +| Triệu chứng | Likely Cause | Cách khắc phục | |---------|-------------|-----| | Pod `Pending` | Cluster out of CPU/memory | Reduce requests or add nodes | | Pod `CrashLoopBackOff` | Missing DB or config | Check logs + secrets | @@ -21,9 +21,9 @@ ## 1. Network Policy Issues ### Problem: Services cannot communicate with each other -**Symptom**: promotion-service health check fails (WalletServiceHealthCheck timeout) +**Triệu chứng**: promotion-service health check fails (WalletServiceHealthCheck timeout) -**Root Cause**: `default-deny-all` blocks all traffic. Need explicit allow rules. +**Nguyên nhân gốc**: `default-deny-all` blocks all traffic. Need explicit allow rules. **Required Network Policies**: - `allow-traefik-ingress` — ingress-nginx → services (port 8080) @@ -33,7 +33,7 @@ - `allow-app-to-redis-egress` — services → redis (port 6379) - `allow-app-to-rabbitmq-egress` — services → rabbitmq (port 5672) -**Fix**: +**Cách khắc phục**: ```bash kubectl apply -f - < -n staging | grep -A5 Events ``` -**Fix**: +**Cách khắc phục**: ```bash kubectl create secret docker-registry harbor-pull-secret -n staging \ --docker-server=harbor.techbi.org \ diff --git a/.claude/agents/cto-coordinator.md b/.claude/agents/cto-coordinator.md index d0a05dc1..6bf773c4 100644 --- a/.claude/agents/cto-coordinator.md +++ b/.claude/agents/cto-coordinator.md @@ -1,9 +1,9 @@ # CTO Coordinator - GoodGo Platform -## Role +## Vai Trò Ban la CTO Coordinator cho GoodGo Platform. Ban la strategic technical leader, chiu trach nhiem phan tich yeu cau business va chuyen thanh technical specifications. -## Responsibilities +## Trách Nhiệm - Nhan yeu cau tu stakeholder, phan tich va chuyen thanh technical specifications - Quyet dinh service nao can thay doi (trong 26 microservices) - Xac dinh cross-service dependencies va integration points @@ -11,13 +11,13 @@ Ban la CTO Coordinator cho GoodGo Platform. Ban la strategic technical leader, c - Review architecture decisions (service boundaries, API contracts, data flow) - Dam bao consistency across services -## Constraints +## Ràng Buộc - KHONG viet code truc tiep - KHONG modify files - Chi output: Technical specs, task breakdown, architecture decisions - Luon xem xet impact len cac services khac khi thay doi 1 service -## Output Format +## Định Dạng Đầu Ra ### 1. ANALYSIS - Tom tat yeu cau va impact assessment @@ -38,9 +38,9 @@ Ban la CTO Coordinator cho GoodGo Platform. Ban la strategic technical leader, c ### 4. RISKS - Potential issues va mitigation strategies -## Domain Knowledge +## Kiến Thức Chuyên Môn -### Service Map +### Bản Đồ Service | Service | Domain | DB | Port | |---------|--------|-----|------| | iam-service-net | Auth, RBAC, MFA, Sessions, JWT | iam_service | 8080 | @@ -61,7 +61,7 @@ Ban la CTO Coordinator cho GoodGo Platform. Ban la strategic technical leader, c | ads-*-service-net | Ads platform (5 services) | ads_*_service | 8080 | | mkt-*-service-net | Marketing (4 channels) | N/A | 8080 | -### Architecture +### Kiến Trúc - API Gateway: Traefik v3 (path-based routing /api/v1/{resource}) - Auth: Duende IdentityServer, JWT Bearer, RBAC policies - Message Broker: RabbitMQ (ads services, async operations) diff --git a/.claude/agents/devops.md b/.claude/agents/devops.md index 772031d6..4ce255c8 100644 --- a/.claude/agents/devops.md +++ b/.claude/agents/devops.md @@ -1,9 +1,9 @@ # DevOps/Infrastructure Engineer - GoodGo Platform -## Role +## Vai Trò Ban la DevOps/Infrastructure Engineer cho GoodGo Platform. Ban quan ly infrastructure, CI/CD, va deployment. -## Tech Stack +## Công Nghệ Sử Dụng - Containers: Docker (multi-stage builds, non-root user dotnetuser:1001) - Orchestration: Docker Compose (local), Kubernetes RKE2 (staging/prod) - API Gateway: Traefik v3 (path-based routing, rate limiting, CORS) @@ -17,7 +17,7 @@ Ban la DevOps/Infrastructure Engineer cho GoodGo Platform. Ban quan ly infrastru ## Key File Locations -| Purpose | Path | +| Mục đích | Path | |---------|------| | Local Docker Compose | `deployments/local/docker-compose.yml` (1349 lines) | | Local env vars | `deployments/local/.env.local` | @@ -218,7 +218,7 @@ jobs: echo "SELECT 'CREATE DATABASE service_name' WHERE NOT EXISTS (SELECT FROM pg_database WHERE datname = 'service_name')\gexec" | psql -U goodgo ``` -## Checklist: Adding a New Service +## Danh Sách Kiểm Tra: Adding a New Service 1. [ ] Create Dockerfile in `services/new-service-net/Dockerfile` 2. [ ] Add service entry to `deployments/local/docker-compose.yml` @@ -232,7 +232,7 @@ echo "SELECT 'CREATE DATABASE service_name' WHERE NOT EXISTS (SELECT FROM pg_dat 10. [ ] Add Prometheus scrape target if metrics exposed 11. [ ] Update deploy workflows if needed -## Rules +## Quy Tắc - ALWAYS use multi-stage Docker builds - ALWAYS run as non-root user (dotnetuser:1001) in containers - ALWAYS include health checks (liveness + readiness) diff --git a/.claude/agents/qa-testing.md b/.claude/agents/qa-testing.md index 44e9798f..68df466e 100644 --- a/.claude/agents/qa-testing.md +++ b/.claude/agents/qa-testing.md @@ -1,14 +1,14 @@ # QA/Testing Engineer - GoodGo Platform -## Role +## Vai Trò Ban la QA/Testing Engineer cho GoodGo Platform. Ban viet tests va dam bao chat luong code. -## Tech Stack +## Công Nghệ Sử Dụng - Backend: xUnit + Moq + FluentAssertions - Frontend: Playwright (E2E), Smoke tests - CI: GitHub Actions (PostgreSQL test DB, InMemory DB) -## Test Types +## Các Loại Test ### 1. UNIT TESTS (backend) **Location**: `tests/ServiceName.UnitTests/` @@ -74,9 +74,9 @@ public class MyEntityTests entity.Id.Should().NotBeEmpty(); entity.Name.Should().Be("Test"); - entity.Status.Should().Be(EntityStatus.Draft); + entity.Trạng thái.Should().Be(EntityTrạng thái.Draft); entity.DomainEvents.Should().ContainSingle() - .Which.Should().BeOfType(); + .Which.Should().BeOfLoại(); } [Fact] @@ -92,7 +92,7 @@ public class MyEntityTests var entity = new MyEntity("Test", null); entity.Activate(); - entity.Status.Should().Be(EntityStatus.Active); + entity.Trạng thái.Should().Be(EntityTrạng thái.Active); entity.DomainEvents.Should().HaveCount(2); // Created + Activated } @@ -158,7 +158,7 @@ public class CustomWebApplicationFactory : WebApplicationFactory { // Remove real DbContext var descriptor = services.SingleOrDefault( - d => d.ServiceType == typeof(DbContextOptions)); + d => d.ServiceLoại == typeof(DbContextOptions)); if (descriptor != null) services.Remove(descriptor); // Use InMemory @@ -173,7 +173,7 @@ public class CustomWebApplicationFactory : WebApplicationFactory } } -public class EntitiesControllerTests : IClassFixture +public class EntitiesControllerTests : IClassCách khắc phụcture { private readonly HttpClient _client; @@ -186,7 +186,7 @@ public class EntitiesControllerTests : IClassFixture _name; public string? Description => _description; - public EntityStatus Status => _status; - public int StatusId { get; private set; } - public DateTime CreatedAt => _createdAt; - public DateTime? UpdatedAt => _updatedAt; + public EntityTrạng thái Trạng thái => _status; + public int Trạng tháiId { get; private set; } + public NgàyTime CreatedAt => _createdAt; + public NgàyTime? UpdatedAt => _updatedAt; // EF Core constructor protected MyEntity() { } @@ -116,9 +116,9 @@ public class MyEntity : Entity, IAggregateRoot Id = Guid.NewGuid(); _name = name; _description = description; - _status = EntityStatus.Draft; - StatusId = EntityStatus.Draft.Id; - _createdAt = DateTime.UtcNow; + _status = EntityTrạng thái.Draft; + Trạng tháiId = EntityTrạng thái.Draft.Id; + _createdAt = NgàyTime.UtcNow; AddDomainEvent(new EntityCreatedDomainEvent(this)); } @@ -126,12 +126,12 @@ public class MyEntity : Entity, IAggregateRoot // Behavior methods public void Activate() { - if (_status != EntityStatus.Draft) + if (_status != EntityTrạng thái.Draft) throw new DomainException("Only draft entities can be activated"); - _status = EntityStatus.Active; - StatusId = EntityStatus.Active.Id; - _updatedAt = DateTime.UtcNow; + _status = EntityTrạng thái.Active; + Trạng tháiId = EntityTrạng thái.Active.Id; + _updatedAt = NgàyTime.UtcNow; AddDomainEvent(new EntityActivatedDomainEvent(this)); } @@ -142,7 +142,7 @@ public class MyEntity : Entity, IAggregateRoot _name = name; _description = description; - _updatedAt = DateTime.UtcNow; + _updatedAt = NgàyTime.UtcNow; } } ``` @@ -176,14 +176,14 @@ public class EntityRepository : IEntityRepository public async Task GetAsync(Guid entityId) { return await _context.Entities - .Include(e => e.Status) + .Include(e => e.Trạng thái) .FirstOrDefaultAsync(e => e.Id == entityId); } public async Task> GetAllAsync() { return await _context.Entities - .Include(e => e.Status) + .Include(e => e.Trạng thái) .OrderByDescending(e => e.CreatedAt) .ToListAsync(); } @@ -195,11 +195,11 @@ public class EntityRepository : IEntityRepository ``` ### 7. EF CONFIGURATION -**File**: `src/ServiceName.Infrastructure/EntityConfigurations/EntityEntityTypeConfiguration.cs` +**File**: `src/ServiceName.Infrastructure/EntityConfigurations/EntityEntityLoạiConfiguration.cs` ```csharp -public class MyEntityEntityTypeConfiguration : IEntityTypeConfiguration +public class MyEntityEntityLoạiConfiguration : IEntityLoạiConfiguration { - public void Configure(EntityTypeBuilder builder) + public void Configure(EntityLoạiBuilder builder) { builder.ToTable("my_entities"); builder.HasKey(e => e.Id); @@ -208,14 +208,14 @@ public class MyEntityEntityTypeConfiguration : IEntityTypeConfiguration e.Id).HasColumnName("id").IsRequired(); builder.Property("_name").HasColumnName("name").HasMaxLength(200).IsRequired(); builder.Property("_description").HasColumnName("description").HasMaxLength(1000); - builder.Property("_createdAt").HasColumnName("created_at").IsRequired(); - builder.Property("_updatedAt").HasColumnName("updated_at"); - builder.Property(e => e.StatusId).HasColumnName("status_id").IsRequired(); + builder.Property("_createdAt").HasColumnName("created_at").IsRequired(); + builder.Property("_updatedAt").HasColumnName("updated_at"); + builder.Property(e => e.Trạng tháiId).HasColumnName("status_id").IsRequired(); - builder.HasOne(e => e.Status).WithMany().HasForeignKey(e => e.StatusId).OnDelete(DeleteBehavior.Restrict); + builder.HasOne(e => e.Trạng thái).WithMany().HasForeignKey(e => e.Trạng tháiId).OnDelete(DeleteBehavior.Restrict); builder.HasIndex("_name"); - builder.HasIndex(e => e.StatusId); + builder.HasIndex(e => e.Trạng tháiId); builder.HasIndex("_createdAt"); } } @@ -240,7 +240,7 @@ public class EntitiesController : ControllerBase } [HttpPost] - [ProducesResponseType(typeof(object), StatusCodes.Status201Created)] + [ProducesResponseLoại(typeof(object), Trạng tháiCodes.Trạng thái201Created)] public async Task Create([FromBody] CreateEntityCommand command, CancellationToken ct) { var result = await _mediator.Send(command, ct); @@ -249,7 +249,7 @@ public class EntitiesController : ControllerBase } [HttpGet("{id:guid}")] - [ProducesResponseType(typeof(object), StatusCodes.Status200OK)] + [ProducesResponseLoại(typeof(object), Trạng tháiCodes.Trạng thái200OK)] public async Task GetById(Guid id, CancellationToken ct) { var query = new GetEntityByIdQuery(id); @@ -260,7 +260,7 @@ public class EntitiesController : ControllerBase } [HttpGet] - [ProducesResponseType(typeof(object), StatusCodes.Status200OK)] + [ProducesResponseLoại(typeof(object), Trạng tháiCodes.Trạng thái200OK)] public async Task GetAll([FromQuery] int pageNumber = 1, [FromQuery] int pageSize = 10, CancellationToken ct = default) { var query = new GetEntitiesQuery(pageNumber, pageSize); @@ -316,7 +316,7 @@ public class CreateEntityCommandHandlerTests ### 11. FUNCTIONAL TEST **File**: `tests/ServiceName.FunctionalTests/Controllers/EntitiesControllerTests.cs` ```csharp -public class EntitiesControllerTests : IClassFixture +public class EntitiesControllerTests : IClassCách khắc phụcture { private readonly HttpClient _client; @@ -329,7 +329,7 @@ public class EntitiesControllerTests : IClassFixture @context.Name - @context.Status + @context.Trạng thái @@ -199,7 +199,7 @@ public static MudTheme MarketingDark = new() @* Default culture for POS: vi-VN *@ ``` -## Rules +## Quy Tắc - ALWAYS use MudBlazor components (NEVER raw HTML for UI elements) - ALWAYS localize user-facing strings with IStringLocalizer - ALWAYS handle loading states (MudProgressCircular or skeleton) diff --git a/.claude/agents/senior-mobile-dev.md b/.claude/agents/senior-mobile-dev.md index ac35aaf4..feb39213 100644 --- a/.claude/agents/senior-mobile-dev.md +++ b/.claude/agents/senior-mobile-dev.md @@ -1,13 +1,13 @@ # Senior Mobile Developer (Swift + MAUI) - GoodGo Platform -## Role +## Vai Trò Ban la Senior Mobile Developer cho GoodGo Platform. Ban implement features cho iOS (SwiftUI) va cross-platform (MAUI). --- ## SwiftUI iOS App -### Tech Stack +### Công Nghệ Sử Dụng - SwiftUI, Combine framework (@Published, @ObservedObject) - MVVM architecture with @MainActor - URLSession async/await for API calls @@ -69,7 +69,7 @@ class AuthViewModel: ObservableObject { // URLSession-based, async/await // Error enum: invalidURL, noData, decodingError, networkError, // serverError(statusCode, message), unauthorized, forbidden, notFound, rateLimited -// OAuth2: OAuthTokenResponse (accessToken, tokenType, expiresIn, refreshToken, scope) +// OAuth2: OAuthTokenResponse (accessToken, tokenLoại, expiresIn, refreshToken, scope) // Snake_case -> camelCase via decoder.keyDecodingStrategy ``` @@ -85,7 +85,7 @@ class AuthViewModel: ObservableObject { **Icons**: SF Symbols **Localization**: String `.localized` extension -### Rules +### Quy Tắc - ALWAYS use @MainActor for ViewModels - ALWAYS use async/await (not completion handlers) - ALWAYS handle errors with bilingual messages (EN + VI) @@ -96,7 +96,7 @@ class AuthViewModel: ObservableObject { ## .NET MAUI App -### Tech Stack +### Công Nghệ Sử Dụng - .NET 10.0, .NET MAUI - MVVM: Community Toolkit v8.4 ([ObservableProperty], [RelayCommand]) - Navigation: Shell-based routing @@ -152,9 +152,9 @@ public partial class MyViewModel : BaseViewModel } ``` -### Rules +### Quy Tắc - ALWAYS use Community Toolkit MVVM attributes - ALWAYS use Shell-based navigation - FOLLOW existing BaseViewModel pattern - USE XAML for UI definitions -- Status: Template phase - expanding with new features +- Trạng thái: Template phase - expanding with new features diff --git a/.claude/agents/tech-lead.md b/.claude/agents/tech-lead.md index 3c1060a1..2c603fc5 100644 --- a/.claude/agents/tech-lead.md +++ b/.claude/agents/tech-lead.md @@ -1,9 +1,9 @@ # Tech Lead - GoodGo Platform -## Role +## Vai Trò Ban la Tech Lead cho GoodGo Platform. Ban enforce architecture, code quality va quan ly implementation workflow. -## Responsibilities +## Trách Nhiệm - Nhan specs tu CTO, breakdown thanh concrete coding tasks - Assign tasks cho Senior Developers (co the nhieu agents song song, moi agent 1 service) - Enforce Clean Architecture + CQRS patterns @@ -11,7 +11,7 @@ Ban la Tech Lead cho GoodGo Platform. Ban enforce architecture, code quality va - Quan ly cross-service dependencies - Dam bao naming conventions va code structure consistency -## Architecture Rules (MUST ENFORCE) +## Kiến Trúc Rules (MUST ENFORCE) ### Clean Architecture Layers ``` @@ -51,7 +51,7 @@ Domain layer KHONG DUOC depend bat ky layer nao khac { "success": true, "data": { "items": [...], "totalCount": N, "pageNumber": N, "pageSize": N } } ``` -## Naming Conventions +## Quy Ước Đặt Tên | Element | Pattern | Example | |---------|---------|---------| @@ -64,20 +64,20 @@ Domain layer KHONG DUOC depend bat ky layer nao khac | Repository Interface | IEntityRepository | IOrderRepository | | Repository Impl | EntityRepository | OrderRepository | | DbContext | ServiceNameContext | OrderServiceContext | -| Entity Config | EntityNameEntityTypeConfiguration | OrderEntityTypeConfiguration | +| Entity Config | EntityNameEntityLoạiConfiguration | OrderEntityLoạiConfiguration | | Domain Event | EntityVerbedDomainEvent | OrderCreatedDomainEvent | | DB table | plural snake_case | orders, order_items | | DB column | snake_case | created_at, merchant_id | | Service folder | kebab-case | merchant-service-net | -## Task Assignment Format +## Định Dạng Phân Công Tác Vụ ```markdown ### Task: [T-XXX] [Title] - **Service**: [service-name-net] - **Priority**: P0/P1/P2 - **Layer**: Domain / Infrastructure / API / Frontend -- **Type**: Command / Query / Entity / Migration / Test / UI Component +- **Loại**: Command / Query / Entity / Migration / Test / UI Component - **Files to create/modify**: - `src/ServiceName.Domain/AggregatesModel/...` - `src/ServiceName.Infrastructure/...` @@ -92,10 +92,10 @@ Domain layer KHONG DUOC depend bat ky layer nao khac - [ ] Functional tests for API endpoint ``` -## Code Review Checklist +## Danh Sách Kiểm Tra Code Review ```markdown -### Architecture +### Kiến Trúc - [ ] Domain layer has NO external dependencies (no EF, no MediatR) - [ ] Clean separation: Command for write, Query for read - [ ] Entity uses private fields + behavior methods (no public setters) @@ -116,7 +116,7 @@ Domain layer KHONG DUOC depend bat ky layer nao khac ### API - [ ] API returns consistent response format { success, data/error } - [ ] [ApiVersion("1.0")] on controllers -- [ ] [ProducesResponseType] attributes +- [ ] [ProducesResponseLoại] attributes ### Quality - [ ] Bilingual comments (EN + VI)