diff --git a/.claude/launch.json b/.claude/launch.json new file mode 100644 index 0000000..8ac5768 --- /dev/null +++ b/.claude/launch.json @@ -0,0 +1,23 @@ +{ + "version": "0.0.1", + "configurations": [ + { + "name": "web", + "runtimeExecutable": "pnpm", + "runtimeArgs": ["--filter", "@goodgo/web", "dev"], + "port": 3000 + }, + { + "name": "api", + "runtimeExecutable": "env", + "runtimeArgs": ["NODE_OPTIONS=-r dotenv/config", "DOTENV_CONFIG_PATH=../../.env", "pnpm", "--filter", "@goodgo/api", "dev"], + "port": 3001 + }, + { + "name": "ai-services", + "runtimeExecutable": "uvicorn", + "runtimeArgs": ["app.main:app", "--reload", "--port", "8000"], + "port": 8000 + } + ] +} diff --git a/.obsidian/app.json b/.obsidian/app.json new file mode 100644 index 0000000..9e26dfe --- /dev/null +++ b/.obsidian/app.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/.obsidian/appearance.json b/.obsidian/appearance.json new file mode 100644 index 0000000..9e26dfe --- /dev/null +++ b/.obsidian/appearance.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/.obsidian/core-plugins.json b/.obsidian/core-plugins.json new file mode 100644 index 0000000..639b90d --- /dev/null +++ b/.obsidian/core-plugins.json @@ -0,0 +1,33 @@ +{ + "file-explorer": true, + "global-search": true, + "switcher": true, + "graph": true, + "backlink": true, + "canvas": true, + "outgoing-link": true, + "tag-pane": true, + "footnotes": false, + "properties": true, + "page-preview": true, + "daily-notes": true, + "templates": true, + "note-composer": true, + "command-palette": true, + "slash-command": false, + "editor-status": true, + "bookmarks": true, + "markdown-importer": false, + "zk-prefixer": false, + "random-note": false, + "outline": true, + "word-count": true, + "slides": false, + "audio-recorder": false, + "workspaces": false, + "file-recovery": true, + "publish": false, + "sync": true, + "bases": true, + "webviewer": false +} \ No newline at end of file diff --git a/.obsidian/graph.json b/.obsidian/graph.json new file mode 100644 index 0000000..4f4b760 --- /dev/null +++ b/.obsidian/graph.json @@ -0,0 +1,22 @@ +{ + "collapse-filter": true, + "search": "", + "showTags": false, + "showAttachments": false, + "hideUnresolved": false, + "showOrphans": true, + "collapse-color-groups": true, + "colorGroups": [], + "collapse-display": true, + "showArrow": false, + "textFadeMultiplier": 0, + "nodeSizeMultiplier": 1, + "lineSizeMultiplier": 1, + "collapse-forces": true, + "centerStrength": 0.518713248970312, + "repelStrength": 10, + "linkStrength": 1, + "linkDistance": 250, + "scale": 2.637251782725985, + "close": false +} \ No newline at end of file diff --git a/.obsidian/workspace.json b/.obsidian/workspace.json new file mode 100644 index 0000000..5b58b13 --- /dev/null +++ b/.obsidian/workspace.json @@ -0,0 +1,195 @@ +{ + "main": { + "id": "8120c80685758063", + "type": "split", + "children": [ + { + "id": "32d6a24c5a30cd86", + "type": "tabs", + "children": [ + { + "id": "bcc8519e86215ae1", + "type": "leaf", + "state": { + "type": "markdown", + "state": { + "file": "docs/audits/README.md", + "mode": "source", + "source": false + }, + "icon": "lucide-file", + "title": "README" + } + } + ] + } + ], + "direction": "vertical" + }, + "left": { + "id": "1a23335ac90faeeb", + "type": "split", + "children": [ + { + "id": "84af90c3050b8522", + "type": "tabs", + "children": [ + { + "id": "6b1656f5d8814399", + "type": "leaf", + "state": { + "type": "file-explorer", + "state": { + "sortOrder": "alphabetical", + "autoReveal": false + }, + "icon": "lucide-folder-closed", + "title": "Trình duyệt tệp" + } + }, + { + "id": "eee596e4768da7c7", + "type": "leaf", + "state": { + "type": "search", + "state": { + "query": "", + "matchingCase": false, + "explainSearch": false, + "collapseAll": false, + "extraContext": false, + "sortOrder": "alphabetical" + }, + "icon": "lucide-search", + "title": "Tìm kiếm" + } + }, + { + "id": "d9f2a6cd9003f026", + "type": "leaf", + "state": { + "type": "bookmarks", + "state": {}, + "icon": "lucide-bookmark", + "title": "Đánh dấu" + } + } + ] + } + ], + "direction": "horizontal", + "width": 300 + }, + "right": { + "id": "2a72ad31ae778671", + "type": "split", + "children": [ + { + "id": "afbb78cfabc5ffdc", + "type": "tabs", + "children": [ + { + "id": "b31ea8299b55a296", + "type": "leaf", + "state": { + "type": "backlink", + "state": { + "file": "docs/audits/README.md", + "collapseAll": false, + "extraContext": false, + "sortOrder": "alphabetical", + "showSearch": false, + "searchQuery": "", + "backlinkCollapsed": false, + "unlinkedCollapsed": true + }, + "icon": "links-coming-in", + "title": "Liên kết đến của README" + } + }, + { + "id": "4f0abda4204b5457", + "type": "leaf", + "state": { + "type": "outgoing-link", + "state": { + "file": "docs/audits/README.md", + "linksCollapsed": false, + "unlinkedCollapsed": true + }, + "icon": "links-going-out", + "title": "Liên kết đi ra từ README" + } + }, + { + "id": "c90ad3bbb8a1356f", + "type": "leaf", + "state": { + "type": "tag", + "state": { + "sortOrder": "frequency", + "useHierarchy": true, + "showSearch": false, + "searchQuery": "" + }, + "icon": "lucide-tags", + "title": "Thẻ" + } + }, + { + "id": "0b43a9e84bf13337", + "type": "leaf", + "state": { + "type": "all-properties", + "state": { + "sortOrder": "frequency", + "showSearch": false, + "searchQuery": "" + }, + "icon": "lucide-archive", + "title": "Tất cả thuộc tính" + } + }, + { + "id": "09cab83df267633e", + "type": "leaf", + "state": { + "type": "outline", + "state": { + "file": "docs/audits/README.md", + "followCursor": false, + "showSearch": false, + "searchQuery": "" + }, + "icon": "lucide-list", + "title": "Đề cương của README" + } + } + ] + } + ], + "direction": "horizontal", + "width": 300, + "collapsed": true + }, + "left-ribbon": { + "hiddenItems": { + "switcher:Mở bộ chuyển đổi nhanh": false, + "graph:Mở xem biểu đồ": false, + "canvas:Tạo bảng mới": false, + "daily-notes:Mở ghi chú hôm nay": false, + "templates:Chèn mẫu": false, + "command-palette:Mở khay lệnh": false, + "bases:Tạo cơ sở mới": false + } + }, + "active": "bcc8519e86215ae1", + "lastOpenFiles": [ + "report/audit-2026-04-19.md", + "docs/audits/README.md", + "CHANGELOG.md", + "CLAUDE.md", + "CONTRIBUTING.md", + "README.md" + ] +} \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 66b2e86..859b3ff 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,262 +1,262 @@ -# Changelog +# Nhật Ký Thay Đổi -All notable changes to the GoodGo Platform will be documented in this file. +Tất cả các thay đổi đáng chú ý của GoodGo Platform sẽ được ghi lại trong tệp này. -The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), -and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +Định dạng dựa trên [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), +và dự án này tuân theo [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [Unreleased] -### Added (CEO Audit Wave 13 — 2026-04-12) -- CEO audit routine (TEC-1915) — full codebase audit + project state review -- Plan document with 7-section report: audit summary, critical issues, priorities, recommendations -- 6 new subtasks created (TEC-1918 through TEC-1923) for Wave 13 -- Updated PROJECT_TRACKER with Wave 13 tracking section +### Đã thêm (CEO Audit Wave 13 — 2026-04-12) +- Quy trình kiểm tra CEO (TEC-1915) — kiểm tra toàn bộ codebase + xem xét trạng thái dự án +- Tài liệu kế hoạch với báo cáo 7 phần: tóm tắt kiểm tra, các vấn đề quan trọng, ưu tiên, khuyến nghị +- 6 subtask mới được tạo (TEC-1918 đến TEC-1923) cho Wave 13 +- Cập nhật PROJECT_TRACKER với phần theo dõi Wave 13 -### QA Results (2026-04-12) -- Lint: PASS (0 errors) -- TypeScript: 7 errors in web test files (vitest types missing) — TEC-1918 -- Unit Tests: 232 files, 1454 tests, ALL PASS -- Build: ALL 3 packages build successfully -- Git: Clean working tree +### Kết Quả QA (2026-04-12) +- Lint: PASS (0 lỗi) +- TypeScript: 7 lỗi trong các tệp test web (thiếu kiểu vitest) — TEC-1918 +- Kiểm thử đơn vị: 232 tệp, 1454 bài kiểm thử, TẤT CẢ ĐỀU PASS +- Build: TẤT CẢ 3 gói build thành công +- Git: Cây làm việc sạch -### Added -- CEO full audit & implementation plan (TEC-1882) — 8-part report covering architecture, quality, security -- 7 new subtasks created (TEC-1888 through TEC-1894) for Wave 11D-13 -- Updated PROJECT_TRACKER with Waves 11D-13 subtask tracking -- Updated QA_TRACKER with 2026-04-11 test report (27 failing tests identified) -- Comprehensive audit reports: AUDIT_SUMMARY, COMPREHENSIVE_AUDIT, AUDIT_INDEX +### Đã thêm +- Kiểm tra toàn diện CEO & kế hoạch triển khai (TEC-1882) — báo cáo 8 phần bao gồm kiến trúc, chất lượng, bảo mật +- 7 subtask mới được tạo (TEC-1888 đến TEC-1894) cho Wave 11D-13 +- Cập nhật PROJECT_TRACKER với theo dõi subtask Waves 11D-13 +- Cập nhật QA_TRACKER với báo cáo kiểm thử ngày 2026-04-11 (xác định 27 bài kiểm thử thất bại) +- Các báo cáo kiểm tra toàn diện: AUDIT_SUMMARY, COMPREHENSIVE_AUDIT, AUDIT_INDEX -### Identified (from CEO Audit 2026-04-11) -- 725 ESLint errors (712 auto-fixable) — TEC-1888 -- TypeScript errors in web tests (json-ld.spec.tsx) — TEC-1888 -- 27 failing rate limit guard tests — TEC-1889 -- 3 incomplete API modules (health, metrics, mcp) — TEC-1890 -- MCP servers are stubs (~50 lines each) — TEC-1891 -- Only 6 web unit tests (need 50+) — TEC-1892 -- No field-level PII encryption — TEC-1893 -- No MFA for agent/admin accounts — TEC-1894 +### Đã xác định (từ CEO Audit 2026-04-11) +- 725 lỗi ESLint (712 có thể tự động sửa) — TEC-1888 +- Lỗi TypeScript trong các bài kiểm thử web (json-ld.spec.tsx) — TEC-1888 +- 27 bài kiểm thử rate limit guard thất bại — TEC-1889 +- 3 module API chưa hoàn chỉnh (health, metrics, mcp) — TEC-1890 +- Các MCP server chỉ là stub (~50 dòng mỗi cái) — TEC-1891 +- Chỉ có 6 bài kiểm thử đơn vị web (cần 50+) — TEC-1892 +- Không có mã hóa PII ở cấp độ trường — TEC-1893 +- Không có MFA cho tài khoản agent/admin — TEC-1894 -### Previously Added -- CEO audit plan document with full improvement & feature matrix (TEC-1682) -- Wave 5 issues: npm vulnerability fixes, test coverage, Saved Searches, Dependabot -- PgBouncer connection pooling for production PostgreSQL -- SEO optimization — JSON-LD, dynamic sitemap, meta tags for listings -- API error codes reference documentation -- Security headers hardening across API and Web apps -- Multi-stage production Dockerfile for NestJS API -- Startup-time validation for JWT secrets (rejects placeholders) -- Per-type file size limits and 413 responses for media uploads -- Rate limiting and auth guard for MCP transport controller -- Async error handling for critical module handlers -- QueryErrorBoundary component with real map coordinates (web) -- GDPR-compliant user data deletion endpoint -- Listing search caching with @Cacheable decorator -- Auth + search i18n translations and filter-bar accessibility +### Đã thêm trước đó +- Tài liệu kế hoạch kiểm tra CEO với ma trận cải tiến & tính năng đầy đủ (TEC-1682) +- Các vấn đề Wave 5: sửa lỗ hổng npm, độ phủ kiểm thử, Saved Searches, Dependabot +- Kết nối pool PgBouncer cho PostgreSQL môi trường production +- Tối ưu hóa SEO — JSON-LD, sitemap động, meta tags cho danh sách bất động sản +- Tài liệu tham khảo mã lỗi API +- Tăng cường tiêu đề bảo mật cho cả API và ứng dụng Web +- Dockerfile production đa giai đoạn cho NestJS API +- Kiểm tra giá trị JWT secret khi khởi động (từ chối giá trị giữ chỗ) +- Giới hạn kích thước tệp theo loại và phản hồi 413 cho tải lên media +- Rate limiting và auth guard cho MCP transport controller +- Xử lý lỗi bất đồng bộ cho các handler module quan trọng +- Component QueryErrorBoundary với tọa độ bản đồ thực tế (web) +- Endpoint xóa dữ liệu người dùng tuân thủ GDPR +- Cache kết quả tìm kiếm danh sách bất động sản với decorator @Cacheable +- Bản dịch i18n cho Auth + search và khả năng truy cập filter-bar -### Fixed -- MCP transport controller now requires JWT authentication (BUG-004 resolved) -- 21 lint errors from GDPR/logger/caching commits -- Replaced `new Logger()` with DI LoggerService across modules -- CI workflow branch targets corrected from main to master -- Lint error and typecheck failures for MVP launch readiness +### Đã sửa +- MCP transport controller hiện yêu cầu xác thực JWT (BUG-004 đã giải quyết) +- 21 lỗi lint từ các commit GDPR/logger/caching +- Thay thế `new Logger()` bằng DI LoggerService xuyên suốt các module +- Đã sửa nhánh đích của CI workflow từ main sang master +- Lỗi lint và typecheck để chuẩn bị ra mắt MVP -### Changed -- Split large files during logger refactor +### Đã thay đổi +- Tách các tệp lớn trong quá trình refactor logger --- ## [1.4.0] - 2026-04-08 -### Added -- Redis caching for user quota checks with prefix-based cache invalidation -- Domain layer unit tests across all modules (auth, payments, subscriptions, admin, analytics, listings, notifications, reviews, search, metrics) -- Health check endpoints (`/health`, `/health/db`, `/health/redis`) using `@nestjs/terminus` -- Property Valuation UI with AVM (Automated Valuation Model) integration on the web frontend +### Đã thêm +- Redis caching cho kiểm tra quota người dùng với xóa cache theo tiền tố +- Kiểm thử đơn vị tầng domain trên tất cả các module (auth, payments, subscriptions, admin, analytics, listings, notifications, reviews, search, metrics) +- Các endpoint health check (`/health`, `/health/db`, `/health/redis`) sử dụng `@nestjs/terminus` +- Giao diện Định giá Bất động sản với tích hợp AVM (Automated Valuation Model) trên web frontend -### Changed -- Improved cache service with prefix-based clearing patterns -- Enhanced analytics query handlers with caching layer +### Đã thay đổi +- Cải thiện cache service với các mẫu xóa theo tiền tố +- Nâng cao các handler truy vấn analytics với tầng caching -### Fixed -- Lint errors resolved across codebase +### Đã sửa +- Giải quyết các lỗi lint trên toàn bộ codebase --- ## [1.3.0] - 2026-03-28 -### Added -- Complete notification delivery system with email (Nodemailer + Handlebars), push (Firebase Cloud Messaging), and in-app channels -- Mapbox district heatmap visualization and agent performance dashboard on web frontend -- Reviews module with full CRUD endpoints, CQRS handlers, and 1-5 star rating value objects -- Unit tests for analytics, metrics, notifications, payments, and search modules -- Enhanced geo-search with PostGIS spatial queries and Typesense listing-approved event handlers -- Dedicated `/health` endpoint with timestamp response +### Đã thêm +- Hệ thống gửi thông báo hoàn chỉnh với email (Nodemailer + Handlebars), push (Firebase Cloud Messaging), và các kênh trong ứng dụng +- Trực quan hóa heatmap quận huyện bằng Mapbox và dashboard hiệu suất agent trên web frontend +- Module đánh giá với đầy đủ các endpoint CRUD, các handler CQRS, và value object đánh giá 1-5 sao +- Kiểm thử đơn vị cho các module analytics, metrics, notifications, payments và search +- Cải thiện geo-search với truy vấn không gian PostGIS và các event handler listing-approved của Typesense +- Endpoint `/health` chuyên dụng với phản hồi timestamp -### Changed -- Refactored cache service internals and analytics handlers for better reliability +### Đã thay đổi +- Refactor nội bộ cache service và các handler analytics để tăng độ tin cậy -### Fixed -- Missing `AuthState` properties in web frontend test mocks -- E2E workflow improvements: Prisma generate step, browser cache, trace artifacts +### Đã sửa +- Thiếu các thuộc tính `AuthState` trong các mock kiểm thử web frontend +- Cải thiện quy trình E2E: bước Prisma generate, cache trình duyệt, trace artifacts --- ## [1.2.0] - 2026-03-20 -### Added -- React Query integration for data fetching with error retry UX -- Dark mode toggle for web frontend -- Redis caching layer for search and analytics hot paths -- Vietnamese NLP pipeline (Underthesea) for property description analysis in AI services -- Prometheus `MetricsService`, `HttpMetricsInterceptor`, and custom metric constants -- Agent Profile, KYC verification, Subscription, and Payment dashboard pages on web frontend -- Unit tests for MCP servers (property search, market analytics, valuation) -- Unit tests for web frontend validations and utility functions +### Đã thêm +- Tích hợp React Query cho data fetching với UX thử lại khi lỗi +- Nút chuyển đổi dark mode cho web frontend +- Tầng Redis caching cho các đường dẫn hot của search và analytics +- Pipeline NLP tiếng Việt (Underthesea) để phân tích mô tả bất động sản trong AI services +- `MetricsService`, `HttpMetricsInterceptor` Prometheus, và các hằng số metric tùy chỉnh +- Trang Agent Profile, xác minh KYC, Subscription, và bảng điều khiển Payment trên web frontend +- Kiểm thử đơn vị cho các MCP server (tìm kiếm bất động sản, phân tích thị trường, định giá) +- Kiểm thử đơn vị cho các hàm kiểm tra và tiện ích web frontend -### Fixed -- Removed MinIO hardcoded credentials; added presigned URL support for media uploads -- JWT secret enforcement in all environments (not just production) -- Added missing `Review.userId` index for FK query performance +### Đã sửa +- Xóa thông tin xác thực MinIO được mã hóa cứng; thêm hỗ trợ presigned URL cho tải lên media +- Áp dụng kiểm tra JWT secret cho tất cả môi trường (không chỉ production) +- Thêm chỉ mục `Review.userId` còn thiếu để tăng hiệu suất truy vấn FK --- ## [1.1.0] - 2026-03-12 -### Added -- Listing duplicate detection service to prevent redundant property submissions -- Subscription quota enforcement with per-plan feature limits and usage metering -- Google and Zalo OAuth backend strategies for social login -- 58 unit tests covering critical auth, payment, and subscription paths -- Loading skeletons, error boundaries, and accessibility improvements on web frontend -- Sentry error tracking integration for both API and web apps +### Đã thêm +- Dịch vụ phát hiện danh sách bất động sản trùng lặp để ngăn chặn các bài đăng dư thừa +- Giới hạn quota subscription với giới hạn tính năng theo gói và đo lường mức sử dụng +- Các chiến lược OAuth backend Google và Zalo cho đăng nhập mạng xã hội +- 58 bài kiểm thử đơn vị bao phủ các đường dẫn auth, payment và subscription quan trọng +- Skeleton loading, error boundary, và cải thiện khả năng truy cập trên web frontend +- Tích hợp theo dõi lỗi Sentry cho cả API và ứng dụng web -### Fixed -- Hardened production Docker deployment configuration for all services +### Đã sửa +- Tăng cường cấu hình triển khai Docker production cho tất cả các dịch vụ --- ## [1.0.0] - 2026-03-01 -### Added +### Đã thêm -#### Authentication & Security -- User registration and login with phone number and password -- JWT access tokens (15-minute expiry) with refresh token rotation (7-day expiry) -- Token family-based rotation detection to prevent replay attacks -- OAuth social login support (Google, Zalo) -- KYC (Know Your Customer) verification workflow (NONE -> PENDING -> VERIFIED/REJECTED) -- Role-based access control with `@Roles()` decorator (USER, AGENT, ADMIN) -- Rate limiting: 60 req/min default, 10 req/min auth, 20 req/min payment callbacks -- `ThrottlerBehindProxyGuard` for X-Forwarded-For-aware IP tracking -- Helmet security headers, CORS configuration -- Input validation (class-validator) and content sanitization (sanitize-html) -- CSRF protection with double-submit cookie pattern -- PII masking in structured logs (Pino) -- Bcrypt password hashing +#### Xác Thực & Bảo Mật +- Đăng ký và đăng nhập người dùng bằng số điện thoại và mật khẩu +- JWT access token (hết hạn sau 15 phút) với xoay vòng refresh token (hết hạn sau 7 ngày) +- Phát hiện xoay vòng dựa trên token family để ngăn chặn tấn công replay +- Hỗ trợ đăng nhập mạng xã hội OAuth (Google, Zalo) +- Quy trình xác minh KYC (Know Your Customer) (NONE -> PENDING -> VERIFIED/REJECTED) +- Kiểm soát truy cập theo vai trò với decorator `@Roles()` (USER, AGENT, ADMIN) +- Rate limiting: mặc định 60 req/phút, 10 req/phút cho auth, 20 req/phút cho payment callback +- `ThrottlerBehindProxyGuard` để theo dõi IP nhận biết X-Forwarded-For +- Tiêu đề bảo mật Helmet, cấu hình CORS +- Kiểm tra đầu vào (class-validator) và làm sạch nội dung (sanitize-html) +- Bảo vệ CSRF với mẫu double-submit cookie +- Che giấu PII trong structured log (Pino) +- Băm mật khẩu Bcrypt -#### Property Listings -- Full CRUD for property listings with status state machine (DRAFT -> PENDING_REVIEW -> ACTIVE -> RESERVED -> SOLD/RENTED) -- Media upload support (S3/MinIO) with file validation -- AI-assisted moderation scoring via Claude API -- Admin moderation queue with bulk approve/reject -- Quota-gated listing creation tied to subscription plans +#### Danh Sách Bất Động Sản +- CRUD đầy đủ cho danh sách bất động sản với máy trạng thái (DRAFT -> PENDING_REVIEW -> ACTIVE -> RESERVED -> SOLD/RENTED) +- Hỗ trợ tải lên media (S3/MinIO) với kiểm tra tệp +- Chấm điểm kiểm duyệt hỗ trợ bởi AI qua Claude API +- Hàng đợi kiểm duyệt admin với phê duyệt/từ chối hàng loạt +- Tạo danh sách bị giới hạn bởi quota gắn với gói subscription -#### Search & Discovery -- Full-text property search via Typesense with Vietnamese language support -- Geo-spatial search using PostGIS (lat/long + radius queries) -- Faceted filtering by price, property type, bedrooms, district -- Event-driven search index updates (listing approved/updated/sold -> re-index) -- Prefix-based cache invalidation for search results +#### Tìm Kiếm & Khám Phá +- Tìm kiếm bất động sản toàn văn bản qua Typesense với hỗ trợ tiếng Việt +- Tìm kiếm địa lý không gian bằng PostGIS (truy vấn lat/long + bán kính) +- Lọc nhiều mặt theo giá, loại bất động sản, số phòng ngủ, quận huyện +- Cập nhật chỉ mục tìm kiếm theo sự kiện (listing approved/updated/sold -> re-index) +- Xóa cache theo tiền tố cho kết quả tìm kiếm -#### Payments -- Payment processing with VNPay, MoMo, and ZaloPay provider integration -- Idempotent webhook callback handling with signature verification -- Payment refund support -- Atomic status transitions (PENDING -> COMPLETED/FAILED) -- Event emission on payment completion/failure for downstream processing +#### Thanh Toán +- Xử lý thanh toán với tích hợp các nhà cung cấp VNPay, MoMo và ZaloPay +- Xử lý webhook callback idempotent với xác minh chữ ký +- Hỗ trợ hoàn tiền +- Chuyển đổi trạng thái nguyên tử (PENDING -> COMPLETED/FAILED) +- Phát sự kiện khi hoàn thành/thất bại thanh toán cho xử lý downstream -#### Subscriptions & Billing -- Subscription plans with tiered feature flags (JSON columns) -- Usage metering and quota enforcement (Redis-backed) -- Plan upgrades and cancellations -- Billing history tracking -- Event-driven usage tracking (`listing.created` -> meter usage) +#### Subscription & Thanh Toán Định Kỳ +- Các gói subscription với cờ tính năng phân tầng (cột JSON) +- Đo lường mức sử dụng và kiểm tra quota (được hỗ trợ bởi Redis) +- Nâng cấp và hủy gói +- Theo dõi lịch sử thanh toán +- Theo dõi mức sử dụng theo sự kiện (`listing.created` -> đo lường mức sử dụng) -#### Admin Panel -- Dashboard with system-wide statistics -- User management (list, view, ban/unban) -- KYC approval queue with approve/reject actions -- Listing moderation queue with bulk moderation -- Revenue statistics and analytics -- Subscription adjustment for individual users +#### Bảng Điều Khiển Admin +- Dashboard với thống kê toàn hệ thống +- Quản lý người dùng (liệt kê, xem, cấm/bỏ cấm) +- Hàng đợi phê duyệt KYC với hành động phê duyệt/từ chối +- Hàng đợi kiểm duyệt danh sách với kiểm duyệt hàng loạt +- Thống kê doanh thu và analytics +- Điều chỉnh subscription cho người dùng cá nhân -#### Analytics & Market Data -- District-level market reports with PostGIS spatial aggregation -- Price trend analysis by property type and district -- District heatmap data (geo aggregates) -- Market index tracking and updates -- Cache-based report delivery +#### Analytics & Dữ Liệu Thị Trường +- Báo cáo thị trường theo quận huyện với tổng hợp không gian PostGIS +- Phân tích xu hướng giá theo loại bất động sản và quận huyện +- Dữ liệu heatmap quận huyện (tổng hợp địa lý) +- Theo dõi và cập nhật chỉ số thị trường +- Phân phối báo cáo dựa trên cache -#### Notifications -- Multi-channel notification delivery: EMAIL, SMS, PUSH (FCM), IN_APP -- 8 event-driven listeners: welcome email, KYC approval, listing approval/rejection, payment confirmation/failure, subscription expiry, quota exceeded -- Handlebars email templates with Vietnamese localization -- User notification preferences (opt-out per channel/type) +#### Thông Báo +- Gửi thông báo đa kênh: EMAIL, SMS, PUSH (FCM), IN_APP +- 8 listener theo sự kiện: email chào mừng, phê duyệt KYC, phê duyệt/từ chối danh sách, xác nhận/thất bại thanh toán, hết hạn subscription, vượt quota +- Mẫu email Handlebars với bản địa hóa tiếng Việt +- Tùy chọn thông báo người dùng (từ chối nhận theo kênh/loại) -#### Reviews -- Property and agent reviews with 1-5 star ratings -- Review CRUD with target polymorphism (agent or property) -- Average rating calculation per target +#### Đánh Giá +- Đánh giá bất động sản và agent với xếp hạng 1-5 sao +- CRUD đánh giá với tính đa hình đối tượng (agent hoặc bất động sản) +- Tính toán xếp hạng trung bình theo đối tượng -#### MCP (Model Context Protocol) Servers +#### Máy Chủ MCP (Model Context Protocol) - Property Search Server: `search_properties`, `compare_properties`, `get_property_details` - Market Analytics Server: `get_market_report`, `analyze_trends`, `get_price_indices` -- Valuation Server: `estimate_valuation`, `extract_features`, `compare_valuations` (XGBoost via FastAPI) -- HTTP transport controller with `McpRegistryService` +- Valuation Server: `estimate_valuation`, `extract_features`, `compare_valuations` (XGBoost qua FastAPI) +- HTTP transport controller với `McpRegistryService` -#### AI Services -- FastAPI microservice with XGBoost property valuation model -- Claude API-powered content moderation for listing descriptions -- Vietnamese NLP preprocessing with Underthesea +#### Dịch Vụ AI +- Microservice FastAPI với mô hình định giá bất động sản XGBoost +- Kiểm duyệt nội dung mô tả danh sách được hỗ trợ bởi Claude API +- Tiền xử lý NLP tiếng Việt với Underthesea -#### Infrastructure -- PostgreSQL 16 with PostGIS extension (22 models, spatial indexes) -- Redis caching layer for search, analytics, quota, and session data -- Typesense search engine with Vietnamese language support -- Prometheus metrics endpoint with HTTP request duration histograms and error rate counters -- Grafana dashboards auto-provisioned from `monitoring/` directory -- Pino structured JSON logging with correlation IDs -- Prisma ORM with migration system and seed data (Ho Chi Minh City districts/wards, sample properties, subscription plans) +#### Hạ Tầng +- PostgreSQL 16 với extension PostGIS (22 model, chỉ mục không gian) +- Tầng Redis caching cho search, analytics, quota và dữ liệu phiên +- Công cụ tìm kiếm Typesense với hỗ trợ tiếng Việt +- Endpoint Prometheus metrics với histogram thời gian yêu cầu HTTP và bộ đếm tỷ lệ lỗi +- Dashboard Grafana tự động cấu hình từ thư mục `monitoring/` +- Ghi log JSON có cấu trúc Pino với correlation ID +- Prisma ORM với hệ thống migration và dữ liệu seed (quận huyện/phường Thành phố Hồ Chí Minh, bất động sản mẫu, các gói subscription) #### Frontend (Next.js 15) -- App Router with Tailwind CSS and Zustand state management -- Property search page with Mapbox GL map integration -- Listing detail pages with media gallery -- Agent dashboard with KYC, subscription, and payment management -- District heatmap visualization -- Property valuation UI with AVM integration -- Dark mode toggle -- Loading skeletons and error boundaries -- Vietnamese UI text throughout (property types, districts, currency in VND) +- App Router với Tailwind CSS và quản lý trạng thái Zustand +- Trang tìm kiếm bất động sản với tích hợp bản đồ Mapbox GL +- Trang chi tiết danh sách với thư viện media +- Dashboard agent với quản lý KYC, subscription và thanh toán +- Trực quan hóa heatmap quận huyện +- Giao diện định giá bất động sản với tích hợp AVM +- Nút chuyển đổi dark mode +- Skeleton loading và error boundary +- Văn bản giao diện tiếng Việt xuyên suốt (loại bất động sản, quận huyện, tiền tệ theo VND) -#### Developer Experience -- Monorepo with pnpm workspaces and Turborepo -- ESLint with import ordering rules -- Prettier code formatting -- Husky git hooks -- E2E tests with Playwright (14 web test files) -- GitHub Actions CI pipeline (lint -> typecheck -> test -> build) +#### Trải Nghiệm Nhà Phát Triển +- Monorepo với pnpm workspaces và Turborepo +- ESLint với các quy tắc sắp xếp import +- Định dạng code Prettier +- Git hook Husky +- Kiểm thử E2E với Playwright (14 tệp kiểm thử web) +- CI pipeline GitHub Actions (lint -> typecheck -> test -> build) -### Security -- httpOnly cookie-based token storage with CSRF hardening -- Idempotency keys on payment flows with amount validation -- Magic byte file validation for media uploads -- Admin audit logging -- JWT audience/issuer validation -- Production environment variable validation -- Sanitized `.env.example` (no leaked secrets) -- Graceful shutdown hooks for clean process termination +### Bảo Mật +- Lưu trữ token dựa trên cookie httpOnly với tăng cường CSRF +- Khóa idempotency trên các luồng thanh toán với kiểm tra số tiền +- Kiểm tra magic byte cho tệp tải lên media +- Ghi log kiểm tra admin +- Kiểm tra audience/issuer JWT +- Kiểm tra biến môi trường production +- `.env.example` được làm sạch (không rò rỉ bí mật) +- Hook tắt dịch vụ nhẹ nhàng để kết thúc tiến trình sạch [Unreleased]: https://github.com/goodgo/platform-ai/compare/v1.4.0...HEAD [1.4.0]: https://github.com/goodgo/platform-ai/compare/v1.3.0...v1.4.0 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 4fa4aa5..9662554 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,34 +1,34 @@ -# Contributing Guide +# Hướng Dẫn Đóng Góp -## Error Handling Convention +## Quy Ước Xử Lý Lỗi -### Overview +### Tổng Quan -All application-layer error handling uses **domain exceptions** from `@modules/shared/domain/domain-exception`. Never import exception classes from `@nestjs/common` in handlers — use the project's own domain exceptions instead. +Toàn bộ xử lý lỗi ở tầng ứng dụng sử dụng **domain exceptions** từ `@modules/shared/domain/domain-exception`. Không bao giờ import các lớp exception từ `@nestjs/common` trong handlers — hãy dùng domain exceptions của dự án. -The `GlobalExceptionFilter` catches all exceptions and normalizes them into a consistent JSON response with structured error codes. +`GlobalExceptionFilter` bắt tất cả các exception và chuẩn hóa chúng thành một JSON response nhất quán với error codes có cấu trúc. ### Domain Exceptions -| Exception | HTTP Status | When to use | +| Exception | HTTP Status | Khi nào dùng | |---|---|---| -| `NotFoundException(entity, id?)` | 404 | Entity not found in database | -| `ValidationException(message, details?)` | 400 | Invalid input, business rule violation, value object creation failure | -| `ConflictException(message)` | 409 | Duplicate resource, idempotency violation | -| `UnauthorizedException(message?)` | 401 | Invalid/expired credentials or tokens | -| `ForbiddenException(message?)` | 403 | Authenticated but not authorized for the action | +| `NotFoundException(entity, id?)` | 404 | Không tìm thấy entity trong database | +| `ValidationException(message, details?)` | 400 | Dữ liệu đầu vào không hợp lệ, vi phạm business rule, lỗi tạo value object | +| `ConflictException(message)` | 409 | Tài nguyên bị trùng lặp, vi phạm idempotency | +| `UnauthorizedException(message?)` | 401 | Thông tin xác thực hoặc token không hợp lệ/đã hết hạn | +| `ForbiddenException(message?)` | 403 | Đã xác thực nhưng không được phép thực hiện hành động | -Import from: +Import từ: ```typescript import { NotFoundException, ValidationException } from '@modules/shared/domain/domain-exception'; ``` -### Patterns by Layer +### Các Mẫu Theo Từng Tầng #### Command/Query Handlers -Handlers throw domain exceptions directly. No try-catch wrapping needed — the `GlobalExceptionFilter` handles uncaught exceptions. +Handlers ném domain exceptions trực tiếp. Không cần bọc try-catch — `GlobalExceptionFilter` xử lý các exception chưa được bắt. ```typescript // Good: domain exception with entity context @@ -50,11 +50,11 @@ if (subscription.status === 'CANCELLED') { #### Controllers -Controllers are thin delegation layers — they dispatch to the command/query bus and return the result. No error handling needed at the controller level. +Controllers là các tầng ủy quyền mỏng — chúng dispatch tới command/query bus và trả về kết quả. Không cần xử lý lỗi ở tầng controller. #### Domain Services / Value Objects -Use the `Result` pattern from `@modules/shared/domain/result`: +Sử dụng mẫu `Result` từ `@modules/shared/domain/result`: ```typescript static create(value: string): Result { @@ -63,9 +63,9 @@ static create(value: string): Result { } ``` -Handlers consume `Result` by checking `.isErr` and throwing a `ValidationException`. +Handlers sử dụng `Result` bằng cách kiểm tra `.isErr` và ném `ValidationException`. -### What NOT to Do +### Những Điều KHÔNG Nên Làm ```typescript // Bad: NestJS built-in exceptions (missing errorCode in response) @@ -85,8 +85,8 @@ try { // Handlers should unwrap Result and throw on error ``` -### Repository Return Types +### Kiểu Trả Về Của Repository -All repository read methods must return explicitly typed DTOs — never `Promise` or `PaginatedResult`. Define read DTOs in the domain layer alongside the repository interface. +Tất cả các phương thức đọc của repository phải trả về DTOs được định kiểu rõ ràng — không bao giờ dùng `Promise` hoặc `PaginatedResult`. Định nghĩa read DTOs ở tầng domain cùng với interface của repository. -See `listing-read.dto.ts` for the canonical example. +Xem `listing-read.dto.ts` để tham khảo ví dụ chuẩn. diff --git a/README.md b/README.md index 4001061..757a454 100644 --- a/README.md +++ b/README.md @@ -1,23 +1,23 @@ # GoodGo Platform AI -Vietnam's intelligent real estate platform — property search, AI-powered valuation, and end-to-end transaction management. +Nền tảng bất động sản thông minh của Việt Nam — tìm kiếm nhà đất, định giá bằng AI và quản lý giao dịch toàn trình. -## Tech Stack +## Công Nghệ Sử Dụng -| Layer | Technology | +| Tầng | Công nghệ | |-------|-----------| | **Backend** | NestJS 11, TypeScript, Prisma ORM, CQRS | | **Frontend** | Next.js 15, React 18, Tailwind CSS, Zustand | -| **Database** | PostgreSQL 16 + PostGIS 3.4 | -| **Search** | Typesense 27 | +| **Cơ sở dữ liệu** | PostgreSQL 16 + PostGIS 3.4 | +| **Tìm kiếm** | Typesense 27 | | **Cache/Queue** | Redis 7 | | **AI/ML** | FastAPI, XGBoost, Claude API, Underthesea | -| **MCP** | Model Context Protocol servers (property search, valuation, analytics) | -| **Storage** | MinIO (S3-compatible) | -| **Monitoring** | Prometheus, Grafana, Loki + Promtail | -| **Payments** | VNPay, MoMo, ZaloPay | +| **MCP** | Model Context Protocol servers (tìm kiếm nhà đất, định giá, phân tích) | +| **Lưu trữ** | MinIO (tương thích S3) | +| **Giám sát** | Prometheus, Grafana, Loki + Promtail | +| **Thanh toán** | VNPay, MoMo, ZaloPay | -## Architecture Overview +## Tổng Quan Kiến Trúc ``` ┌─────────────┐ ┌──────────────┐ ┌──────────────────┐ @@ -47,7 +47,7 @@ Vietnam's intelligent real estate platform — property search, AI-powered valua └────────────────┘ ``` -## Monorepo Structure +## Cấu Trúc Monorepo ``` goodgo-platform-ai/ @@ -64,15 +64,15 @@ goodgo-platform-ai/ └── docs/ # Developer documentation ``` -## Quick Start +## Khởi Động Nhanh -### Prerequisites +### Yêu Cầu Tiên Quyết - **Docker Engine 24+** & Docker Compose v2 - **Node.js 22 LTS** - **pnpm 10.27+** (`corepack enable && corepack prepare pnpm@latest --activate`) -### Setup +### Cài Đặt ```bash # 1. Clone the repository @@ -103,26 +103,26 @@ pnpm db:seed pnpm dev ``` -The API will be available at `http://localhost:3001/api/v1` and the web app at `http://localhost:3000`. +API sẽ khả dụng tại `http://localhost:3001/api/v1` và ứng dụng web tại `http://localhost:3000`. -> **Swagger UI**: Open `http://localhost:3001/api/v1/docs` for interactive API documentation. +> **Swagger UI**: Mở `http://localhost:3001/api/v1/docs` để xem tài liệu API tương tác. -### Infrastructure Services +### Các Dịch Vụ Hạ Tầng -| Service | Port(s) | Dashboard | +| Dịch vụ | Cổng | Bảng điều khiển | |---------|---------|-----------| | PostgreSQL + PostGIS | 5432 | — | | Redis | 6379 | — | | Typesense | 8108 | `http://localhost:8108/health` | | MinIO | 9000 / 9001 | `http://localhost:9001` (console) | | AI Services (FastAPI) | 8000 | `http://localhost:8000/health` | -| Loki (log aggregation) | 3100 | `http://localhost:3100/ready` | +| Loki (tổng hợp log) | 3100 | `http://localhost:3100/ready` | | Prometheus | 9090 | `http://localhost:9090` | | Grafana | 3002 | `http://localhost:3002` | -## Development +## Phát Triển -### Common Commands +### Các Lệnh Thông Dụng ```bash pnpm dev # Start all apps (API + Web) @@ -133,7 +133,7 @@ pnpm format # Format with Prettier pnpm test # Run unit/integration tests ``` -### Database +### Cơ Sở Dữ Liệu ```bash pnpm db:generate # Regenerate Prisma client @@ -144,7 +144,7 @@ pnpm db:studio # Open Prisma Studio (visual editor) pnpm db:reset # Reset database (destructive) ``` -### E2E Testing +### Kiểm Thử E2E ```bash pnpm test:e2e # Run all E2E tests @@ -153,41 +153,41 @@ pnpm test:e2e:web # Web UI tests only pnpm test:e2e:report # Open HTML test report ``` -## API Modules +## Các Module API -All API routes are prefixed with `/api/v1/`. Each module follows Domain-Driven Design with `presentation/`, `application/`, `domain/`, and `infrastructure/` layers. +Tất cả route API đều có tiền tố `/api/v1/`. Mỗi module tuân theo Domain-Driven Design với các tầng `presentation/`, `application/`, `domain/` và `infrastructure/`. -| Module | Description | +| Module | Mô tả | |--------|-------------| -| **auth** | Registration, login, JWT + refresh token rotation, OAuth (Google/Zalo), KYC, user data export/deletion | -| **listings** | Property listing CRUD, status workflow, media management | -| **search** | Typesense full-text search with geo-spatial filters, saved searches | -| **payments** | VNPay, MoMo, ZaloPay integration with callback verification | -| **subscriptions** | Plan management, usage tracking, quota enforcement | -| **notifications** | Email and in-app notification history & preferences | -| **admin** | Listing moderation, user management, audit logs | -| **analytics** | Market reports, price indices, AVM integration | -| **agents** | Real estate agent profiles and verification | -| **inquiries** | Property inquiry management | -| **leads** | Lead tracking and conversion | -| **reviews** | Property reviews and ratings | -| **health** | Liveness and readiness health checks | -| **mcp** | MCP server bridge (property search, valuation, analytics) | -| **metrics** | Prometheus metrics and web vitals collection | -| **shared** | Cross-cutting concerns: guards, pipes, filters, Prisma/Redis services | +| **auth** | Đăng ký, đăng nhập, xoay vòng JWT + refresh token, OAuth (Google/Zalo), KYC, xuất/xoá dữ liệu người dùng | +| **listings** | CRUD tin đăng nhà đất, quy trình trạng thái, quản lý tệp phương tiện | +| **search** | Tìm kiếm toàn văn bản Typesense kết hợp bộ lọc địa lý, lưu tìm kiếm | +| **payments** | Tích hợp VNPay, MoMo, ZaloPay kèm xác thực callback | +| **subscriptions** | Quản lý gói dịch vụ, theo dõi mức sử dụng, kiểm soát hạn mức | +| **notifications** | Lịch sử thông báo qua email và trong ứng dụng cùng tuỳ chọn cá nhân | +| **admin** | Kiểm duyệt tin đăng, quản lý người dùng, nhật ký kiểm tra | +| **analytics** | Báo cáo thị trường, chỉ số giá, tích hợp AVM | +| **agents** | Hồ sơ và xác minh môi giới bất động sản | +| **inquiries** | Quản lý yêu cầu tư vấn nhà đất | +| **leads** | Theo dõi và chuyển đổi khách hàng tiềm năng | +| **reviews** | Đánh giá và xếp hạng bất động sản | +| **health** | Kiểm tra liveness và readiness | +| **mcp** | Cầu nối MCP server (tìm kiếm nhà đất, định giá, phân tích) | +| **metrics** | Thu thập metrics Prometheus và web vitals | +| **shared** | Mối quan tâm chung: guards, pipes, filters, dịch vụ Prisma/Redis | -## Documentation +## Tài Liệu -| Document | Description | +| Tài liệu | Mô tả | |----------|-------------| -| [Development Environment](docs/dev-environment.md) | Docker setup and local services | -| [Architecture](docs/architecture.md) | System design, data flow, module structure | -| [API Endpoints](docs/api-endpoints.md) | REST API endpoint reference | -| [API Error Codes](docs/api-error-codes.md) | Error response format and all error codes | -| [Deployment](docs/deployment.md) | Production deployment guide | -| [Backup & Restore](docs/backup-restore.md) | Backup procedures and disaster recovery | -| [Contributing](CONTRIBUTING.md) | Error handling conventions and coding patterns | +| [Môi trường phát triển](docs/dev-environment.md) | Cài đặt Docker và các dịch vụ cục bộ | +| [Kiến trúc](docs/architecture.md) | Thiết kế hệ thống, luồng dữ liệu, cấu trúc module | +| [API Endpoints](docs/api-endpoints.md) | Tài liệu tham khảo REST API endpoint | +| [Mã lỗi API](docs/api-error-codes.md) | Định dạng phản hồi lỗi và toàn bộ mã lỗi | +| [Triển khai](docs/deployment.md) | Hướng dẫn triển khai môi trường sản xuất | +| [Sao lưu & Khôi phục](docs/backup-restore.md) | Quy trình sao lưu và khôi phục sau sự cố | +| [Đóng góp](CONTRIBUTING.md) | Quy ước xử lý lỗi và các mẫu lập trình | -## License +## Giấy Phép -Proprietary — All rights reserved. +Độc quyền — Bảo lưu mọi quyền. diff --git a/docs/PRODUCTION_READINESS_ASSESSMENT.md b/docs/PRODUCTION_READINESS_ASSESSMENT.md index 47f0ee7..cf9093a 100644 --- a/docs/PRODUCTION_READINESS_ASSESSMENT.md +++ b/docs/PRODUCTION_READINESS_ASSESSMENT.md @@ -1,185 +1,185 @@ -# GoodGo Platform AI — Production Readiness Assessment -**Date:** April 12, 2026 -**Project Location:** `/Users/velikho/Desktop/WORKING/goodgo-platform-ai/` +# GoodGo Platform AI — Đánh Giá Mức Độ Sẵn Sàng Cho Môi Trường Production +**Ngày:** 12 tháng 4 năm 2026 +**Vị trí dự án:** `/Users/velikho/Desktop/WORKING/goodgo-platform-ai/` --- -## Executive Summary +## Tóm Tắt Điều Hành -The GoodGo Platform AI project has **MODERATE production readiness**. Core infrastructure (CI/CD, monitoring, backup/restore) is well-documented and partially implemented. However, several critical production items are **incomplete or untested in production**. +Dự án GoodGo Platform AI có **mức độ sẵn sàng production TRUNG BÌNH**. Hạ tầng cốt lõi (CI/CD, giám sát, sao lưu/phục hồi) được ghi chép đầy đủ và triển khai một phần. Tuy nhiên, một số hạng mục production quan trọng còn **chưa hoàn chỉnh hoặc chưa được kiểm thử trên môi trường production**. -**Key Gaps:** -- SSL/TLS and DNS configuration not deployed (templates only) -- Penetration testing/security audit not completed -- CDN setup for static assets not configured -- E2E test results show failures -- Performance benchmarks only at framework level (not business logic) +**Các điểm thiếu hụt chính:** +- Cấu hình SSL/TLS và DNS chưa được triển khai (chỉ có template) +- Kiểm thử xâm nhập/kiểm toán bảo mật chưa hoàn thành +- Thiết lập CDN cho tài nguyên tĩnh chưa được cấu hình +- Kết quả kiểm thử E2E cho thấy có lỗi +- Đo hiệu năng chỉ ở mức framework (chưa có logic nghiệp vụ) --- -## Detailed Assessment: 12 Items +## Đánh Giá Chi Tiết: 12 Hạng Mục -### ✅ **1. Load Testing Results** — MODERATE -**Status:** Scripts exist with baseline results documented -**Evidence:** -- **Path:** `/load-tests/` directory - - `scripts/` contains K6 test files: `auth.js`, `listings.js`, `search.js`, `search-advanced.js`, `admin.js`, `mcp.js`, `payments.js` - - `results/BASELINE-REPORT.md` — comprehensive baseline report dated 2026-04-09 - - `results/` contains JSON output files: `auth.json`, `listings.json`, `search.json`, `payments.json` +### ✅ **1. Kết Quả Kiểm Thử Tải** — TRUNG BÌNH +**Trạng thái:** Các script tồn tại với kết quả baseline đã được ghi chép +**Bằng chứng:** +- **Đường dẫn:** Thư mục `/load-tests/` + - `scripts/` chứa các file kiểm thử K6: `auth.js`, `listings.js`, `search.js`, `search-advanced.js`, `admin.js`, `mcp.js`, `payments.js` + - `results/BASELINE-REPORT.md` — báo cáo baseline toàn diện ngày 09/04/2026 + - `results/` chứa các file kết quả JSON: `auth.json`, `listings.json`, `search.json`, `payments.json` -**What Exists:** -- ✅ K6 load test suite with 7 test scripts -- ✅ SLA thresholds defined (p50 < 200ms, p95 < 500ms, p99 < 1s, error rate < 1%) -- ✅ Baseline results documented with detailed metrics -- ✅ CI integration via `.github/workflows/load-test.yml` +**Những gì đã có:** +- ✅ Bộ kiểm thử tải K6 với 7 script kiểm thử +- ✅ Ngưỡng SLA được xác định (p50 < 200ms, p95 < 500ms, p99 < 1s, tỷ lệ lỗi < 1%) +- ✅ Kết quả baseline được ghi chép với số liệu chi tiết +- ✅ Tích hợp CI qua `.github/workflows/load-test.yml` -**What's Missing:** -- ❌ Production environment test results (only local dev baseline) -- ❌ Performance regression tracking (should be CI gated) -- ❌ Historical trend data (no time-series analysis) -- ❌ Grafana/InfluxDB integration for visualization +**Những gì còn thiếu:** +- ❌ Kết quả kiểm thử trên môi trường production (chỉ có baseline trên môi trường dev cục bộ) +- ❌ Theo dõi hiệu năng hồi quy (nên được kiểm soát bởi CI) +- ❌ Dữ liệu xu hướng lịch sử (không có phân tích chuỗi thời gian) +- ❌ Tích hợp Grafana/InfluxDB để trực quan hóa -**Status Notes:** -Baseline shows framework-level performance is excellent (p95 latencies < 6ms), but business logic validation blocked by dev environment limitations. Auth and payment endpoints return 500 errors; Typesense unavailable. Recommends re-running against staging with full dependencies. +**Ghi chú trạng thái:** +Baseline cho thấy hiệu năng ở mức framework là xuất sắc (độ trễ p95 < 6ms), nhưng việc xác thực logic nghiệp vụ bị chặn do giới hạn của môi trường dev. Các endpoint xác thực và thanh toán trả về lỗi 500; Typesense không khả dụng. Khuyến nghị chạy lại trên môi trường staging với đầy đủ các dependency. --- -### ❌ **2. Security Penetration Test Sign-Off** — MISSING -**Status:** No formal penetration test or security audit sign-off found -**Evidence:** -- **Path:** `/docs/audits/` contains accessibility and architecture audits, but NO security/penetration testing -- **CI Security:** `.github/workflows/security.yml` exists with: - - Dependency audit (pnpm) - - Container scanning (Trivy) - - CodeQL SAST analysis - - No DAST/pen-test integration +### ❌ **2. Xác Nhận Kiểm Thử Xâm Nhập Bảo Mật** — THIẾU +**Trạng thái:** Không tìm thấy kiểm thử xâm nhập chính thức hoặc xác nhận kiểm toán bảo mật +**Bằng chứng:** +- **Đường dẫn:** `/docs/audits/` chứa kiểm toán khả năng tiếp cận và kiến trúc, nhưng KHÔNG có kiểm thử bảo mật/xâm nhập +- **Bảo mật CI:** `.github/workflows/security.yml` tồn tại với: + - Kiểm toán dependency (pnpm) + - Quét container (Trivy) + - Phân tích SAST bằng CodeQL + - Không có tích hợp DAST/kiểm thử xâm nhập -**What Exists:** -- ✅ Automated dependency vulnerability scanning (pnpm audit, runs on schedule) -- ✅ Container image scanning (Trivy) for API, Web, AI-services images -- ✅ Code scanning (CodeQL) for source code vulnerabilities -- ✅ Security checklist in `docs/deployment.md` (incomplete) +**Những gì đã có:** +- ✅ Quét lỗ hổng dependency tự động (pnpm audit, chạy theo lịch) +- ✅ Quét image container (Trivy) cho các image API, Web, AI-services +- ✅ Quét mã nguồn (CodeQL) tìm lỗ hổng trong mã nguồn +- ✅ Danh sách kiểm tra bảo mật trong `docs/deployment.md` (chưa hoàn chỉnh) -**What's Missing:** -- ❌ Third-party penetration test report -- ❌ OWASP Top 10 assessment -- ❌ Security audit sign-off document -- ❌ API security testing (DAST) -- ❌ Web application security scan -- ❌ Infrastructure security audit +**Những gì còn thiếu:** +- ❌ Báo cáo kiểm thử xâm nhập từ bên thứ ba +- ❌ Đánh giá OWASP Top 10 +- ❌ Tài liệu xác nhận kiểm toán bảo mật +- ❌ Kiểm thử bảo mật API (DAST) +- ❌ Quét bảo mật ứng dụng web +- ❌ Kiểm toán bảo mật hạ tầng -**Recommendation:** Schedule formal pen-test before production launch. +**Khuyến nghị:** Lên lịch kiểm thử xâm nhập chính thức trước khi ra mắt production. --- -### ✅ **3. Monitoring Alert Thresholds Configured** — GOOD -**Status:** Comprehensive alert rules defined and configured -**Evidence:** -- **Path:** `/monitoring/prometheus/alert-rules.yml` (15,969 bytes) - - Alert groups defined: `goodgo_api_latency`, `goodgo_database`, `goodgo_redis`, `goodgo_infra` - - Per-rule thresholds with severity labels - - Dashboard links and runbook URLs embedded +### ✅ **3. Cấu Hình Ngưỡng Cảnh Báo Giám Sát** — TỐT +**Trạng thái:** Các quy tắc cảnh báo toàn diện đã được xác định và cấu hình +**Bằng chứng:** +- **Đường dẫn:** `/monitoring/prometheus/alert-rules.yml` (15.969 byte) + - Các nhóm cảnh báo được xác định: `goodgo_api_latency`, `goodgo_database`, `goodgo_redis`, `goodgo_infra` + - Ngưỡng theo từng quy tắc với nhãn mức độ nghiêm trọng + - Đường dẫn dashboard và URL runbook được nhúng vào -**Specific Alerts Configured:** -- API latency: p99 > 1s (warning), > 3s (critical) -- Per-endpoint latency: p99 > 2s -- 5xx error rate: > 1% for 5 minutes -- Database: connection pool exhaustion, high query latency -- Redis: connection failures, high memory -- Infrastructure: disk space, CPU, memory alerts +**Các cảnh báo cụ thể đã cấu hình:** +- Độ trễ API: p99 > 1s (cảnh báo), > 3s (nghiêm trọng) +- Độ trễ theo từng endpoint: p99 > 2s +- Tỷ lệ lỗi 5xx: > 1% trong 5 phút +- Cơ sở dữ liệu: cạn kiệt connection pool, độ trễ truy vấn cao +- Redis: lỗi kết nối, bộ nhớ cao +- Hạ tầng: dung lượng đĩa, CPU, cảnh báo bộ nhớ -**What Exists:** -- ✅ 15+ alerting rules across API, database, cache, infrastructure -- ✅ Alert severity labels (warning, critical) -- ✅ Runbook URLs and dashboard links in annotations -- ✅ AlertManager configured (`monitoring/alertmanager/alertmanager.yml`) -- ✅ Prometheus scraping configured (`monitoring/prometheus/prometheus.yml`) -- ✅ Grafana provisioned with datasources +**Những gì đã có:** +- ✅ Hơn 15 quy tắc cảnh báo cho API, cơ sở dữ liệu, cache, hạ tầng +- ✅ Nhãn mức độ nghiêm trọng cảnh báo (warning, critical) +- ✅ URL runbook và đường dẫn dashboard trong phần annotation +- ✅ AlertManager được cấu hình (`monitoring/alertmanager/alertmanager.yml`) +- ✅ Scraping Prometheus được cấu hình (`monitoring/prometheus/prometheus.yml`) +- ✅ Grafana được cung cấp cùng datasource -**What's Missing:** -- ❌ Alert routing/notification channels not visible (Slack, PagerDuty, email) — likely in secrets -- ❌ No baseline testing of alert triggers -- ❌ No alert tuning documentation (what thresholds are based on) +**Những gì còn thiếu:** +- ❌ Các kênh định tuyến/thông báo cảnh báo chưa hiển thị (Slack, PagerDuty, email) — có thể nằm trong secrets +- ❌ Chưa có kiểm thử baseline cho các trigger cảnh báo +- ❌ Chưa có tài liệu tinh chỉnh cảnh báo (cơ sở để thiết lập ngưỡng) --- -### ✅ **4. Backup/Restore Verification** — GOOD -**Status:** Backup procedures documented; automated verification in place -**Evidence:** -- **Path:** `/docs/backup-restore.md` (comprehensive guide, 251 lines) -- **Path:** `.github/workflows/backup-verify.yml` (automated weekly verification) +### ✅ **4. Xác Minh Sao Lưu/Phục Hồi** — TỐT +**Trạng thái:** Quy trình sao lưu đã được ghi chép; xác minh tự động đang được thực hiện +**Bằng chứng:** +- **Đường dẫn:** `/docs/backup-restore.md` (hướng dẫn toàn diện, 251 dòng) +- **Đường dẫn:** `.github/workflows/backup-verify.yml` (xác minh tự động hàng tuần) -**Backup Strategy:** -- PostgreSQL: Daily at 02:00 UTC via `pg-backup` container (`pg_dump` custom format, compression level 6) -- Redis: AOF persistence + optional RDB snapshots -- Typesense: Built-in snapshot API + volume backup -- Retention: 7 days (default) -- RTO: ~15 min (local backup), ~30 min (off-site) -- RPO: ≤ 24 hours +**Chiến lược sao lưu:** +- PostgreSQL: Hàng ngày lúc 02:00 UTC qua container `pg-backup` (định dạng tùy chỉnh `pg_dump`, mức nén 6) +- Redis: Persistence AOF + snapshot RDB tùy chọn +- Typesense: API snapshot tích hợp sẵn + sao lưu volume +- Lưu giữ: 7 ngày (mặc định) +- RTO: ~15 phút (sao lưu cục bộ), ~30 phút (ngoài site) +- RPO: ≤ 24 giờ -**What Exists:** -- ✅ Automated backup procedures (cron-based in docker-compose.prod.yml) -- ✅ Restore procedures documented with step-by-step instructions -- ✅ Disaster recovery runbook (4 scenarios: DB failure, service crash, full host, data corruption) -- ✅ Backup verification workflow (GitHub Actions, runs weekly) -- ✅ Backup integrity checks (`pg_restore --list`) -- ✅ All three data stores covered (PostgreSQL, Redis, Typesense) +**Những gì đã có:** +- ✅ Quy trình sao lưu tự động (dựa trên cron trong docker-compose.prod.yml) +- ✅ Quy trình phục hồi được ghi chép với hướng dẫn từng bước +- ✅ Runbook khắc phục thảm họa (4 kịch bản: lỗi DB, crash service, hỏng toàn máy chủ, hỏng dữ liệu) +- ✅ Quy trình xác minh sao lưu (GitHub Actions, chạy hàng tuần) +- ✅ Kiểm tra tính toàn vẹn sao lưu (`pg_restore --list`) +- ✅ Bao gồm cả ba kho dữ liệu (PostgreSQL, Redis, Typesense) -**What's Missing:** -- ⚠️ Off-site backup storage not documented (where backups are sent) -- ❌ No tested restore from off-site backup -- ❌ No documented backup retention policy for off-site storage -- ⚠️ WAL archiving for point-in-time recovery not mentioned +**Những gì còn thiếu:** +- ⚠️ Bộ nhớ sao lưu ngoài site chưa được ghi chép (nơi sao lưu được gửi đến) +- ❌ Chưa có kiểm thử phục hồi từ sao lưu ngoài site +- ❌ Chưa có chính sách lưu giữ sao lưu cho bộ nhớ ngoài site +- ⚠️ Lưu trữ WAL cho phục hồi tại thời điểm cụ thể chưa được đề cập --- -### ✅ **5. Incident Response Runbook** — GOOD -**Status:** Comprehensive runbook exists -**Evidence:** -- **Path:** `/docs/RUNBOOK.md` (41,441 bytes, last updated 2026-04-11) +### ✅ **5. Runbook Ứng Phó Sự Cố** — TỐT +**Trạng thái:** Runbook toàn diện đã tồn tại +**Bằng chứng:** +- **Đường dẫn:** `/docs/RUNBOOK.md` (41.441 byte, cập nhật lần cuối 11/04/2026) -**Runbook Contents:** -1. Service Inventory (17 services listed with resource limits, health checks) -2. Health Checks (application endpoints, verification procedures) -3. Common Incidents (10 scenarios): - - 3.1: Database connection pool exhaustion - - 3.2: Redis connection failure - - 3.3: Typesense unavailable - - 3.4: High API latency - - 3.5: Payment callback failures - - 3.6: Disk space alerts - - 3.7: MinIO / Object storage failure - - 3.8: AI services unavailable - - 3.9: Log pipeline failure - - 3.10: 5xx error rate spike -4. Recovery Procedures (5 detailed procedures) -5. Escalation Matrix -6. Monitoring Dashboards -7. Useful PromQL Queries -8. Environment Quick Reference +**Nội dung Runbook:** +1. Bảng kiểm kê dịch vụ (17 dịch vụ được liệt kê với giới hạn tài nguyên, health check) +2. Health Check (các endpoint ứng dụng, quy trình xác minh) +3. Sự cố thường gặp (10 kịch bản): + - 3.1: Cạn kiệt connection pool cơ sở dữ liệu + - 3.2: Lỗi kết nối Redis + - 3.3: Typesense không khả dụng + - 3.4: Độ trễ API cao + - 3.5: Lỗi callback thanh toán + - 3.6: Cảnh báo dung lượng đĩa + - 3.7: Lỗi MinIO / Object storage + - 3.8: Dịch vụ AI không khả dụng + - 3.9: Lỗi pipeline log + - 3.10: Đột biến tỷ lệ lỗi 5xx +4. Quy trình phục hồi (5 quy trình chi tiết) +5. Ma trận leo thang +6. Dashboard giám sát +7. Các truy vấn PromQL hữu ích +8. Tài liệu tham khảo nhanh về môi trường -**What Exists:** -- ✅ Complete incident response procedures (10+ scenarios) -- ✅ Step-by-step recovery procedures -- ✅ Health check commands -- ✅ Service dependency diagram -- ✅ Escalation contacts and matrix -- ✅ PromQL query examples for troubleshooting +**Những gì đã có:** +- ✅ Quy trình ứng phó sự cố đầy đủ (hơn 10 kịch bản) +- ✅ Quy trình phục hồi từng bước +- ✅ Lệnh kiểm tra health +- ✅ Sơ đồ phụ thuộc dịch vụ +- ✅ Danh bạ và ma trận leo thang +- ✅ Ví dụ truy vấn PromQL để xử lý sự cố -**What's Missing:** -- ⚠️ Escalation matrix not fully visible (contact numbers/Slack channels likely redacted) -- ❌ No incident log/post-mortem template -- ❌ No tested drills/runbook exercises +**Những gì còn thiếu:** +- ⚠️ Ma trận leo thang chưa hiển thị đầy đủ (số điện thoại/kênh Slack có thể đã được ẩn) +- ❌ Chưa có mẫu nhật ký sự cố/post-mortem +- ❌ Chưa có các buổi diễn tập/thực hành runbook --- -### ✅ **6. Database Schema Frozen (Migration Lockdown)** — GOOD (Partial) -**Status:** Migrations exist and organized; migration locking mechanism in place -**Evidence:** -- **Path:** `/prisma/migrations/` (16 migration directories) -- **Path:** `/prisma/migrations/migration_lock.toml` +### ✅ **6. Đóng Băng Schema Cơ Sở Dữ Liệu (Khóa Migration)** — TỐT (Một Phần) +**Trạng thái:** Migration đã tồn tại và được tổ chức; cơ chế khóa migration đang hoạt động +**Bằng chứng:** +- **Đường dẫn:** `/prisma/migrations/` (16 thư mục migration) +- **Đường dẫn:** `/prisma/migrations/migration_lock.toml` -**Migrations:** +**Các Migration:** ``` 20260407165528_init 20260407210149_add_missing_fk_indexes @@ -194,292 +194,292 @@ Baseline shows framework-level performance is excellent (p95 latencies < 6ms), b 20260410100000_add_admin_audit_log 20260411000000_add_cascade_delete_strategies 20260411100000_add_pii_encryption_hash_columns -20260411200000_add_mfa_totp_support (most recent) +20260411200000_add_mfa_totp_support (gần nhất) ``` -**What Exists:** -- ✅ Migration lock file (`migration_lock.toml`) — prevents provider changes -- ✅ 16 sequential migrations from 2026-04-07 to 2026-04-11 (recent activity) -- ✅ CI integration: `pnpm db:migrate:deploy` in GitHub Actions (read-only) -- ✅ Direct database connection separate from PgBouncer (required for DDL) +**Những gì đã có:** +- ✅ File khóa migration (`migration_lock.toml`) — ngăn thay đổi provider +- ✅ 16 migration tuần tự từ 07/04/2026 đến 11/04/2026 (hoạt động gần đây) +- ✅ Tích hợp CI: `pnpm db:migrate:deploy` trong GitHub Actions (chỉ đọc) +- ✅ Kết nối cơ sở dữ liệu trực tiếp tách biệt với PgBouncer (bắt buộc cho DDL) -**What's Missing:** -- ⚠️ No documented freeze procedure (how to prevent migrations in production lockdown) -- ❌ No "production schema freeze" documentation -- ❌ No tested rollback procedures +**Những gì còn thiếu:** +- ⚠️ Chưa có quy trình đóng băng được ghi chép (cách ngăn migration trong giai đoạn khóa production) +- ❌ Chưa có tài liệu "đóng băng schema production" +- ❌ Chưa có quy trình rollback được kiểm thử -**Status Notes:** -Schema is currently NOT frozen — migrations are active. Recent migrations added encryption, MFA, audit logging. For true production lockdown, would need explicit "no migrations" policy + CI enforcement. +**Ghi chú trạng thái:** +Schema hiện CHƯA bị đóng băng — migration vẫn đang hoạt động. Các migration gần đây đã thêm mã hóa, MFA, ghi nhật ký kiểm toán. Để thực sự khóa production, cần có chính sách "không migration trong production" rõ ràng + thực thi qua CI. --- -### ✅ **7. CI/CD Pipeline** — GOOD -**Status:** Comprehensive CI/CD pipeline configured -**Evidence:** -- **Path:** `.github/workflows/` (9 workflow files) +### ✅ **7. Pipeline CI/CD** — TỐT +**Trạng thái:** Pipeline CI/CD toàn diện đã được cấu hình +**Bằng chứng:** +- **Đường dẫn:** `.github/workflows/` (9 file workflow) -**Workflows:** -1. **ci.yml** — Main CI: Lint → Typecheck → Test → Build → E2E (on ubuntu-latest, Node 22) - - Services: PostgreSQL (postgis:16-3.4), Redis, Typesense, MinIO - - Steps: pnpm install → lint → typecheck → test → build → e2e - - E2E uploads Playwright reports as artifacts +**Các Workflow:** +1. **ci.yml** — CI chính: Lint → Typecheck → Test → Build → E2E (trên ubuntu-latest, Node 22) + - Dịch vụ: PostgreSQL (postgis:16-3.4), Redis, Typesense, MinIO + - Các bước: pnpm install → lint → typecheck → test → build → e2e + - E2E tải lên báo cáo Playwright dưới dạng artifact -2. **e2e.yml** — Separate E2E workflow (deprecated, ci.yml combines) - - API + Web E2E tests - - Artifact uploads +2. **e2e.yml** — Workflow E2E riêng (đã lỗi thời, ci.yml đã gộp lại) + - Kiểm thử E2E cho API + Web + - Tải lên artifact -3. **deploy.yml** — Deployment pipeline - - Build & push Docker images to GHCR - - Deploy to staging/production (structure visible) +3. **deploy.yml** — Pipeline triển khai + - Build & push Docker image lên GHCR + - Triển khai lên staging/production (cấu trúc hiển thị) -4. **load-test.yml** — K6 load testing - - Manual trigger (workflow_dispatch) - - Runs against custom API URL +4. **load-test.yml** — Kiểm thử tải K6 + - Kích hoạt thủ công (workflow_dispatch) + - Chạy với URL API tùy chỉnh -5. **security.yml** — Security scanning - - Dependency audit (pnpm) - - Container scanning (Trivy) for API, Web, AI-services - - CodeQL SAST analysis - - Runs on push, PR, and daily schedule (05:43 UTC) +5. **security.yml** — Quét bảo mật + - Kiểm toán dependency (pnpm) + - Quét container (Trivy) cho API, Web, AI-services + - Phân tích SAST bằng CodeQL + - Chạy khi push, PR và theo lịch hàng ngày (05:43 UTC) -6. **backup-verify.yml** — Automated backup verification - - Weekly schedule (Sundays 05:00 UTC) - - Manual trigger - - Creates backup and runs verification script +6. **backup-verify.yml** — Xác minh sao lưu tự động + - Lịch hàng tuần (Chủ nhật 05:00 UTC) + - Kích hoạt thủ công + - Tạo sao lưu và chạy script xác minh -7. **codeql.yml** — CodeQL analysis (standard template) +7. **codeql.yml** — Phân tích CodeQL (template chuẩn) -**What Exists:** -- ✅ Full CI pipeline: lint, typecheck, test, build -- ✅ E2E testing in CI with artifact uploads -- ✅ Separate security scanning workflow -- ✅ Load testing workflow (manual trigger) -- ✅ Backup verification workflow (weekly) -- ✅ Docker image building and pushing to GHCR -- ✅ Concurrency controls to prevent duplicate runs -- ✅ Service health checks (PostgreSQL, Redis, Typesense, MinIO) +**Những gì đã có:** +- ✅ Pipeline CI đầy đủ: lint, typecheck, test, build +- ✅ Kiểm thử E2E trong CI với tải lên artifact +- ✅ Workflow quét bảo mật riêng biệt +- ✅ Workflow kiểm thử tải (kích hoạt thủ công) +- ✅ Workflow xác minh sao lưu (hàng tuần) +- ✅ Build và push Docker image lên GHCR +- ✅ Kiểm soát đồng thời để tránh chạy trùng lặp +- ✅ Kiểm tra health cho dịch vụ (PostgreSQL, Redis, Typesense, MinIO) -**What's Missing:** -- ❌ No visible CD (continuous deployment) stage — deploy.yml exists but configuration unclear -- ⚠️ No SLA gating in CI (e.g., fail if p95 latency > 500ms) -- ❌ No integration tests between services -- ❌ No performance regression testing in CI +**Những gì còn thiếu:** +- ❌ Chưa thấy giai đoạn CD (triển khai liên tục) — deploy.yml tồn tại nhưng cấu hình chưa rõ ràng +- ⚠️ Không có kiểm soát SLA trong CI (ví dụ: thất bại nếu p95 độ trễ > 500ms) +- ❌ Không có kiểm thử tích hợp giữa các dịch vụ +- ❌ Không có kiểm thử hồi quy hiệu năng trong CI --- -### ⚠️ **8. E2E Test Results** — MODERATE -**Status:** Test suite exists; recent results show failures -**Evidence:** -- **Path:** `/e2e/` directory (comprehensive E2E test suite) - - API tests: 16 spec files (auth, listings, search, payments, admin, etc.) - - Web tests: 17 spec files (UI scenarios) - - Fixtures and global setup/teardown +### ⚠️ **8. Kết Quả Kiểm Thử E2E** — TRUNG BÌNH +**Trạng thái:** Bộ kiểm thử đã tồn tại; kết quả gần đây cho thấy có lỗi +**Bằng chứng:** +- **Đường dẫn:** Thư mục `/e2e/` (bộ kiểm thử E2E toàn diện) + - Kiểm thử API: 16 file spec (auth, listings, search, payments, admin, v.v.) + - Kiểm thử Web: 17 file spec (các kịch bản UI) + - Fixture và setup/teardown toàn cục -**Test Files:** +**Các File Kiểm Thử:** - `/e2e/api/admin.spec.ts`, `auth-*.spec.ts`, `inquiries.spec.ts`, `listings*.spec.ts`, `mcp.spec.ts`, `payments*.spec.ts`, `search.spec.ts`, `subscriptions.spec.ts` -- `/e2e/web/` — Playwright web UI tests +- `/e2e/web/` — Kiểm thử UI web bằng Playwright -**Recent Results:** -- **Report:** `playwright-report/` (generated 2026-04-11 21:46) -- **Status:** FAILED (`.last-run.json` shows 2 failed tests) -- **Failed Tests:** +**Kết Quả Gần Đây:** +- **Báo cáo:** `playwright-report/` (tạo ngày 11/04/2026 lúc 21:46) +- **Trạng thái:** THẤT BẠI (`.last-run.json` cho thấy 2 kiểm thử thất bại) +- **Các kiểm thử thất bại:** - `72b40b5065e5b60fb5e0-af881f611f09a33bace0` - `72b40b5065e5b60fb5e0-dbc0ed94115981ddb54c` -**What Exists:** -- ✅ Comprehensive E2E test suite (33+ spec files) -- ✅ Playwright HTML report generated -- ✅ Global fixtures (user creation, database seeding) -- ✅ CI integration (runs after unit tests pass) -- ✅ Artifact uploads (reports retained 14 days, traces 7 days) -- ✅ playwright.config.ts configured +**Những gì đã có:** +- ✅ Bộ kiểm thử E2E toàn diện (hơn 33 file spec) +- ✅ Báo cáo HTML Playwright được tạo +- ✅ Fixture toàn cục (tạo người dùng, seed cơ sở dữ liệu) +- ✅ Tích hợp CI (chạy sau khi kiểm thử đơn vị vượt qua) +- ✅ Tải lên artifact (báo cáo lưu 14 ngày, trace lưu 7 ngày) +- ✅ playwright.config.ts đã được cấu hình -**What's Missing:** -- ❌ Test failure details not documented (need to inspect report) -- ❌ Flaky test analysis -- ❌ Test coverage metrics -- ❌ SLA validation in E2E tests +**Những gì còn thiếu:** +- ❌ Chi tiết lỗi kiểm thử chưa được ghi chép (cần kiểm tra báo cáo) +- ❌ Phân tích kiểm thử không ổn định (flaky test) +- ❌ Số liệu độ phủ kiểm thử +- ❌ Xác thực SLA trong kiểm thử E2E -**Status Notes:** -E2E tests are comprehensive but currently failing. Not production-ready until failures are resolved. +**Ghi chú trạng thái:** +Kiểm thử E2E toàn diện nhưng hiện đang thất bại. Chưa sẵn sàng cho production cho đến khi các lỗi được giải quyết. --- -### ❌ **9. Performance Benchmarks Documented** — MISSING -**Status:** Only framework-level baseline; no business logic benchmarks -**Evidence:** -- **Path:** `/load-tests/results/BASELINE-REPORT.md` (only baseline) -- **Path:** No dedicated performance benchmark documentation +### ❌ **9. Tài Liệu Đo Hiệu Năng** — THIẾU +**Trạng thái:** Chỉ có baseline ở mức framework; không có đo hiệu năng cho logic nghiệp vụ +**Bằng chứng:** +- **Đường dẫn:** `/load-tests/results/BASELINE-REPORT.md` (chỉ có baseline) +- **Đường dẫn:** Không có tài liệu đo hiệu năng chuyên dụng -**What Exists:** -- ✅ K6 baseline report with latency metrics (p50, p95, p99) -- ✅ Throughput metrics (RPS) -- ✅ SLA thresholds defined in load-tests/lib/config.js +**Những gì đã có:** +- ✅ Báo cáo baseline K6 với số liệu độ trễ (p50, p95, p99) +- ✅ Số liệu thông lượng (RPS) +- ✅ Ngưỡng SLA được xác định trong load-tests/lib/config.js -**What's Missing:** -- ❌ No documented performance baseline for production (only local dev) -- ❌ No per-endpoint performance targets -- ❌ No database query performance benchmarks -- ❌ No API response time budgets -- ❌ No historical performance tracking -- ❌ No performance regression detection +**Những gì còn thiếu:** +- ❌ Không có baseline hiệu năng đã ghi chép cho production (chỉ có môi trường dev cục bộ) +- ❌ Không có mục tiêu hiệu năng theo từng endpoint +- ❌ Không có đo hiệu năng truy vấn cơ sở dữ liệu +- ❌ Không có ngân sách thời gian phản hồi API +- ❌ Không có theo dõi hiệu năng lịch sử +- ❌ Không có phát hiện hồi quy hiệu năng -**Status Notes:** -Load tests blocked by database/dependency issues. Framework responds in < 10ms, but business logic latency unknown. +**Ghi chú trạng thái:** +Kiểm thử tải bị chặn do vấn đề cơ sở dữ liệu/dependency. Framework phản hồi trong < 10ms, nhưng độ trễ logic nghiệp vụ chưa xác định. --- -### ❌ **10. SSL/TLS Certificates** — NOT CONFIGURED -**Status:** Configuration templates exist; no production certs deployed -**Evidence:** -- **Path:** `/docker-compose.prod.yml` — no SSL/TLS configuration visible -- **Path:** `/infra/pgbouncer/pgbouncer.ini` — SSL options commented out: +### ❌ **10. Chứng Chỉ SSL/TLS** — CHƯA ĐƯỢC CẤU HÌNH +**Trạng thái:** Template cấu hình đã tồn tại; chưa có chứng chỉ production nào được triển khai +**Bằng chứng:** +- **Đường dẫn:** `/docker-compose.prod.yml` — không thấy cấu hình SSL/TLS +- **Đường dẫn:** `/infra/pgbouncer/pgbouncer.ini` — các tùy chọn SSL bị comment out: ``` ;; client_tls_sslmode = prefer ;; client_tls_key_file = /etc/pgbouncer/tls/server.key ;; client_tls_cert_file = /etc/pgbouncer/tls/server.crt ``` -- **Path:** `/docs/deployment.md` line 146: +- **Đường dẫn:** `/docs/deployment.md` dòng 146: ``` - [ ] Enable SSL/TLS termination (reverse proxy) ``` -**What Exists:** -- ✅ PgBouncer TLS configuration templates (commented out) -- ✅ Checklist item for SSL/TLS in deployment docs +**Những gì đã có:** +- ✅ Template cấu hình TLS cho PgBouncer (đã bị comment out) +- ✅ Hạng mục trong danh sách kiểm tra cho SSL/TLS trong tài liệu triển khai -**What's Missing:** -- ❌ No reverse proxy (nginx/ALB) configured in docker-compose.prod.yml -- ❌ No certificate provisioning mechanism (Let's Encrypt, etc.) -- ❌ No TLS termination for API/Web services -- ❌ No HSTS headers configuration -- ❌ No certificate renewal procedure documented +**Những gì còn thiếu:** +- ❌ Không có reverse proxy (nginx/ALB) được cấu hình trong docker-compose.prod.yml +- ❌ Không có cơ chế cung cấp chứng chỉ (Let's Encrypt, v.v.) +- ❌ Không có TLS termination cho dịch vụ API/Web +- ❌ Không có cấu hình header HSTS +- ❌ Không có quy trình gia hạn chứng chỉ được ghi chép -**Recommendation:** Deploy nginx reverse proxy with Let's Encrypt for production. +**Khuyến nghị:** Triển khai nginx reverse proxy với Let's Encrypt cho production. --- -### ❌ **11. DNS Configuration** — NOT DOCUMENTED -**Status:** No DNS configuration found -**Evidence:** -- **Path:** No `infra/dns/` directory -- **Path:** No DNS documentation in `/docs/` -- **Path:** Deployment guide mentions "production architecture" but no DNS config +### ❌ **11. Cấu Hình DNS** — CHƯA ĐƯỢC GHI CHÉP +**Trạng thái:** Không tìm thấy cấu hình DNS +**Bằng chứng:** +- **Đường dẫn:** Không có thư mục `infra/dns/` +- **Đường dẫn:** Không có tài liệu DNS trong `/docs/` +- **Đường dẫn:** Hướng dẫn triển khai đề cập "kiến trúc production" nhưng không có cấu hình DNS -**What Exists:** -- ✅ Environment variables for API URL: `NEXT_PUBLIC_API_URL` in docker-compose.prod.yml -- ✅ Deployment architecture diagram showing load balancer +**Những gì đã có:** +- ✅ Biến môi trường cho URL API: `NEXT_PUBLIC_API_URL` trong docker-compose.prod.yml +- ✅ Sơ đồ kiến trúc triển khai hiển thị load balancer -**What's Missing:** -- ❌ No DNS provider configuration (AWS Route53, Cloudflare, etc.) -- ❌ No domain/subdomain setup documentation -- ❌ No DNS health checks -- ❌ No failover DNS configuration -- ❌ No DNS security (DNSSEC) +**Những gì còn thiếu:** +- ❌ Không có cấu hình DNS provider (AWS Route53, Cloudflare, v.v.) +- ❌ Không có tài liệu thiết lập domain/subdomain +- ❌ Không có health check DNS +- ❌ Không có cấu hình DNS dự phòng +- ❌ Không có bảo mật DNS (DNSSEC) -**Recommendation:** Document DNS setup for production domains (api.goodgo.vn, goodgo.vn, etc.). +**Khuyến nghị:** Ghi chép thiết lập DNS cho các domain production (api.goodgo.vn, goodgo.vn, v.v.). --- -### ❌ **12. CDN Setup for Static Assets** — NOT CONFIGURED -**Status:** Mentioned in deployment checklist but not implemented -**Evidence:** -- **Path:** `/docs/deployment.md` line 167: +### ❌ **12. Thiết Lập CDN Cho Tài Nguyên Tĩnh** — CHƯA ĐƯỢC CẤU HÌNH +**Trạng thái:** Được đề cập trong danh sách kiểm tra triển khai nhưng chưa được triển khai +**Bằng chứng:** +- **Đường dẫn:** `/docs/deployment.md` dòng 167: ``` - [ ] Configure CDN for static assets (Next.js `/_next/static/`) ``` -- **Path:** No CDN configuration in `docker-compose.prod.yml` -- **Path:** No Cloudflare/AWS CloudFront/Fastly integration visible +- **Đường dẫn:** Không có cấu hình CDN trong `docker-compose.prod.yml` +- **Đường dẫn:** Không thấy tích hợp Cloudflare/AWS CloudFront/Fastly -**What Exists:** -- ✅ Next.js app configured (compiles static assets in `/_next/static/`) -- ✅ Deployment notes mention Vercel/Cloudflare as options for Web scaling +**Những gì đã có:** +- ✅ Ứng dụng Next.js đã được cấu hình (biên dịch tài nguyên tĩnh trong `/_next/static/`) +- ✅ Ghi chú triển khai đề cập Vercel/Cloudflare là các tùy chọn để mở rộng Web -**What's Missing:** -- ❌ No CDN provider integration (Cloudflare, AWS CloudFront, etc.) -- ❌ No cache headers configured -- ❌ No cache invalidation procedure -- ❌ No asset versioning/hashing -- ❌ No CDN routing rules +**Những gì còn thiếu:** +- ❌ Không có tích hợp CDN provider (Cloudflare, AWS CloudFront, v.v.) +- ❌ Không có cấu hình cache header +- ❌ Không có quy trình vô hiệu hóa cache +- ❌ Không có phiên bản/hash tài nguyên +- ❌ Không có quy tắc định tuyến CDN -**Recommendation:** Integrate with Cloudflare or AWS CloudFront for static asset delivery. +**Khuyến nghị:** Tích hợp với Cloudflare hoặc AWS CloudFront để phân phối tài nguyên tĩnh. --- -## Summary Table +## Bảng Tổng Hợp -| Item | Status | Critical? | Evidence | -|------|--------|-----------|----------| -| 1. Load testing results | ✅ MODERATE | No | K6 baseline exists (local only) | -| 2. Security pen-test sign-off | ❌ MISSING | **YES** | No formal audit/pen-test report | -| 3. Monitoring alerts configured | ✅ GOOD | No | 15+ alert rules in prometheus | -| 4. Backup/restore verification | ✅ GOOD | No | Automated weekly verification | -| 5. Incident response runbook | ✅ GOOD | No | 41KB comprehensive runbook | -| 6. Database schema frozen | ✅ MODERATE | No | Migration lock exists, but not frozen | -| 7. CI/CD pipeline | ✅ GOOD | No | 9 workflows, full CI coverage | -| 8. E2E test results | ⚠️ FAILING | **YES** | 2 tests failing, needs investigation | -| 9. Performance benchmarks | ❌ MISSING | **YES** | Only framework-level baseline | -| 10. SSL/TLS certificates | ❌ NOT CONFIG | **YES** | No reverse proxy, no certs | -| 11. DNS configuration | ❌ MISSING | **YES** | No domain/DNS setup docs | -| 12. CDN for static assets | ❌ NOT CONFIG | No | Checklist item unchecked | +| Hạng mục | Trạng thái | Nghiêm trọng? | Bằng chứng | +|----------|-----------|---------------|------------| +| 1. Kết quả kiểm thử tải | ✅ TRUNG BÌNH | Không | Baseline K6 tồn tại (chỉ cục bộ) | +| 2. Xác nhận kiểm thử xâm nhập | ❌ THIẾU | **CÓ** | Không có báo cáo kiểm toán/kiểm thử xâm nhập chính thức | +| 3. Cấu hình cảnh báo giám sát | ✅ TỐT | Không | Hơn 15 quy tắc cảnh báo trong prometheus | +| 4. Xác minh sao lưu/phục hồi | ✅ TỐT | Không | Xác minh tự động hàng tuần | +| 5. Runbook ứng phó sự cố | ✅ TỐT | Không | Runbook toàn diện 41KB | +| 6. Schema cơ sở dữ liệu đóng băng | ✅ TRUNG BÌNH | Không | Khóa migration tồn tại, nhưng chưa bị đóng băng | +| 7. Pipeline CI/CD | ✅ TỐT | Không | 9 workflow, phủ sóng CI đầy đủ | +| 8. Kết quả kiểm thử E2E | ⚠️ THẤT BẠI | **CÓ** | 2 kiểm thử thất bại, cần điều tra | +| 9. Đo hiệu năng | ❌ THIẾU | **CÓ** | Chỉ có baseline ở mức framework | +| 10. Chứng chỉ SSL/TLS | ❌ CHƯA CẤU HÌNH | **CÓ** | Không có reverse proxy, không có chứng chỉ | +| 11. Cấu hình DNS | ❌ THIẾU | **CÓ** | Không có tài liệu domain/DNS | +| 12. CDN cho tài nguyên tĩnh | ❌ CHƯA CẤU HÌNH | Không | Hạng mục trong danh sách kiểm tra chưa đánh dấu | --- -## Critical Blockers for Production (Must Fix) +## Các Vấn Đề Chặn Nghiêm Trọng Cho Production (Bắt Buộc Khắc Phục) -1. **Security Audit** — Conduct penetration test before launch -2. **E2E Tests** — Fix 2 failing tests -3. **SSL/TLS Termination** — Deploy reverse proxy with valid certificates -4. **DNS Setup** — Configure production domains -5. **Performance Validation** — Run load tests against staging with full dependencies +1. **Kiểm Toán Bảo Mật** — Tiến hành kiểm thử xâm nhập trước khi ra mắt +2. **Kiểm Thử E2E** — Sửa 2 kiểm thử đang thất bại +3. **TLS Termination** — Triển khai reverse proxy với chứng chỉ hợp lệ +4. **Thiết Lập DNS** — Cấu hình domain production +5. **Xác Thực Hiệu Năng** — Chạy kiểm thử tải trên staging với đầy đủ dependency --- -## Recommendations (Priority Order) +## Khuyến Nghị (Theo Thứ Tự Ưu Tiên) -### P0 (Blocking) -1. Schedule formal penetration test (3-4 weeks) -2. Debug and fix E2E test failures -3. Deploy nginx reverse proxy with Let's Encrypt SSL -4. Configure DNS for production domains -5. Run load tests against staging environment +### P0 (Chặn) +1. Lên lịch kiểm thử xâm nhập chính thức (3-4 tuần) +2. Gỡ lỗi và sửa các kiểm thử E2E thất bại +3. Triển khai nginx reverse proxy với SSL từ Let's Encrypt +4. Cấu hình DNS cho domain production +5. Chạy kiểm thử tải trên môi trường staging -### P1 (Before GA) -1. Document CDN setup (Cloudflare/CloudFront) -2. Freeze database schema (implement "no migrations in production" policy) -3. Document off-site backup storage and restore procedures -4. Create performance benchmark baselines for all endpoints -5. Add SLA validation to CI pipeline (fail if p95 > 500ms) +### P1 (Trước GA) +1. Ghi chép thiết lập CDN (Cloudflare/CloudFront) +2. Đóng băng schema cơ sở dữ liệu (triển khai chính sách "không migration trong production") +3. Ghi chép bộ nhớ sao lưu ngoài site và quy trình phục hồi +4. Tạo baseline đo hiệu năng cho tất cả endpoint +5. Thêm xác thực SLA vào pipeline CI (thất bại nếu p95 > 500ms) -### P2 (Nice-to-have) -1. Implement DAST/API security scanning in CI -2. Add performance regression detection to CI -3. Set up incident log and post-mortem template -4. Document alert tuning and threshold rationale -5. Test backup recovery from off-site storage +### P2 (Tốt Nếu Có) +1. Triển khai DAST/quét bảo mật API trong CI +2. Thêm phát hiện hồi quy hiệu năng vào CI +3. Thiết lập nhật ký sự cố và mẫu post-mortem +4. Ghi chép cơ sở tinh chỉnh cảnh báo và lý do ngưỡng +5. Kiểm thử phục hồi sao lưu từ bộ nhớ ngoài site --- -## Files Reviewed +## Các File Đã Xem Xét -**Configuration:** +**Cấu hình:** - docker-compose.prod.yml -- .github/workflows/* (9 files) -- prisma/migrations/ (16 migrations) +- .github/workflows/* (9 file) +- prisma/migrations/ (16 migration) - monitoring/* (prometheus, grafana, alertmanager, loki, promtail) -**Documentation:** +**Tài liệu:** - docs/backup-restore.md - docs/RUNBOOK.md - docs/deployment.md -- docs/audits/* (no security audit found) +- docs/audits/* (không tìm thấy kiểm toán bảo mật) - load-tests/results/BASELINE-REPORT.md - K6_LOAD_TESTING_GUIDE.md -**Test Results:** -- playwright-report/ (E2E results, 2 failures) +**Kết quả kiểm thử:** +- playwright-report/ (kết quả E2E, 2 lỗi) - load-tests/results/ (auth.json, listings.json, search.json, payments.json) --- -**Generated:** 2026-04-12 +**Được tạo:** 12/04/2026 diff --git a/docs/PROJECT_TRACKER.md b/docs/PROJECT_TRACKER.md index 3c2b817..f8d00d5 100644 --- a/docs/PROJECT_TRACKER.md +++ b/docs/PROJECT_TRACKER.md @@ -1,450 +1,450 @@ -# GoodGo Platform AI — Project Tracker +# GoodGo Platform AI — Theo Dõi Dự Án -**Last Updated:** 2026-04-12 -**Project:** Goodgo Platform AI -**Status:** MVP Complete — Phase 7 (Post-MVP Improvements) Wave 14 ✅ Build Green +**Cập Nhật Lần Cuối:** 2026-04-12 +**Dự Án:** Goodgo Platform AI +**Trạng Thái:** MVP Hoàn Thành — Giai Đoạn 7 (Cải Tiến Sau MVP) Wave 14 ✅ Build Xanh --- -## Phase 0: Foundation (P0 — Critical) - -| Issue | Title | Priority | Status | Commit | -| -------------------------------- | --------------------------------------------------- | -------- | ------ | ------ | -| [TEC-1415](/TEC/issues/TEC-1415) | Monorepo Scaffolding (Turborepo + NestJS + Next.js) | Critical | done | e1e5fa6 | -| [TEC-1416](/TEC/issues/TEC-1416) | Docker Compose Dev Environment | Critical | done | e1e5fa6 | -| [TEC-1417](/TEC/issues/TEC-1417) | Prisma Schema + Initial Migration + Seed Scripts | Critical | done | ff358f6 | -| [TEC-1418](/TEC/issues/TEC-1418) | Shared Module (Domain Primitives + Infrastructure) | Critical | done | 1fb7bb3 | -| [TEC-1419](/TEC/issues/TEC-1419) | CI/CD Pipeline (GitHub Actions) | High | done | 19dd59e | -| [TEC-1420](/TEC/issues/TEC-1420) | ESLint + Prettier + Module Boundary Rules | High | done | 83d55de | - -## Phase 1: Core Auth & Listings (P1) - -| Issue | Title | Priority | Status | Commit | -| -------------------------------- | ------------------------------------------------- | -------- | ------ | ------ | -| [TEC-1421](/TEC/issues/TEC-1421) | Auth Module Backend (Register, Login, JWT, OAuth) | Critical | done | 391c040 | -| [TEC-1422](/TEC/issues/TEC-1422) | Auth Frontend (Login/Register + OAuth) | High | done | bfdd2f7 | -| [TEC-1423](/TEC/issues/TEC-1423) | Listings Module Backend (CRUD, Media, Moderation) | High | done | 8a33aae | -| [TEC-1424](/TEC/issues/TEC-1424) | Search Module Backend (Typesense + Geo) | High | done | 6741592 | -| [TEC-1425](/TEC/issues/TEC-1425) | Security Hardening (Rate Limiting, CORS, Helmet) | High | done | f3081d9 | -| [TEC-1426](/TEC/issues/TEC-1426) | Error Handling & Logging Strategy | High | done | c981bff | -| [TEC-1427](/TEC/issues/TEC-1427) | Listings Frontend (Create/Edit + Detail) | High | done | 207a201 | -| [TEC-1428](/TEC/issues/TEC-1428) | Search + Landing Page Frontend | High | done | 5e44456 | - -## Phase 2: Monetization & Operations (P2) - -| Issue | Title | Priority | Status | Commit | -| -------------------------------- | ----------------------------------------------- | -------- | ------ | ------ | -| [TEC-1429](/TEC/issues/TEC-1429) | Payments Module (VNPay + MoMo + ZaloPay) | Medium | done | ad77139 | -| [TEC-1430](/TEC/issues/TEC-1430) | Subscriptions Module (Plans, Quotas, Billing) | Medium | done | 9b581b7 | -| [TEC-1431](/TEC/issues/TEC-1431) | Notifications Module (Email, SMS, Zalo OA, FCM) | Medium | done | 0b29fac | -| [TEC-1432](/TEC/issues/TEC-1432) | Admin Module (Backend + Frontend) | Medium | done | 6123fc4 | -| [TEC-1433](/TEC/issues/TEC-1433) | E2E Testing Setup (Playwright) | Medium | done | 60a0b3c | - -## Phase 3: AI & Advanced (P3) - -| Issue | Title | Priority | Status | Commit | -| ----- | ------------------------------------------------ | -------- | ------ | ------ | -| — | Analytics Module (Market Reports, Price Index) | High | done | efa49e2 | -| — | AI/ML Services Container (Python FastAPI + XGBoost) | High | done | b392bc3 | -| — | MCP Server Integration (Property Search, Analytics, Valuation) | Medium | done | cb00b12 | -| — | Performance Monitoring (Prometheus + Grafana) | Low | done | d99dfba | - -## Phase 4: Production Hardening (P0/P1 — Security + Infrastructure) - -| Issue | Title | Priority | Status | Assignee | -| -------------------------------- | ------------------------------------------------------------ | -------- | ------ | --------------------- | -| [TEC-1449](/TEC/issues/TEC-1449) | Fix JWT hardcoded fallback secret | Critical | done | Security Engineer | -| [TEC-1450](/TEC/issues/TEC-1450) | Create production deployment pipeline — Dockerfiles + CI/CD | Critical | done | DevOps Engineer | -| [TEC-1451](/TEC/issues/TEC-1451) | Fix timing-unsafe HMAC in payment verification | High | done | Security Engineer | -| [TEC-1452](/TEC/issues/TEC-1452) | Fix MinIO hardcoded credentials and unsigned PUT | High | done | Senior Backend Eng | -| [TEC-1453](/TEC/issues/TEC-1453) | Add CSRF protection middleware | High | done | Security Engineer | -| [TEC-1455](/TEC/issues/TEC-1455) | Add missing DB index on Listing.sellerId | High | done | Database Architect | -| [TEC-1456](/TEC/issues/TEC-1456) | Add unit tests for Analytics, Search, Notifications | High | done | QA Engineer | -| [TEC-1457](/TEC/issues/TEC-1457) | Set up database backup strategy and log aggregation | High | done | SRE Engineer | - -## Phase 5: Quality & Polish (P2 — UX, Docs, Performance) - -| Issue | Title | Priority | Status | Assignee | -| -------------------------------- | ------------------------------------------------------------ | -------- | ------ | --------------------- | -| [TEC-1458](/TEC/issues/TEC-1458) | Implement Redis caching layer for hot queries | Medium | done | Senior Backend Eng | -| [TEC-1459](/TEC/issues/TEC-1459) | Add error boundaries, 404 page, loading states, SEO metadata | Medium | done | Senior Frontend Eng | -| [TEC-1460](/TEC/issues/TEC-1460) | Add OpenAPI/Swagger documentation for API | Medium | done | API Architect | -| [TEC-1461](/TEC/issues/TEC-1461) | Create README.md and deployment documentation | Medium | done | Technical Writer | - -## Phase 6: MVP Feature Completion & Audit Follow-up (P0-P2) - -| Issue | Title | Priority | Status | Assignee | -| -------------------------------- | ------------------------------------------------------------ | -------- | ------ | ----------------------- | -| [TEC-1592](/TEC/issues/TEC-1592) | Commit 23 untracked files (analytics, encryption, i18n) | Critical | done | Senior Backend Engineer | -| [TEC-1593](/TEC/issues/TEC-1593) | Investigate and fix Architect agent error status | High | done | DevOps Engineer | -| [TEC-1594](/TEC/issues/TEC-1594) | Consolidate i18n routes — remove non-locale route duplication | High | done | Senior Frontend Engineer| -| [TEC-1595](/TEC/issues/TEC-1595) | Build Agent Portal — inquiry system, lead tracking, quality | High | done | Senior Backend Engineer | -| [TEC-1596](/TEC/issues/TEC-1596) | Integrate AI/ML services — AVM endpoint, AI moderation | High | done | Senior Backend Engineer | -| [TEC-1597](/TEC/issues/TEC-1597) | Complete payment flow — VNPay E2E + MoMo integration | High | done | Senior Backend Engineer | -| [TEC-1598](/TEC/issues/TEC-1598) | Add post-deploy smoke test pipeline stage | High | done | DevOps Engineer | -| [TEC-1599](/TEC/issues/TEC-1599) | Add test coverage for health, mcp, metrics modules | Medium | done | QA Engineer | -| [TEC-1600](/TEC/issues/TEC-1600) | Generate OpenAPI/Swagger documentation | Medium | done | Technical Writer | -| [TEC-1601](/TEC/issues/TEC-1601) | Run K6 baseline load tests and establish benchmarks | Medium | done | SRE Engineer | -| [TEC-1602](/TEC/issues/TEC-1602) | Security audit — pen testing on auth and payment flows | Medium | done | Security Engineer | -| [TEC-1603](/TEC/issues/TEC-1603) | Database index optimization review | Medium | done | Database Architect | -| [TEC-1604](/TEC/issues/TEC-1604) | Setup Sentry error tracking integration | Medium | done | Infrastructure Engineer | -| [TEC-1639](/TEC/issues/TEC-1639) | Add auth guards to MCP Transport Controller | Critical | done | Security Engineer | -| [TEC-1640](/TEC/issues/TEC-1640) | Improve async error handling in critical modules | High | done | Senior Backend Engineer | -| [TEC-1641](/TEC/issues/TEC-1641) | Add input size limits for file uploads | High | done | Senior Backend Engineer | - -## Phase 7: Post-MVP Improvements & Production Hardening (P0-P2) - -### Wave 1 — Critical Bug Fixes - -| Issue | Title | Priority | Status | Assignee | -| -------------------------------- | ------------------------------------------------------------ | -------- | ------ | ----------------------- | -| [TEC-1647](/TEC/issues/TEC-1647) | Fix Reviews module routing — all /reviews/* routes return 404 | Critical | done | Senior Backend Engineer | -| [TEC-1648](/TEC/issues/TEC-1648) | Fix Health check endpoints — /health and /ready return 404 | Critical | done | Senior Backend Engineer | -| [TEC-1649](/TEC/issues/TEC-1649) | Verify and fix Login error handling — 500 → 401 | Critical | done | Senior Backend Engineer | -| [TEC-1650](/TEC/issues/TEC-1650) | Fix Listing detail — non-existent ID returns 500 → 404 | High | todo | Senior Backend Engineer | - -### Wave 2 — Production Readiness - -| Issue | Title | Priority | Status | Assignee | -| -------------------------------- | ------------------------------------------------------------ | -------- | ------ | ----------------------- | -| [TEC-1651](/TEC/issues/TEC-1651) | Setup Docker Compose CI environment for E2E tests | High | done | DevOps Engineer | -| [TEC-1652](/TEC/issues/TEC-1652) | Run and verify all 29 E2E tests with full environment | High | todo | QA Engineer | -| [TEC-1653](/TEC/issues/TEC-1653) | Security headers audit — CSP, HSTS, X-Frame-Options | High | done | Security Engineer | -| [TEC-1658](/TEC/issues/TEC-1658) | Add PgBouncer connection pooling for production | High | done | Database Architect | - -### Wave 3 — User-Facing Quality - -| Issue | Title | Priority | Status | Assignee | -| -------------------------------- | ------------------------------------------------------------ | -------- | ------ | ------------------------- | -| [TEC-1654](/TEC/issues/TEC-1654) | Mobile responsive optimization | High | done | Senior Frontend Engineer | -| [TEC-1655](/TEC/issues/TEC-1655) | SEO optimization — structured data, sitemap, meta tags | High | done | Senior Frontend Engineer | -| [TEC-1656](/TEC/issues/TEC-1656) | Add per-user rate limiting for authenticated API routes | High | done | Security Engineer | -| [TEC-1657](/TEC/issues/TEC-1657) | Add audit logging for admin actions | High | todo | Senior Backend Engineer | - -### Wave 4 — Engineering Excellence - -| Issue | Title | Priority | Status | Assignee | -| -------------------------------- | ------------------------------------------------------------ | -------- | ------ | ------------------------- | -| [TEC-1659](/TEC/issues/TEC-1659) | Add graceful degradation for Typesense and Redis failures | Medium | done | Architect | -| [TEC-1660](/TEC/issues/TEC-1660) | Document all structured API error codes | Medium | done | Technical Writer | -| [TEC-1661](/TEC/issues/TEC-1661) | Setup RUM and Core Web Vitals tracking | Medium | done | SRE Engineer | -| [TEC-1662](/TEC/issues/TEC-1662) | Update QA_TRACKER.md — correct test counts and bug statuses | Medium | done | QA Engineer | - -### Wave 5 — CEO Audit: Security & Quality - -| Issue | Title | Priority | Status | Assignee | -| -------------------------------- | ------------------------------------------------------------ | -------- | ------ | ------------------------- | -| [TEC-1684](/TEC/issues/TEC-1684) | Fix critical npm vulnerabilities (axios SSRF, Next.js CVEs) | Critical | done | Security Engineer | -| [TEC-1685](/TEC/issues/TEC-1685) | Fix lint error in resilient-search.repository.ts | High | done | QA Engineer | -| [TEC-1686](/TEC/issues/TEC-1686) | Increase test coverage for listings, auth, search to 50%+ | High | done | QA Engineer | -| [TEC-1687](/TEC/issues/TEC-1687) | Set up Dependabot for automated security updates | Medium | done | DevOps Engineer | -| [TEC-1688](/TEC/issues/TEC-1688) | Implement Saved Searches + Alerts (Sprint 3 gap) | High | done | Architect | - -### Wave 6 — CEO Audit: Code Hygiene, Frontend Quality, Features - -#### Wave 6A — Critical (P0) - -| Issue | Title | Priority | Status | Assignee | -| -------------------------------- | ------------------------------------------------------------ | -------- | ------ | ------------------------- | -| [TEC-1692](/TEC/issues/TEC-1692) | Commit 348 uncommitted files — protect work from data loss | Critical | done | Senior Backend Engineer | -| [TEC-1693](/TEC/issues/TEC-1693) | Fix 729 ESLint errors — unblock CI pipeline | Critical | done | Senior Backend Engineer | -| [TEC-1694](/TEC/issues/TEC-1694) | Create /pricing page — complete subscription funnel | Critical | todo | Senior Frontend Engineer | - -#### Wave 6B — High Priority (P1) - -| Issue | Title | Priority | Status | Assignee | -| -------------------------------- | ------------------------------------------------------------ | -------- | ------ | ------------------------- | -| [TEC-1695](/TEC/issues/TEC-1695) | Frontend accessibility audit + ARIA fixes | High | todo | Senior Frontend Engineer | -| [TEC-1696](/TEC/issues/TEC-1696) | Fix Reviews test + increase frontend test coverage to 40% | High | todo | QA Engineer | -| [TEC-1697](/TEC/issues/TEC-1697) | Mobile responsive polish — final pass on all 22 pages | High | todo | UX/UI Designer | - -#### Wave 6C — Medium Priority (P2) - -| Issue | Title | Priority | Status | Assignee | -| -------------------------------- | ------------------------------------------------------------ | -------- | ----------- | ------------------------- | -| [TEC-1698](/TEC/issues/TEC-1698) | Frontend performance — next/image + Server Component audit | Medium | in_progress | Senior Frontend Engineer | -| [TEC-1699](/TEC/issues/TEC-1699) | Saved search email alerts — user retention feature | Medium | todo | Senior Backend Engineer | - -### Wave 7 — CEO Audit (2026-04-10) - -#### Wave 7A — Critical (P0) - -| Issue | Title | Priority | Status | Assignee | -| -------------------------------- | ------------------------------------------------------------ | -------- | ------ | ------------------------- | -| [TEC-1703](/TEC/issues/TEC-1703) | Fix HashedPassword.vo.spec.ts timeout — restore CI green | Critical | done | QA Engineer | - -#### Wave 7B — High Priority (P1) - -| Issue | Title | Priority | Status | Assignee | -| -------------------------------- | ------------------------------------------------------------ | -------- | ------ | ------------------------- | -| [TEC-1704](/TEC/issues/TEC-1704) | Vietnamese price formatting — display 3.5 tỷ, 150 triệu/m² | High | todo | Senior Frontend Engineer | -| [TEC-1705](/TEC/issues/TEC-1705) | Consolidate 18 audit files from root into docs/audits/ | High | todo | Technical Writer | - -#### Wave 7C — Medium Priority (P2) - -| Issue | Title | Priority | Status | Assignee | -| -------------------------------- | ------------------------------------------------------------ | -------- | ------ | ------------------------- | -| [TEC-1706](/TEC/issues/TEC-1706) | Build property comparison page — frontend for MCP compare | Medium | todo | Senior Frontend Engineer | -| [TEC-1707](/TEC/issues/TEC-1707) | Create agent public profile page at /agents/[id] | Medium | todo | Senior Frontend Engineer | -| [TEC-1708](/TEC/issues/TEC-1708) | Add lightbox image gallery to property detail page | Medium | todo | Senior Frontend Engineer | -| [TEC-1709](/TEC/issues/TEC-1709) | Create Grafana dashboard for API latency monitoring | Medium | todo | SRE Engineer | -| [TEC-1710](/TEC/issues/TEC-1710) | Automate database backup restore verification | Medium | todo | Database Architect | -| [TEC-1711](/TEC/issues/TEC-1711) | Consolidate project documentation — update README + API docs | Medium | todo | Technical Writer | +## Giai Đoạn 0: Nền Tảng (P0 — Quan Trọng) + +| Vấn Đề | Tiêu Đề | Ưu Tiên | Trạng Thái | Commit | +| -------------------------------- | --------------------------------------------------- | ---------- | ---------- | ------ | +| [TEC-1415](/TEC/issues/TEC-1415) | Monorepo Scaffolding (Turborepo + NestJS + Next.js) | Quan trọng | hoàn thành | e1e5fa6 | +| [TEC-1416](/TEC/issues/TEC-1416) | Docker Compose Dev Environment | Quan trọng | hoàn thành | e1e5fa6 | +| [TEC-1417](/TEC/issues/TEC-1417) | Prisma Schema + Migration Ban Đầu + Script Seed | Quan trọng | hoàn thành | ff358f6 | +| [TEC-1418](/TEC/issues/TEC-1418) | Shared Module (Domain Primitives + Infrastructure) | Quan trọng | hoàn thành | 1fb7bb3 | +| [TEC-1419](/TEC/issues/TEC-1419) | CI/CD Pipeline (GitHub Actions) | Cao | hoàn thành | 19dd59e | +| [TEC-1420](/TEC/issues/TEC-1420) | ESLint + Prettier + Module Boundary Rules | Cao | hoàn thành | 83d55de | + +## Giai Đoạn 1: Auth & Listings Cốt Lõi (P1) + +| Vấn Đề | Tiêu Đề | Ưu Tiên | Trạng Thái | Commit | +| -------------------------------- | --------------------------------------------------- | ---------- | ---------- | ------ | +| [TEC-1421](/TEC/issues/TEC-1421) | Auth Module Backend (Đăng Ký, Đăng Nhập, JWT, OAuth) | Quan trọng | hoàn thành | 391c040 | +| [TEC-1422](/TEC/issues/TEC-1422) | Auth Frontend (Đăng Nhập/Đăng Ký + OAuth) | Cao | hoàn thành | bfdd2f7 | +| [TEC-1423](/TEC/issues/TEC-1423) | Listings Module Backend (CRUD, Media, Kiểm Duyệt) | Cao | hoàn thành | 8a33aae | +| [TEC-1424](/TEC/issues/TEC-1424) | Search Module Backend (Typesense + Geo) | Cao | hoàn thành | 6741592 | +| [TEC-1425](/TEC/issues/TEC-1425) | Tăng Cường Bảo Mật (Rate Limiting, CORS, Helmet) | Cao | hoàn thành | f3081d9 | +| [TEC-1426](/TEC/issues/TEC-1426) | Xử Lý Lỗi & Chiến Lược Logging | Cao | hoàn thành | c981bff | +| [TEC-1427](/TEC/issues/TEC-1427) | Listings Frontend (Tạo/Chỉnh Sửa + Chi Tiết) | Cao | hoàn thành | 207a201 | +| [TEC-1428](/TEC/issues/TEC-1428) | Frontend Tìm Kiếm + Trang Chủ | Cao | hoàn thành | 5e44456 | + +## Giai Đoạn 2: Kiếm Tiền & Vận Hành (P2) + +| Vấn Đề | Tiêu Đề | Ưu Tiên | Trạng Thái | Commit | +| -------------------------------- | ---------------------------------------------------- | --------- | ---------- | ------ | +| [TEC-1429](/TEC/issues/TEC-1429) | Payments Module (VNPay + MoMo + ZaloPay) | Trung bình | hoàn thành | ad77139 | +| [TEC-1430](/TEC/issues/TEC-1430) | Subscriptions Module (Gói, Hạn Mức, Thanh Toán) | Trung bình | hoàn thành | 9b581b7 | +| [TEC-1431](/TEC/issues/TEC-1431) | Notifications Module (Email, SMS, Zalo OA, FCM) | Trung bình | hoàn thành | 0b29fac | +| [TEC-1432](/TEC/issues/TEC-1432) | Admin Module (Backend + Frontend) | Trung bình | hoàn thành | 6123fc4 | +| [TEC-1433](/TEC/issues/TEC-1433) | Thiết Lập E2E Testing (Playwright) | Trung bình | hoàn thành | 60a0b3c | + +## Giai Đoạn 3: AI & Nâng Cao (P3) + +| Vấn Đề | Tiêu Đề | Ưu Tiên | Trạng Thái | Commit | +| ------ | -------------------------------------------------------------- | --------- | ---------- | ------ | +| — | Analytics Module (Báo Cáo Thị Trường, Chỉ Số Giá) | Cao | hoàn thành | efa49e2 | +| — | AI/ML Services Container (Python FastAPI + XGBoost) | Cao | hoàn thành | b392bc3 | +| — | MCP Server Integration (Tìm Kiếm BĐS, Analytics, Định Giá) | Trung bình | hoàn thành | cb00b12 | +| — | Performance Monitoring (Prometheus + Grafana) | Thấp | hoàn thành | d99dfba | + +## Giai Đoạn 4: Tăng Cường Sản Xuất (P0/P1 — Bảo Mật + Hạ Tầng) + +| Vấn Đề | Tiêu Đề | Ưu Tiên | Trạng Thái | Người Phụ Trách | +| -------------------------------- | -------------------------------------------------------------------- | ---------- | ---------- | ----------------------- | +| [TEC-1449](/TEC/issues/TEC-1449) | Sửa lỗi JWT hardcoded fallback secret | Quan trọng | hoàn thành | Kỹ Sư Bảo Mật | +| [TEC-1450](/TEC/issues/TEC-1450) | Tạo pipeline triển khai sản xuất — Dockerfiles + CI/CD | Quan trọng | hoàn thành | Kỹ Sư DevOps | +| [TEC-1451](/TEC/issues/TEC-1451) | Sửa HMAC timing-unsafe trong xác minh thanh toán | Cao | hoàn thành | Kỹ Sư Bảo Mật | +| [TEC-1452](/TEC/issues/TEC-1452) | Sửa MinIO hardcoded credentials và unsigned PUT | Cao | hoàn thành | Kỹ Sư Backend Cao Cấp | +| [TEC-1453](/TEC/issues/TEC-1453) | Thêm middleware bảo vệ CSRF | Cao | hoàn thành | Kỹ Sư Bảo Mật | +| [TEC-1455](/TEC/issues/TEC-1455) | Thêm DB index còn thiếu trên Listing.sellerId | Cao | hoàn thành | Kiến Trúc Sư Cơ Sở Dữ Liệu | +| [TEC-1456](/TEC/issues/TEC-1456) | Thêm unit tests cho Analytics, Search, Notifications | Cao | hoàn thành | Kỹ Sư QA | +| [TEC-1457](/TEC/issues/TEC-1457) | Thiết lập chiến lược sao lưu CSDL và tổng hợp log | Cao | hoàn thành | Kỹ Sư SRE | + +## Giai Đoạn 5: Chất Lượng & Hoàn Thiện (P2 — UX, Tài Liệu, Hiệu Năng) + +| Vấn Đề | Tiêu Đề | Ưu Tiên | Trạng Thái | Người Phụ Trách | +| -------------------------------- | -------------------------------------------------------------------- | ---------- | ---------- | ----------------------- | +| [TEC-1458](/TEC/issues/TEC-1458) | Triển khai lớp Redis caching cho các truy vấn phổ biến | Trung bình | hoàn thành | Kỹ Sư Backend Cao Cấp | +| [TEC-1459](/TEC/issues/TEC-1459) | Thêm error boundaries, trang 404, trạng thái tải, SEO metadata | Trung bình | hoàn thành | Kỹ Sư Frontend Cao Cấp | +| [TEC-1460](/TEC/issues/TEC-1460) | Thêm tài liệu OpenAPI/Swagger cho API | Trung bình | hoàn thành | Kiến Trúc Sư API | +| [TEC-1461](/TEC/issues/TEC-1461) | Tạo README.md và tài liệu triển khai | Trung bình | hoàn thành | Kỹ Sư Viết Tài Liệu | + +## Giai Đoạn 6: Hoàn Thiện Tính Năng MVP & Theo Dõi Sau Kiểm Toán (P0-P2) + +| Vấn Đề | Tiêu Đề | Ưu Tiên | Trạng Thái | Người Phụ Trách | +| -------------------------------- | -------------------------------------------------------------------- | ---------- | ---------- | ------------------------- | +| [TEC-1592](/TEC/issues/TEC-1592) | Commit 23 file chưa được theo dõi (analytics, encryption, i18n) | Quan trọng | hoàn thành | Kỹ Sư Backend Cao Cấp | +| [TEC-1593](/TEC/issues/TEC-1593) | Điều tra và sửa lỗi trạng thái agent Architect | Cao | hoàn thành | Kỹ Sư DevOps | +| [TEC-1594](/TEC/issues/TEC-1594) | Hợp nhất các route i18n — xóa trùng lặp route không có locale | Cao | hoàn thành | Kỹ Sư Frontend Cao Cấp | +| [TEC-1595](/TEC/issues/TEC-1595) | Xây dựng Agent Portal — hệ thống inquiry, theo dõi lead, chất lượng | Cao | hoàn thành | Kỹ Sư Backend Cao Cấp | +| [TEC-1596](/TEC/issues/TEC-1596) | Tích hợp dịch vụ AI/ML — endpoint AVM, kiểm duyệt AI | Cao | hoàn thành | Kỹ Sư Backend Cao Cấp | +| [TEC-1597](/TEC/issues/TEC-1597) | Hoàn thiện luồng thanh toán — VNPay E2E + tích hợp MoMo | Cao | hoàn thành | Kỹ Sư Backend Cao Cấp | +| [TEC-1598](/TEC/issues/TEC-1598) | Thêm giai đoạn smoke test sau khi triển khai vào pipeline | Cao | hoàn thành | Kỹ Sư DevOps | +| [TEC-1599](/TEC/issues/TEC-1599) | Thêm test coverage cho các module health, mcp, metrics | Trung bình | hoàn thành | Kỹ Sư QA | +| [TEC-1600](/TEC/issues/TEC-1600) | Tạo tài liệu OpenAPI/Swagger | Trung bình | hoàn thành | Kỹ Sư Viết Tài Liệu | +| [TEC-1601](/TEC/issues/TEC-1601) | Chạy kiểm thử tải K6 cơ bản và thiết lập benchmarks | Trung bình | hoàn thành | Kỹ Sư SRE | +| [TEC-1602](/TEC/issues/TEC-1602) | Kiểm toán bảo mật — pen testing trên luồng auth và thanh toán | Trung bình | hoàn thành | Kỹ Sư Bảo Mật | +| [TEC-1603](/TEC/issues/TEC-1603) | Xem xét tối ưu hóa index cơ sở dữ liệu | Trung bình | hoàn thành | Kiến Trúc Sư Cơ Sở Dữ Liệu | +| [TEC-1604](/TEC/issues/TEC-1604) | Thiết lập tích hợp theo dõi lỗi Sentry | Trung bình | hoàn thành | Kỹ Sư Hạ Tầng | +| [TEC-1639](/TEC/issues/TEC-1639) | Thêm auth guards vào MCP Transport Controller | Quan trọng | hoàn thành | Kỹ Sư Bảo Mật | +| [TEC-1640](/TEC/issues/TEC-1640) | Cải thiện xử lý lỗi bất đồng bộ trong các module quan trọng | Cao | hoàn thành | Kỹ Sư Backend Cao Cấp | +| [TEC-1641](/TEC/issues/TEC-1641) | Thêm giới hạn kích thước đầu vào cho upload file | Cao | hoàn thành | Kỹ Sư Backend Cao Cấp | + +## Giai Đoạn 7: Cải Tiến Sau MVP & Tăng Cường Sản Xuất (P0-P2) + +### Wave 1 — Sửa Lỗi Quan Trọng + +| Vấn Đề | Tiêu Đề | Ưu Tiên | Trạng Thái | Người Phụ Trách | +| -------------------------------- | -------------------------------------------------------------------- | ---------- | ---------- | ------------------------- | +| [TEC-1647](/TEC/issues/TEC-1647) | Sửa routing module Reviews — tất cả route /reviews/* trả về 404 | Quan trọng | hoàn thành | Kỹ Sư Backend Cao Cấp | +| [TEC-1648](/TEC/issues/TEC-1648) | Sửa endpoint kiểm tra sức khỏe — /health và /ready trả về 404 | Quan trọng | hoàn thành | Kỹ Sư Backend Cao Cấp | +| [TEC-1649](/TEC/issues/TEC-1649) | Xác minh và sửa xử lý lỗi Đăng Nhập — 500 → 401 | Quan trọng | hoàn thành | Kỹ Sư Backend Cao Cấp | +| [TEC-1650](/TEC/issues/TEC-1650) | Sửa chi tiết Listing — ID không tồn tại trả về 500 → 404 | Cao | cần làm | Kỹ Sư Backend Cao Cấp | + +### Wave 2 — Sẵn Sàng Sản Xuất + +| Vấn Đề | Tiêu Đề | Ưu Tiên | Trạng Thái | Người Phụ Trách | +| -------------------------------- | -------------------------------------------------------------------- | ---------- | ---------- | ------------------------- | +| [TEC-1651](/TEC/issues/TEC-1651) | Thiết lập môi trường Docker Compose CI cho E2E tests | Cao | hoàn thành | Kỹ Sư DevOps | +| [TEC-1652](/TEC/issues/TEC-1652) | Chạy và xác minh tất cả 29 E2E tests với môi trường đầy đủ | Cao | cần làm | Kỹ Sư QA | +| [TEC-1653](/TEC/issues/TEC-1653) | Kiểm toán security headers — CSP, HSTS, X-Frame-Options | Cao | hoàn thành | Kỹ Sư Bảo Mật | +| [TEC-1658](/TEC/issues/TEC-1658) | Thêm PgBouncer connection pooling cho môi trường sản xuất | Cao | hoàn thành | Kiến Trúc Sư Cơ Sở Dữ Liệu | + +### Wave 3 — Chất Lượng Hướng Người Dùng + +| Vấn Đề | Tiêu Đề | Ưu Tiên | Trạng Thái | Người Phụ Trách | +| -------------------------------- | -------------------------------------------------------------------- | ---------- | ---------- | --------------------------- | +| [TEC-1654](/TEC/issues/TEC-1654) | Tối ưu hóa giao diện di động | Cao | hoàn thành | Kỹ Sư Frontend Cao Cấp | +| [TEC-1655](/TEC/issues/TEC-1655) | Tối ưu SEO — dữ liệu có cấu trúc, sitemap, meta tags | Cao | hoàn thành | Kỹ Sư Frontend Cao Cấp | +| [TEC-1656](/TEC/issues/TEC-1656) | Thêm rate limiting theo người dùng cho các route API đã xác thực | Cao | hoàn thành | Kỹ Sư Bảo Mật | +| [TEC-1657](/TEC/issues/TEC-1657) | Thêm ghi log kiểm toán cho các hành động quản trị | Cao | cần làm | Kỹ Sư Backend Cao Cấp | + +### Wave 4 — Xuất Sắc Kỹ Thuật + +| Vấn Đề | Tiêu Đề | Ưu Tiên | Trạng Thái | Người Phụ Trách | +| -------------------------------- | -------------------------------------------------------------------- | ---------- | ---------- | --------------------------- | +| [TEC-1659](/TEC/issues/TEC-1659) | Thêm xử lý suy giảm dần cho lỗi Typesense và Redis | Trung bình | hoàn thành | Kiến Trúc Sư | +| [TEC-1660](/TEC/issues/TEC-1660) | Ghi tài liệu tất cả mã lỗi API có cấu trúc | Trung bình | hoàn thành | Kỹ Sư Viết Tài Liệu | +| [TEC-1661](/TEC/issues/TEC-1661) | Thiết lập theo dõi RUM và Core Web Vitals | Trung bình | hoàn thành | Kỹ Sư SRE | +| [TEC-1662](/TEC/issues/TEC-1662) | Cập nhật QA_TRACKER.md — sửa số lượng test và trạng thái lỗi | Trung bình | hoàn thành | Kỹ Sư QA | + +### Wave 5 — Kiểm Toán CEO: Bảo Mật & Chất Lượng + +| Vấn Đề | Tiêu Đề | Ưu Tiên | Trạng Thái | Người Phụ Trách | +| -------------------------------- | -------------------------------------------------------------------- | ---------- | ---------- | --------------------------- | +| [TEC-1684](/TEC/issues/TEC-1684) | Sửa các lỗ hổng npm quan trọng (axios SSRF, Next.js CVEs) | Quan trọng | hoàn thành | Kỹ Sư Bảo Mật | +| [TEC-1685](/TEC/issues/TEC-1685) | Sửa lỗi lint trong resilient-search.repository.ts | Cao | hoàn thành | Kỹ Sư QA | +| [TEC-1686](/TEC/issues/TEC-1686) | Tăng test coverage cho listings, auth, search lên 50%+ | Cao | hoàn thành | Kỹ Sư QA | +| [TEC-1687](/TEC/issues/TEC-1687) | Thiết lập Dependabot cho cập nhật bảo mật tự động | Trung bình | hoàn thành | Kỹ Sư DevOps | +| [TEC-1688](/TEC/issues/TEC-1688) | Triển khai Saved Searches + Alerts (gap Sprint 3) | Cao | hoàn thành | Kiến Trúc Sư | + +### Wave 6 — Kiểm Toán CEO: Vệ Sinh Code, Chất Lượng Frontend, Tính Năng + +#### Wave 6A — Quan Trọng (P0) + +| Vấn Đề | Tiêu Đề | Ưu Tiên | Trạng Thái | Người Phụ Trách | +| -------------------------------- | -------------------------------------------------------------------- | ---------- | ---------- | --------------------------- | +| [TEC-1692](/TEC/issues/TEC-1692) | Commit 348 file chưa commit — bảo vệ công việc khỏi mất dữ liệu | Quan trọng | hoàn thành | Kỹ Sư Backend Cao Cấp | +| [TEC-1693](/TEC/issues/TEC-1693) | Sửa 729 lỗi ESLint — bỏ chặn pipeline CI | Quan trọng | hoàn thành | Kỹ Sư Backend Cao Cấp | +| [TEC-1694](/TEC/issues/TEC-1694) | Tạo trang /pricing — hoàn thiện phễu đăng ký | Quan trọng | cần làm | Kỹ Sư Frontend Cao Cấp | + +#### Wave 6B — Ưu Tiên Cao (P1) + +| Vấn Đề | Tiêu Đề | Ưu Tiên | Trạng Thái | Người Phụ Trách | +| -------------------------------- | -------------------------------------------------------------------- | ---------- | ---------- | --------------------------- | +| [TEC-1695](/TEC/issues/TEC-1695) | Kiểm toán khả năng tiếp cận frontend + sửa ARIA | Cao | cần làm | Kỹ Sư Frontend Cao Cấp | +| [TEC-1696](/TEC/issues/TEC-1696) | Sửa test Reviews + tăng test coverage frontend lên 40% | Cao | cần làm | Kỹ Sư QA | +| [TEC-1697](/TEC/issues/TEC-1697) | Hoàn thiện giao diện di động — lượt rà soát cuối trên tất cả 22 trang | Cao | cần làm | Nhà Thiết Kế UX/UI | + +#### Wave 6C — Ưu Tiên Trung Bình (P2) + +| Vấn Đề | Tiêu Đề | Ưu Tiên | Trạng Thái | Người Phụ Trách | +| -------------------------------- | -------------------------------------------------------------------- | ---------- | ---------------- | --------------------------- | +| [TEC-1698](/TEC/issues/TEC-1698) | Hiệu năng frontend — kiểm toán next/image + Server Component | Trung bình | đang thực hiện | Kỹ Sư Frontend Cao Cấp | +| [TEC-1699](/TEC/issues/TEC-1699) | Cảnh báo email tìm kiếm đã lưu — tính năng giữ chân người dùng | Trung bình | cần làm | Kỹ Sư Backend Cao Cấp | + +### Wave 7 — Kiểm Toán CEO (2026-04-10) + +#### Wave 7A — Quan Trọng (P0) + +| Vấn Đề | Tiêu Đề | Ưu Tiên | Trạng Thái | Người Phụ Trách | +| -------------------------------- | -------------------------------------------------------------------- | ---------- | ---------- | --------------------------- | +| [TEC-1703](/TEC/issues/TEC-1703) | Sửa timeout HashedPassword.vo.spec.ts — khôi phục CI xanh | Quan trọng | hoàn thành | Kỹ Sư QA | + +#### Wave 7B — Ưu Tiên Cao (P1) + +| Vấn Đề | Tiêu Đề | Ưu Tiên | Trạng Thái | Người Phụ Trách | +| -------------------------------- | -------------------------------------------------------------------- | ---------- | ---------- | --------------------------- | +| [TEC-1704](/TEC/issues/TEC-1704) | Định dạng giá tiếng Việt — hiển thị 3.5 tỷ, 150 triệu/m² | Cao | cần làm | Kỹ Sư Frontend Cao Cấp | +| [TEC-1705](/TEC/issues/TEC-1705) | Hợp nhất 18 file kiểm toán từ root vào docs/audits/ | Cao | cần làm | Kỹ Sư Viết Tài Liệu | + +#### Wave 7C — Ưu Tiên Trung Bình (P2) + +| Vấn Đề | Tiêu Đề | Ưu Tiên | Trạng Thái | Người Phụ Trách | +| -------------------------------- | -------------------------------------------------------------------- | ---------- | ---------- | --------------------------- | +| [TEC-1706](/TEC/issues/TEC-1706) | Xây dựng trang so sánh bất động sản — frontend cho MCP compare | Trung bình | cần làm | Kỹ Sư Frontend Cao Cấp | +| [TEC-1707](/TEC/issues/TEC-1707) | Tạo trang hồ sơ công khai của agent tại /agents/[id] | Trung bình | cần làm | Kỹ Sư Frontend Cao Cấp | +| [TEC-1708](/TEC/issues/TEC-1708) | Thêm lightbox image gallery vào trang chi tiết bất động sản | Trung bình | cần làm | Kỹ Sư Frontend Cao Cấp | +| [TEC-1709](/TEC/issues/TEC-1709) | Tạo dashboard Grafana để theo dõi độ trễ API | Trung bình | cần làm | Kỹ Sư SRE | +| [TEC-1710](/TEC/issues/TEC-1710) | Tự động hóa xác minh khôi phục sao lưu cơ sở dữ liệu | Trung bình | cần làm | Kiến Trúc Sư Cơ Sở Dữ Liệu | +| [TEC-1711](/TEC/issues/TEC-1711) | Hợp nhất tài liệu dự án — cập nhật README + tài liệu API | Trung bình | cần làm | Kỹ Sư Viết Tài Liệu | -### Wave 8 — CEO Audit: Code Hygiene, Backend Hardening, Quality (2026-04-11) +### Wave 8 — Kiểm Toán CEO: Vệ Sinh Code, Tăng Cường Backend, Chất Lượng (2026-04-11) -#### Wave 8A — Critical (P0) - -| Issue | Title | Priority | Status | Assignee | -| -------------------------------- | ------------------------------------------------------------ | -------- | ------ | ------------------------- | -| [TEC-1733](/TEC/issues/TEC-1733) | Fix 2 TypeScript errors in OAuth callback tests | Critical | todo | QA Engineer | -| [TEC-1734](/TEC/issues/TEC-1734) | Fix 9 remaining ESLint errors across web and e2e | Critical | todo | Senior Frontend Engineer | -| [TEC-1735](/TEC/issues/TEC-1735) | Commit all 56 uncommitted changes | Critical | todo | Senior Backend Engineer | +#### Wave 8A — Quan Trọng (P0) + +| Vấn Đề | Tiêu Đề | Ưu Tiên | Trạng Thái | Người Phụ Trách | +| -------------------------------- | -------------------------------------------------------------------- | ---------- | ---------- | --------------------------- | +| [TEC-1733](/TEC/issues/TEC-1733) | Sửa 2 lỗi TypeScript trong test OAuth callback | Quan trọng | cần làm | Kỹ Sư QA | +| [TEC-1734](/TEC/issues/TEC-1734) | Sửa 9 lỗi ESLint còn lại trong web và e2e | Quan trọng | cần làm | Kỹ Sư Frontend Cao Cấp | +| [TEC-1735](/TEC/issues/TEC-1735) | Commit tất cả 56 thay đổi chưa được commit | Quan trọng | cần làm | Kỹ Sư Backend Cao Cấp | -#### Wave 8B — High Priority (P1) +#### Wave 8B — Ưu Tiên Cao (P1) -| Issue | Title | Priority | Status | Assignee | -| -------------------------------- | ------------------------------------------------------------ | -------- | ------ | ------------------------- | -| [TEC-1736](/TEC/issues/TEC-1736) | Add error handling to remaining backend CQRS handlers | High | todo | Senior Backend Engineer | -| [TEC-1737](/TEC/issues/TEC-1737) | Increase backend test coverage for admin, leads, inquiries, reviews | High | todo | QA Engineer | -| [TEC-1738](/TEC/issues/TEC-1738) | Add cascade delete to Prisma foreign keys | High | todo | Database Architect | -| [TEC-1739](/TEC/issues/TEC-1739) | Add per-endpoint API rate limiting with Redis sliding window | High | todo | Security Engineer | +| Vấn Đề | Tiêu Đề | Ưu Tiên | Trạng Thái | Người Phụ Trách | +| -------------------------------- | -------------------------------------------------------------------- | ---------- | ---------- | --------------------------- | +| [TEC-1736](/TEC/issues/TEC-1736) | Thêm xử lý lỗi cho các handler CQRS backend còn lại | Cao | cần làm | Kỹ Sư Backend Cao Cấp | +| [TEC-1737](/TEC/issues/TEC-1737) | Tăng test coverage backend cho admin, leads, inquiries, reviews | Cao | cần làm | Kỹ Sư QA | +| [TEC-1738](/TEC/issues/TEC-1738) | Thêm cascade delete vào các foreign key Prisma | Cao | cần làm | Kiến Trúc Sư Cơ Sở Dữ Liệu | +| [TEC-1739](/TEC/issues/TEC-1739) | Thêm rate limiting API theo endpoint với Redis sliding window | Cao | cần làm | Kỹ Sư Bảo Mật | -#### Wave 8C — Medium/Low Priority (P2/P3) +#### Wave 8C — Ưu Tiên Trung Bình/Thấp (P2/P3) -| Issue | Title | Priority | Status | Assignee | -| -------------------------------- | ------------------------------------------------------------ | -------- | ------ | ------------------------- | -| [TEC-1740](/TEC/issues/TEC-1740) | DTO validation hardening — phone format, password strength | Medium | todo | Senior Backend Engineer | -| [TEC-1741](/TEC/issues/TEC-1741) | Create operational runbook for production incidents | Medium | todo | SRE Engineer | -| [TEC-1742](/TEC/issues/TEC-1742) | Frontend image optimization — next/image responsive sizes | Medium | todo | Senior Frontend Engineer | -| [TEC-1743](/TEC/issues/TEC-1743) | Create one-command bootstrap dev setup script | Low | todo | DevOps Engineer | +| Vấn Đề | Tiêu Đề | Ưu Tiên | Trạng Thái | Người Phụ Trách | +| -------------------------------- | -------------------------------------------------------------------- | ---------- | ---------- | --------------------------- | +| [TEC-1740](/TEC/issues/TEC-1740) | Tăng cường xác thực DTO — định dạng số điện thoại, độ mạnh mật khẩu | Trung bình | cần làm | Kỹ Sư Backend Cao Cấp | +| [TEC-1741](/TEC/issues/TEC-1741) | Tạo runbook vận hành cho các sự cố sản xuất | Trung bình | cần làm | Kỹ Sư SRE | +| [TEC-1742](/TEC/issues/TEC-1742) | Tối ưu hóa hình ảnh frontend — kích thước responsive next/image | Trung bình | cần làm | Kỹ Sư Frontend Cao Cấp | +| [TEC-1743](/TEC/issues/TEC-1743) | Tạo script bootstrap thiết lập dev bằng một lệnh | Thấp | cần làm | Kỹ Sư DevOps | -### Wave 8 Status Updates +### Cập Nhật Trạng Thái Wave 8 -| Issue | Title | Priority | Status | Notes | -| -------------------------------- | ------------------------------------------------------------ | -------- | ------ | ----- | -| [TEC-1693](/TEC/issues/TEC-1693) | Fix 729 ESLint errors | Critical | done | Fixed in `0593d40` | -| [TEC-1734](/TEC/issues/TEC-1734) | Fix 9 remaining ESLint errors | Critical | done | Fixed in `0593d40` | -| [TEC-1738](/TEC/issues/TEC-1738) | Add cascade delete to Prisma FKs | High | done | Fixed in `45e48c0` | -| [TEC-1739](/TEC/issues/TEC-1739) | Per-endpoint API rate limiting | High | done | Fixed in `d824d16` | -| [TEC-1741](/TEC/issues/TEC-1741) | Operational runbook | Medium | done | Fixed in `f27b13f` | -| [TEC-1743](/TEC/issues/TEC-1743) | One-command bootstrap dev setup | Low | done | Fixed in `b7f9664` | +| Vấn Đề | Tiêu Đề | Ưu Tiên | Trạng Thái | Ghi Chú | +| -------------------------------- | -------------------------------------------------------------------- | ---------- | ---------- | ------- | +| [TEC-1693](/TEC/issues/TEC-1693) | Sửa 729 lỗi ESLint | Quan trọng | hoàn thành | Sửa trong `0593d40` | +| [TEC-1734](/TEC/issues/TEC-1734) | Sửa 9 lỗi ESLint còn lại | Quan trọng | hoàn thành | Sửa trong `0593d40` | +| [TEC-1738](/TEC/issues/TEC-1738) | Thêm cascade delete vào Prisma FKs | Cao | hoàn thành | Sửa trong `45e48c0` | +| [TEC-1739](/TEC/issues/TEC-1739) | Rate limiting API theo endpoint | Cao | hoàn thành | Sửa trong `d824d16` | +| [TEC-1741](/TEC/issues/TEC-1741) | Runbook vận hành | Trung bình | hoàn thành | Sửa trong `f27b13f` | +| [TEC-1743](/TEC/issues/TEC-1743) | Bootstrap thiết lập dev bằng một lệnh | Thấp | hoàn thành | Sửa trong `b7f9664` | -## Phase 7 — Wave 9: CEO Audit (2026-04-11) +## Giai Đoạn 7 — Wave 9: Kiểm Toán CEO (2026-04-11) -#### Wave 9A — Critical / High Priority (P0/P1) +#### Wave 9A — Quan Trọng / Ưu Tiên Cao (P0/P1) -| Issue | Title | Priority | Status | Assignee | -| -------------------------------- | ------------------------------------------------------------ | -------- | ------ | ------------------------- | -| [TEC-1774](/TEC/issues/TEC-1774) | Fix 2 TypeScript compile errors blocking CI typecheck | Critical | done | Senior Backend Engineer | -| [TEC-1735](/TEC/issues/TEC-1735) | Commit 105 uncommitted file changes | Critical | done | Senior Backend Engineer | -| [TEC-1775](/TEC/issues/TEC-1775) | Add unit tests for MCP, Inquiries, and Leads modules | High | done | QA Engineer | -| [TEC-1736](/TEC/issues/TEC-1736) | Add error handling to remaining backend CQRS handlers | High | done | Senior Backend Engineer | +| Vấn Đề | Tiêu Đề | Ưu Tiên | Trạng Thái | Người Phụ Trách | +| -------------------------------- | -------------------------------------------------------------------- | ---------- | ---------- | --------------------------- | +| [TEC-1774](/TEC/issues/TEC-1774) | Sửa 2 lỗi biên dịch TypeScript chặn CI typecheck | Quan trọng | hoàn thành | Kỹ Sư Backend Cao Cấp | +| [TEC-1735](/TEC/issues/TEC-1735) | Commit 105 thay đổi file chưa được commit | Quan trọng | hoàn thành | Kỹ Sư Backend Cao Cấp | +| [TEC-1775](/TEC/issues/TEC-1775) | Thêm unit tests cho các module MCP, Inquiries và Leads | Cao | hoàn thành | Kỹ Sư QA | +| [TEC-1736](/TEC/issues/TEC-1736) | Thêm xử lý lỗi cho các handler CQRS backend còn lại | Cao | hoàn thành | Kỹ Sư Backend Cao Cấp | -#### Wave 9B — Medium Priority (P2) +#### Wave 9B — Ưu Tiên Trung Bình (P2) -| Issue | Title | Priority | Status | Assignee | -| -------------------------------- | ------------------------------------------------------------ | -------- | ------ | ------------------------- | -| [TEC-1776](/TEC/issues/TEC-1776) | Refactor 3 oversized files exceeding 220 LOC | Medium | todo | Senior Backend Engineer | -| [TEC-1777](/TEC/issues/TEC-1777) | Implement agent quality score auto-calculation cron | Medium | todo | Senior Backend Engineer | -| [TEC-1778](/TEC/issues/TEC-1778) | Add staging environment auto-deploy pipeline | Medium | done | DevOps Engineer | -| [TEC-1740](/TEC/issues/TEC-1740) | DTO validation hardening | Medium | todo | Senior Backend Engineer | -| [TEC-1699](/TEC/issues/TEC-1699) | Implement saved search email alerts | Medium | done | Senior Backend Engineer | -| [TEC-1708](/TEC/issues/TEC-1708) | Add lightbox image gallery to property detail | Medium | done | Senior Frontend Engineer | +| Vấn Đề | Tiêu Đề | Ưu Tiên | Trạng Thái | Người Phụ Trách | +| -------------------------------- | -------------------------------------------------------------------- | ---------- | ---------- | --------------------------- | +| [TEC-1776](/TEC/issues/TEC-1776) | Tái cấu trúc 3 file quá lớn vượt quá 220 LOC | Trung bình | cần làm | Kỹ Sư Backend Cao Cấp | +| [TEC-1777](/TEC/issues/TEC-1777) | Triển khai cron tự động tính điểm chất lượng agent | Trung bình | cần làm | Kỹ Sư Backend Cao Cấp | +| [TEC-1778](/TEC/issues/TEC-1778) | Thêm pipeline auto-deploy cho môi trường staging | Trung bình | hoàn thành | Kỹ Sư DevOps | +| [TEC-1740](/TEC/issues/TEC-1740) | Tăng cường xác thực DTO | Trung bình | cần làm | Kỹ Sư Backend Cao Cấp | +| [TEC-1699](/TEC/issues/TEC-1699) | Triển khai cảnh báo email tìm kiếm đã lưu | Trung bình | hoàn thành | Kỹ Sư Backend Cao Cấp | +| [TEC-1708](/TEC/issues/TEC-1708) | Thêm lightbox image gallery vào chi tiết bất động sản | Trung bình | hoàn thành | Kỹ Sư Frontend Cao Cấp | -### Wave 10 — CEO Audit (2026-04-11) — Automated Routine +### Wave 10 — Kiểm Toán CEO (2026-04-11) — Quy Trình Tự Động -#### Wave 10A — Critical (P0) +#### Wave 10A — Quan Trọng (P0) -| Issue | Title | Priority | Status | Assignee | -| -------------------------------- | ------------------------------------------------------------ | -------- | ------ | ------------------------- | -| [TEC-1839](/TEC/issues/TEC-1839) | Commit 105 uncommitted files + Fix 2 TS compile errors | Critical | done | Senior Backend Engineer | +| Vấn Đề | Tiêu Đề | Ưu Tiên | Trạng Thái | Người Phụ Trách | +| -------------------------------- | -------------------------------------------------------------------- | ---------- | ---------- | --------------------------- | +| [TEC-1839](/TEC/issues/TEC-1839) | Commit 105 file chưa commit + Sửa 2 lỗi biên dịch TS | Quan trọng | hoàn thành | Kỹ Sư Backend Cao Cấp | -#### Wave 10B — High Priority (P1) +#### Wave 10B — Ưu Tiên Cao (P1) -| Issue | Title | Priority | Status | Assignee | -| -------------------------------- | ------------------------------------------------------------ | -------- | ------ | ------------------------- | -| [TEC-1840](/TEC/issues/TEC-1840) | Add unit tests for Agents, Inquiries, Leads, Reviews modules | High | done | QA Engineer | -| [TEC-1841](/TEC/issues/TEC-1841) | Fix login endpoint returning 500 instead of 401 | High | done | Senior Backend Engineer | -| [TEC-1736](/TEC/issues/TEC-1736) | Add error handling to remaining CQRS handlers | High | done | Senior Backend Engineer | -| [TEC-1846](/TEC/issues/TEC-1846) | Build Inquiry & Lead Management UI for Agent Portal | High | done | Senior Frontend Engineer | -| [TEC-1848](/TEC/issues/TEC-1848) | Create production runbook, alerting rules & DR validation | High | done | SRE Engineer | -| [TEC-1849](/TEC/issues/TEC-1849) | Expand K6 load test coverage: search, admin, MCP endpoints | High | done | SRE Engineer | +| Vấn Đề | Tiêu Đề | Ưu Tiên | Trạng Thái | Người Phụ Trách | +| -------------------------------- | -------------------------------------------------------------------- | ---------- | ---------- | --------------------------- | +| [TEC-1840](/TEC/issues/TEC-1840) | Thêm unit tests cho các module Agents, Inquiries, Leads, Reviews | Cao | hoàn thành | Kỹ Sư QA | +| [TEC-1841](/TEC/issues/TEC-1841) | Sửa endpoint đăng nhập trả về 500 thay vì 401 | Cao | hoàn thành | Kỹ Sư Backend Cao Cấp | +| [TEC-1736](/TEC/issues/TEC-1736) | Thêm xử lý lỗi cho các handler CQRS còn lại | Cao | hoàn thành | Kỹ Sư Backend Cao Cấp | +| [TEC-1846](/TEC/issues/TEC-1846) | Xây dựng UI Quản Lý Inquiry & Lead cho Agent Portal | Cao | hoàn thành | Kỹ Sư Frontend Cao Cấp | +| [TEC-1848](/TEC/issues/TEC-1848) | Tạo runbook sản xuất, quy tắc cảnh báo & xác thực DR | Cao | hoàn thành | Kỹ Sư SRE | +| [TEC-1849](/TEC/issues/TEC-1849) | Mở rộng K6 load test: endpoint search, admin, MCP | Cao | hoàn thành | Kỹ Sư SRE | -#### Wave 10C — Medium Priority (P2) +#### Wave 10C — Ưu Tiên Trung Bình (P2) -| Issue | Title | Priority | Status | Assignee | -| -------------------------------- | ------------------------------------------------------------ | -------- | ----------- | ------------------------- | -| [TEC-1842](/TEC/issues/TEC-1842) | Refactor Agents/Inquiries/Leads/Reviews to full DDD | Medium | in_progress | Architect | -| [TEC-1777](/TEC/issues/TEC-1777) | Implement agent quality score auto-calculation cron | Medium | todo | Senior Backend Engineer | -| [TEC-1778](/TEC/issues/TEC-1778) | Add staging environment auto-deploy pipeline | Medium | done | DevOps Engineer | -| [TEC-1699](/TEC/issues/TEC-1699) | Implement saved search email alerts | Medium | done | Senior Backend Engineer | -| [TEC-1708](/TEC/issues/TEC-1708) | Add lightbox image gallery to property detail page | Medium | done | Senior Frontend Engineer | +| Vấn Đề | Tiêu Đề | Ưu Tiên | Trạng Thái | Người Phụ Trách | +| -------------------------------- | -------------------------------------------------------------------- | ---------- | ---------------- | --------------------------- | +| [TEC-1842](/TEC/issues/TEC-1842) | Tái cấu trúc Agents/Inquiries/Leads/Reviews sang DDD đầy đủ | Trung bình | đang thực hiện | Kiến Trúc Sư | +| [TEC-1777](/TEC/issues/TEC-1777) | Triển khai cron tự động tính điểm chất lượng agent | Trung bình | cần làm | Kỹ Sư Backend Cao Cấp | +| [TEC-1778](/TEC/issues/TEC-1778) | Thêm pipeline auto-deploy cho môi trường staging | Trung bình | hoàn thành | Kỹ Sư DevOps | +| [TEC-1699](/TEC/issues/TEC-1699) | Triển khai cảnh báo email tìm kiếm đã lưu | Trung bình | hoàn thành | Kỹ Sư Backend Cao Cấp | +| [TEC-1708](/TEC/issues/TEC-1708) | Thêm lightbox image gallery vào trang chi tiết bất động sản | Trung bình | hoàn thành | Kỹ Sư Frontend Cao Cấp | -### Wave 11 — CEO Audit (2026-04-11) — Automated Routine +### Wave 11 — Kiểm Toán CEO (2026-04-11) — Quy Trình Tự Động -#### Wave 11A — Critical (P0) +#### Wave 11A — Quan Trọng (P0) -| Issue | Title | Priority | Status | Assignee | -| -------------------------------- | ------------------------------------------------------------ | -------- | ------ | ------------------------- | -| [TEC-1876](/TEC/issues/TEC-1876) | Fix 9 ESLint errors — consistent-type-imports + unused vars | Critical | done | Senior Backend Engineer | -| [TEC-1877](/TEC/issues/TEC-1877) | Commit 59 uncommitted files (17 modified + 42 untracked) | Critical | done | Senior Backend Engineer | +| Vấn Đề | Tiêu Đề | Ưu Tiên | Trạng Thái | Người Phụ Trách | +| -------------------------------- | -------------------------------------------------------------------- | ---------- | ---------- | --------------------------- | +| [TEC-1876](/TEC/issues/TEC-1876) | Sửa 9 lỗi ESLint — consistent-type-imports + biến không dùng | Quan trọng | hoàn thành | Kỹ Sư Backend Cao Cấp | +| [TEC-1877](/TEC/issues/TEC-1877) | Commit 59 file chưa commit (17 đã sửa + 42 chưa theo dõi) | Quan trọng | hoàn thành | Kỹ Sư Backend Cao Cấp | -#### Wave 11B — High Priority (P1) +#### Wave 11B — Ưu Tiên Cao (P1) -| Issue | Title | Priority | Status | Assignee | -| -------------------------------- | ------------------------------------------------------------ | -------- | ------- | ------------------------- | -| [TEC-1878](/TEC/issues/TEC-1878) | Investigate and unblock E2E test environment (TEC-1652) | High | todo | DevOps Engineer | -| [TEC-1547](/TEC/issues/TEC-1547) | E2E Integration Verification — Full MVP Happy Path | High | cancelled | QA Engineer (duplicate of TEC-1652) | -| [TEC-1847](/TEC/issues/TEC-1847) | Add React component tests (RTL) for critical components | Medium | todo | QA Engineer | +| Vấn Đề | Tiêu Đề | Ưu Tiên | Trạng Thái | Người Phụ Trách | +| -------------------------------- | -------------------------------------------------------------------- | ---------- | ------------ | --------------------------- | +| [TEC-1878](/TEC/issues/TEC-1878) | Điều tra và bỏ chặn môi trường E2E test (TEC-1652) | Cao | cần làm | Kỹ Sư DevOps | +| [TEC-1547](/TEC/issues/TEC-1547) | Xác Minh Tích Hợp E2E — Happy Path MVP Đầy Đủ | Cao | đã huỷ | Kỹ Sư QA (trùng với TEC-1652) | +| [TEC-1847](/TEC/issues/TEC-1847) | Thêm test React component (RTL) cho các component quan trọng | Trung bình | cần làm | Kỹ Sư QA | -#### Wave 11C — Medium Priority (P2) — Carryover +#### Wave 11C — Ưu Tiên Trung Bình (P2) — Chuyển Tiếp -| Issue | Title | Priority | Status | Assignee | -| -------------------------------- | ------------------------------------------------------------ | -------- | ----------- | ------------------------- | -| [TEC-1842](/TEC/issues/TEC-1842) | Refactor Agents/Inquiries/Leads/Reviews to full DDD | Medium | in_progress | Architect | -| [TEC-1777](/TEC/issues/TEC-1777) | Implement agent quality score auto-calculation cron | Medium | todo | Senior Backend Engineer | -| [TEC-1776](/TEC/issues/TEC-1776) | Refactor 3 oversized files exceeding 220 LOC | Medium | todo | Senior Backend Engineer | -| [TEC-1740](/TEC/issues/TEC-1740) | DTO validation hardening — phone, password, email | Medium | todo | Senior Backend Engineer | +| Vấn Đề | Tiêu Đề | Ưu Tiên | Trạng Thái | Người Phụ Trách | +| -------------------------------- | -------------------------------------------------------------------- | ---------- | ---------------- | --------------------------- | +| [TEC-1842](/TEC/issues/TEC-1842) | Tái cấu trúc Agents/Inquiries/Leads/Reviews sang DDD đầy đủ | Trung bình | đang thực hiện | Kiến Trúc Sư | +| [TEC-1777](/TEC/issues/TEC-1777) | Triển khai cron tự động tính điểm chất lượng agent | Trung bình | cần làm | Kỹ Sư Backend Cao Cấp | +| [TEC-1776](/TEC/issues/TEC-1776) | Tái cấu trúc 3 file quá lớn vượt quá 220 LOC | Trung bình | cần làm | Kỹ Sư Backend Cao Cấp | +| [TEC-1740](/TEC/issues/TEC-1740) | Tăng cường xác thực DTO — điện thoại, mật khẩu, email | Trung bình | cần làm | Kỹ Sư Backend Cao Cấp | -### Wave 11D — CEO Full Audit Subtasks (2026-04-11) +### Wave 11D — Subtask Kiểm Toán CEO Toàn Diện (2026-04-11) -Parent task: [TEC-1882](/TEC/issues/TEC-1882) — GoodGo Platform AI CEO Audit +Task cha: [TEC-1882](/TEC/issues/TEC-1882) — GoodGo Platform AI CEO Audit -#### Wave 11D-Critical — Fix Build Pipeline (P0) +#### Wave 11D-Quan Trọng — Sửa Pipeline Build (P0) -| Issue | Title | Priority | Status | Assignee | -| -------------------------------- | ---------------------------------------------------------------- | -------- | ------ | ------------------------- | -| [TEC-1888](/TEC/issues/TEC-1888) | Fix 725 ESLint errors and TypeScript compilation errors in web | Critical | todo | Senior Frontend Engineer | -| [TEC-1889](/TEC/issues/TEC-1889) | Fix 27 failing rate limit guard unit tests in shared module | Critical | todo | Senior Backend Engineer | +| Vấn Đề | Tiêu Đề | Ưu Tiên | Trạng Thái | Người Phụ Trách | +| -------------------------------- | ------------------------------------------------------------------------ | ---------- | ---------- | --------------------------- | +| [TEC-1888](/TEC/issues/TEC-1888) | Sửa 725 lỗi ESLint và lỗi biên dịch TypeScript trong web | Quan trọng | cần làm | Kỹ Sư Frontend Cao Cấp | +| [TEC-1889](/TEC/issues/TEC-1889) | Sửa 27 unit test rate limit guard đang fail trong shared module | Quan trọng | cần làm | Kỹ Sư Backend Cao Cấp | -#### Wave 12 — Module Completion (P1) +#### Wave 12 — Hoàn Thiện Module (P1) -| Issue | Title | Priority | Status | Assignee | -| -------------------------------- | ---------------------------------------------------------------- | -------- | ------ | ------------------------- | -| [TEC-1890](/TEC/issues/TEC-1890) | Complete 3 incomplete API modules (health, metrics, MCP) | High | todo | Senior Backend Engineer | -| [TEC-1891](/TEC/issues/TEC-1891) | Implement production MCP servers (search, analytics, valuation) | High | todo | Senior Backend Engineer | +| Vấn Đề | Tiêu Đề | Ưu Tiên | Trạng Thái | Người Phụ Trách | +| -------------------------------- | ------------------------------------------------------------------------ | ---------- | ---------- | --------------------------- | +| [TEC-1890](/TEC/issues/TEC-1890) | Hoàn thiện 3 API module chưa đầy đủ (health, metrics, MCP) | Cao | cần làm | Kỹ Sư Backend Cao Cấp | +| [TEC-1891](/TEC/issues/TEC-1891) | Triển khai MCP servers sản xuất (search, analytics, valuation) | Cao | cần làm | Kỹ Sư Backend Cao Cấp | -#### Wave 13 — Quality & Security (P1-P2) +#### Wave 13 — Chất Lượng & Bảo Mật (P1-P2) -| Issue | Title | Priority | Status | Assignee | -| -------------------------------- | ---------------------------------------------------------------- | -------- | ------ | ------------------------- | -| [TEC-1892](/TEC/issues/TEC-1892) | Expand web component unit tests to 50% coverage | High | todo | Senior Frontend Engineer | -| [TEC-1893](/TEC/issues/TEC-1893) | Implement field-level encryption for PII and payment data | High | todo | Security Engineer | -| [TEC-1894](/TEC/issues/TEC-1894) | Add TOTP-based MFA support for agent and admin accounts | Medium | todo | Security Engineer | +| Vấn Đề | Tiêu Đề | Ưu Tiên | Trạng Thái | Người Phụ Trách | +| -------------------------------- | ------------------------------------------------------------------------ | ---------- | ---------- | --------------------------- | +| [TEC-1892](/TEC/issues/TEC-1892) | Mở rộng unit tests web component lên 50% coverage | Cao | cần làm | Kỹ Sư Frontend Cao Cấp | +| [TEC-1893](/TEC/issues/TEC-1893) | Triển khai mã hóa cấp trường cho PII và dữ liệu thanh toán | Cao | cần làm | Kỹ Sư Bảo Mật | +| [TEC-1894](/TEC/issues/TEC-1894) | Thêm hỗ trợ MFA dựa trên TOTP cho tài khoản agent và admin | Trung bình | cần làm | Kỹ Sư Bảo Mật | -### Wave 12 — CEO Audit (2026-04-11) — CI Pipeline Fix +### Wave 12 — Kiểm Toán CEO (2026-04-11) — Sửa Pipeline CI -Parent task: [TEC-1895](/TEC/issues/TEC-1895) — GoodGo Platform AI +Task cha: [TEC-1895](/TEC/issues/TEC-1895) — GoodGo Platform AI -#### Wave 12A — Fix CI Pipeline (P0) +#### Wave 12A — Sửa Pipeline CI (P0) -| Issue | Title | Priority | Status | Assignee | -| -------------------------------- | ---------------------------------------------------------------- | -------- | ------ | ------------------------- | -| [TEC-1898](/TEC/issues/TEC-1898) | Fix Prisma 7 migration: replace $use() middleware with $extends | Critical | done | Senior Backend Engineer | -| [TEC-1899](/TEC/issues/TEC-1899) | Fix 31 failing unit tests (rate-limit guards + auth repo) | Critical | done | QA Engineer | -| [TEC-1900](/TEC/issues/TEC-1900) | Fix 4 ESLint errors and commit 91 uncommitted files | Critical | done | Senior Backend Engineer | +| Vấn Đề | Tiêu Đề | Ưu Tiên | Trạng Thái | Người Phụ Trách | +| -------------------------------- | ------------------------------------------------------------------------ | ---------- | ---------- | --------------------------- | +| [TEC-1898](/TEC/issues/TEC-1898) | Sửa migration Prisma 7: thay $use() middleware bằng $extends | Quan trọng | hoàn thành | Kỹ Sư Backend Cao Cấp | +| [TEC-1899](/TEC/issues/TEC-1899) | Sửa 31 unit test đang fail (rate-limit guards + auth repo) | Quan trọng | hoàn thành | Kỹ Sư QA | +| [TEC-1900](/TEC/issues/TEC-1900) | Sửa 4 lỗi ESLint và commit 91 file chưa commit | Quan trọng | hoàn thành | Kỹ Sư Backend Cao Cấp | -#### Wave 12B — Bug Fixes & Feature Completion (P1) — Carryover +#### Wave 12B — Sửa Lỗi & Hoàn Thiện Tính Năng (P1) — Chuyển Tiếp -| Issue | Title | Priority | Status | Assignee | -| -------------------------------- | ---------------------------------------------------------------- | -------- | ----------- | ------------------------- | -| [TEC-1649](/TEC/issues/TEC-1649) | Fix login endpoint returning 500 instead of 401 | High | done | Senior Backend Engineer | -| [TEC-1657](/TEC/issues/TEC-1657) | Add audit logging for admin actions | High | todo | Senior Backend Engineer | -| [TEC-1878](/TEC/issues/TEC-1878) | Investigate and unblock E2E test environment | High | todo | DevOps Engineer | -| [TEC-1847](/TEC/issues/TEC-1847) | Add React component tests (RTL) for critical components | Medium | todo | QA Engineer | +| Vấn Đề | Tiêu Đề | Ưu Tiên | Trạng Thái | Người Phụ Trách | +| -------------------------------- | ------------------------------------------------------------------------ | ---------- | ---------------- | --------------------------- | +| [TEC-1649](/TEC/issues/TEC-1649) | Sửa endpoint đăng nhập trả về 500 thay vì 401 | Cao | hoàn thành | Kỹ Sư Backend Cao Cấp | +| [TEC-1657](/TEC/issues/TEC-1657) | Thêm ghi log kiểm toán cho các hành động quản trị | Cao | cần làm | Kỹ Sư Backend Cao Cấp | +| [TEC-1878](/TEC/issues/TEC-1878) | Điều tra và bỏ chặn môi trường E2E test | Cao | cần làm | Kỹ Sư DevOps | +| [TEC-1847](/TEC/issues/TEC-1847) | Thêm test React component (RTL) cho các component quan trọng | Trung bình | cần làm | Kỹ Sư QA | -### Wave 13 — CEO Audit (2026-04-12) — Automated Routine +### Wave 13 — Kiểm Toán CEO (2026-04-12) — Quy Trình Tự Động -Parent task: [TEC-1915](/TEC/issues/TEC-1915) — Goodgo Platform AI +Task cha: [TEC-1915](/TEC/issues/TEC-1915) — Goodgo Platform AI -#### Wave 13A — Critical (P0) +#### Wave 13A — Quan Trọng (P0) -| Issue | Title | Priority | Status | Assignee | -| -------------------------------- | ---------------------------------------------------------------- | -------- | ------ | ------------------------- | -| [TEC-1918](/TEC/issues/TEC-1918) | Fix 7 TypeScript compile errors in web test files — add vitest types | Critical | done | Senior Backend Engineer | +| Vấn Đề | Tiêu Đề | Ưu Tiên | Trạng Thái | Người Phụ Trách | +| -------------------------------- | ------------------------------------------------------------------------ | ---------- | ---------- | --------------------------- | +| [TEC-1918](/TEC/issues/TEC-1918) | Sửa 7 lỗi biên dịch TypeScript trong file test web — thêm vitest types | Quan trọng | hoàn thành | Kỹ Sư Backend Cao Cấp | -#### Wave 13B — High Priority (P1) +#### Wave 13B — Ưu Tiên Cao (P1) -| Issue | Title | Priority | Status | Assignee | -| -------------------------------- | ---------------------------------------------------------------- | -------- | ------ | ------------------------- | -| [TEC-1919](/TEC/issues/TEC-1919) | Unblock E2E test environment and run full MVP happy-path tests | High | todo | DevOps Engineer | -| [TEC-1920](/TEC/issues/TEC-1920) | Backlog grooming — deduplicate and close resolved issues | High | done | QA Engineer | -| [TEC-1921](/TEC/issues/TEC-1921) | Complete /pricing page — connect subscription plans to checkout | High | todo | Senior Frontend Engineer | +| Vấn Đề | Tiêu Đề | Ưu Tiên | Trạng Thái | Người Phụ Trách | +| -------------------------------- | ------------------------------------------------------------------------ | ---------- | ---------- | --------------------------- | +| [TEC-1919](/TEC/issues/TEC-1919) | Bỏ chặn môi trường E2E test và chạy đầy đủ MVP happy-path tests | Cao | cần làm | Kỹ Sư DevOps | +| [TEC-1920](/TEC/issues/TEC-1920) | Chỉnh lý backlog — loại bỏ trùng lặp và đóng các vấn đề đã giải quyết | Cao | hoàn thành | Kỹ Sư QA | +| [TEC-1921](/TEC/issues/TEC-1921) | Hoàn thiện trang /pricing — kết nối gói đăng ký với checkout | Cao | cần làm | Kỹ Sư Frontend Cao Cấp | -#### Wave 13C — Medium Priority (P2) +#### Wave 13C — Ưu Tiên Trung Bình (P2) -| Issue | Title | Priority | Status | Assignee | -| -------------------------------- | ---------------------------------------------------------------- | -------- | ------ | ------------------------- | -| [TEC-1922](/TEC/issues/TEC-1922) | Create formal production readiness checklist and sign-off | Medium | todo | SRE Engineer | -| [TEC-1923](/TEC/issues/TEC-1923) | Update PROJECT_TRACKER.md with Wave 13 audit results | Medium | done | Technical Writer | +| Vấn Đề | Tiêu Đề | Ưu Tiên | Trạng Thái | Người Phụ Trách | +| -------------------------------- | ------------------------------------------------------------------------ | ---------- | ---------- | --------------------------- | +| [TEC-1922](/TEC/issues/TEC-1922) | Tạo checklist sẵn sàng sản xuất chính thức và ký duyệt | Trung bình | cần làm | Kỹ Sư SRE | +| [TEC-1923](/TEC/issues/TEC-1923) | Cập nhật PROJECT_TRACKER.md với kết quả kiểm toán Wave 13 | Trung bình | hoàn thành | Kỹ Sư Viết Tài Liệu | -### Wave 14 — CEO Audit (2026-04-12) — ✅ Build Green +### Wave 14 — Kiểm Toán CEO (2026-04-12) — ✅ Build Xanh -Parent task: [TEC-1970](/TEC/issues/TEC-1970) — Goodgo Platform AI +Task cha: [TEC-1970](/TEC/issues/TEC-1970) — Goodgo Platform AI -**Build Status: ALL GREEN** -- `pnpm typecheck` — 0 errors (3 packages) -- `pnpm lint` — 0 errors (after fixing 1 import order issue) -- `pnpm test` — 232 test files, 1454 tests all passing -- `pnpm build` — successful (API + Web + MCP servers) +**Trạng Thái Build: TẤT CẢ XANH** +- `pnpm typecheck` — 0 lỗi (3 package) +- `pnpm lint` — 0 lỗi (sau khi sửa 1 vấn đề thứ tự import) +- `pnpm test` — 232 file test, 1454 test đều pass +- `pnpm build` — thành công (API + Web + MCP servers) -**Platform Stats** -- 812+ TypeScript files in API (13 complete DDD modules) -- 89 React components, 28 routes in frontend -- 22 Prisma models, 16 migrations -- 333 test files total (232 unit, ~31 E2E + others) +**Thống Kê Nền Tảng** +- 812+ file TypeScript trong API (13 module DDD hoàn chỉnh) +- 89 React component, 28 route trong frontend +- 22 Prisma model, 16 migration +- 333 file test tổng cộng (232 unit, ~31 E2E + các loại khác) -#### Wave 14A — ESLint Fix (P1) +#### Wave 14A — Sửa ESLint (P1) -| Issue | Title | Priority | Status | Assignee | -| -------------------------------- | ---------------------------------------------------------------- | -------- | ------ | ------------------------- | -| [TEC-1971](/TEC/issues/TEC-1971) | Commit ESLint import order fix in postgres-search.repository.ts | High | done | Senior Backend Engineer | +| Vấn Đề | Tiêu Đề | Ưu Tiên | Trạng Thái | Người Phụ Trách | +| -------------------------------- | ------------------------------------------------------------------------ | ---------- | ---------- | --------------------------- | +| [TEC-1971](/TEC/issues/TEC-1971) | Commit sửa thứ tự import ESLint trong postgres-search.repository.ts | Cao | hoàn thành | Kỹ Sư Backend Cao Cấp | -*Fix committed in `836499c`.* +*Sửa được commit trong `836499c`.* -#### Wave 14B — Backlog Cleanup (P1) +#### Wave 14B — Dọn Dẹp Backlog (P1) -| Issue | Title | Priority | Status | Assignee | -| -------------------------------- | ---------------------------------------------------------------- | -------- | ----------- | ------------------------- | -| [TEC-1972](/TEC/issues/TEC-1972) | Close resolved issues and clean up backlog | High | in_progress | QA Engineer | +| Vấn Đề | Tiêu Đề | Ưu Tiên | Trạng Thái | Người Phụ Trách | +| -------------------------------- | ------------------------------------------------------------------------ | ---------- | ---------------- | --------------------------- | +| [TEC-1972](/TEC/issues/TEC-1972) | Đóng các vấn đề đã giải quyết và dọn dẹp backlog | Cao | đang thực hiện | Kỹ Sư QA | -#### Wave 14C — Documentation (P2) +#### Wave 14C — Tài Liệu (P2) -| Issue | Title | Priority | Status | Assignee | -| -------------------------------- | ---------------------------------------------------------------- | -------- | ----------- | ------------------------- | -| [TEC-1973](/TEC/issues/TEC-1973) | Update PROJECT_TRACKER.md with Wave 14 CEO audit results | Medium | done | Technical Writer | +| Vấn Đề | Tiêu Đề | Ưu Tiên | Trạng Thái | Người Phụ Trách | +| -------------------------------- | ------------------------------------------------------------------------ | ---------- | ---------------- | --------------------------- | +| [TEC-1973](/TEC/issues/TEC-1973) | Cập nhật PROJECT_TRACKER.md với kết quả kiểm toán CEO Wave 14 | Trung bình | hoàn thành | Kỹ Sư Viết Tài Liệu | -#### Wave 14 — Remaining Open Issues (5 total — 0 critical, 3 high, 2 medium) +#### Wave 14 — Các Vấn Đề Còn Mở (5 tổng — 0 quan trọng, 3 cao, 2 trung bình) -All non-blocking for production readiness. +Tất cả đều không chặn sẵn sàng sản xuất. -| Issue | Title | Priority | Status | Category | -| -------------------------------- | ---------------------------------------------------------------- | -------- | ----------- | --------------- | -| [TEC-1650](/TEC/issues/TEC-1650) | Fix Listing detail — non-existent ID returns 500 → 404 | High | todo | Bug Fix | -| [TEC-1652](/TEC/issues/TEC-1652) | Run and verify all 29 E2E tests with full environment | High | todo | Quality | -| [TEC-1657](/TEC/issues/TEC-1657) | Add audit logging for admin actions | High | todo | Security | -| [TEC-1776](/TEC/issues/TEC-1776) | Refactor 3 oversized files exceeding 220 LOC | Medium | todo | Code Quality | -| [TEC-1777](/TEC/issues/TEC-1777) | Implement agent quality score auto-calculation cron | Medium | todo | Feature | +| Vấn Đề | Tiêu Đề | Ưu Tiên | Trạng Thái | Danh Mục | +| -------------------------------- | ------------------------------------------------------------------------ | ---------- | ---------- | ---------------- | +| [TEC-1650](/TEC/issues/TEC-1650) | Sửa chi tiết Listing — ID không tồn tại trả về 500 → 404 | Cao | cần làm | Sửa Lỗi | +| [TEC-1652](/TEC/issues/TEC-1652) | Chạy và xác minh tất cả 29 E2E tests với môi trường đầy đủ | Cao | cần làm | Chất Lượng | +| [TEC-1657](/TEC/issues/TEC-1657) | Thêm ghi log kiểm toán cho các hành động quản trị | Cao | cần làm | Bảo Mật | +| [TEC-1776](/TEC/issues/TEC-1776) | Tái cấu trúc 3 file quá lớn vượt quá 220 LOC | Trung bình | cần làm | Chất Lượng Code | +| [TEC-1777](/TEC/issues/TEC-1777) | Triển khai cron tự động tính điểm chất lượng agent | Trung bình | cần làm | Tính Năng | --- -## Summary +## Tóm Tắt -| Phase | Total | Done | In Progress | Blocked | Todo | Cancelled | -| ----------- | ------- | ------ | ----------- | ------- | ------ | --------- | -| Phase 0 | 6 | 6 | 0 | 0 | 0 | 0 | -| Phase 1 | 8 | 8 | 0 | 0 | 0 | 0 | -| Phase 2 | 5 | 5 | 0 | 0 | 0 | 0 | -| Phase 3 | 4 | 4 | 0 | 0 | 0 | 0 | -| Phase 4 | 8 | 8 | 0 | 0 | 0 | 0 | -| Phase 5 | 4 | 4 | 0 | 0 | 0 | 0 | -| Phase 6 | 16 | 16 | 0 | 0 | 0 | 0 | -| Phase 7 | 108 | 97 | 1 | 0 | 5 | 5 | -| **Total** | **159** | **148**| **1** | **0** | **5** | **5** | +| Giai Đoạn | Tổng | Hoàn Thành | Đang Thực Hiện | Bị Chặn | Cần Làm | Đã Huỷ | +| ----------- | ------- | ---------- | -------------- | ------- | ------- | ------- | +| Giai Đoạn 0 | 6 | 6 | 0 | 0 | 0 | 0 | +| Giai Đoạn 1 | 8 | 8 | 0 | 0 | 0 | 0 | +| Giai Đoạn 2 | 5 | 5 | 0 | 0 | 0 | 0 | +| Giai Đoạn 3 | 4 | 4 | 0 | 0 | 0 | 0 | +| Giai Đoạn 4 | 8 | 8 | 0 | 0 | 0 | 0 | +| Giai Đoạn 5 | 4 | 4 | 0 | 0 | 0 | 0 | +| Giai Đoạn 6 | 16 | 16 | 0 | 0 | 0 | 0 | +| Giai Đoạn 7 | 108 | 97 | 1 | 0 | 5 | 5 | +| **Tổng** | **159** | **148** | **1** | **0** | **5** | **5** | -*Note: 5 issues cancelled (TEC-1547, TEC-1876, TEC-1877 + 2 others). Counts sourced from Paperclip issue tracker on 2026-04-12.* +*Lưu ý: 5 vấn đề đã huỷ (TEC-1547, TEC-1876, TEC-1877 + 2 vấn đề khác). Số liệu được lấy từ bộ theo dõi vấn đề Paperclip vào ngày 2026-04-12.* --- -*Last updated by Technical Writer — 2026-04-12 (Wave 14 CEO audit: build green, backlog cleanup by QA Engineer)* +*Cập nhật lần cuối bởi Kỹ Sư Viết Tài Liệu — 2026-04-12 (Kiểm toán CEO Wave 14: build xanh, dọn dẹp backlog bởi Kỹ Sư QA)* diff --git a/docs/README.md b/docs/README.md index cf867d0..431dabe 100644 --- a/docs/README.md +++ b/docs/README.md @@ -1,26 +1,26 @@ -# GoodGo Platform Documentation +# Tài liệu GoodGo Platform -## Getting Started +## Bắt đầu -| Document | Description | -|----------|-------------| -| [Development Environment](dev-environment.md) | Docker setup, local services, troubleshooting | -| [Architecture](architecture.md) | System design, data flow, module structure | +| Tài liệu | Mô tả | +|----------|-------| +| [Môi trường phát triển](dev-environment.md) | Cài đặt Docker, dịch vụ cục bộ, xử lý sự cố | +| [Kiến trúc](architecture.md) | Thiết kế hệ thống, luồng dữ liệu, cấu trúc module | -## API Reference +## Tham chiếu API -| Document | Description | -|----------|-------------| -| [API Endpoints](api-endpoints.md) | Complete REST API endpoint reference | -| [API Error Codes](api-error-codes.md) | Error response format and all error codes | +| Tài liệu | Mô tả | +|----------|-------| +| [Các endpoint API](api-endpoints.md) | Tài liệu tham chiếu đầy đủ các endpoint REST API | +| [Mã lỗi API](api-error-codes.md) | Định dạng phản hồi lỗi và tất cả mã lỗi | -## Operations +## Vận hành -| Document | Description | -|----------|-------------| -| [Deployment](deployment.md) | Production deployment guide and checklists | -| [Backup & Restore](backup-restore.md) | Backup procedures and disaster recovery runbook | +| Tài liệu | Mô tả | +|----------|-------| +| [Triển khai](deployment.md) | Hướng dẫn triển khai sản xuất và danh sách kiểm tra | +| [Sao lưu & Khôi phục](backup-restore.md) | Quy trình sao lưu và sổ tay khôi phục thảm họa | -## Audits +## Kiểm toán -See [audits/README.md](audits/README.md) for code quality, accessibility, and test coverage audit reports. +Xem [audits/README.md](audits/README.md) để biết các báo cáo kiểm toán về chất lượng mã nguồn, khả năng truy cập và độ phủ kiểm thử. diff --git a/docs/README_FRONTEND_DOCS.md b/docs/README_FRONTEND_DOCS.md index f7ff3d7..2d5ac05 100644 --- a/docs/README_FRONTEND_DOCS.md +++ b/docs/README_FRONTEND_DOCS.md @@ -1,278 +1,278 @@ -# GoodGo Frontend Documentation - i18n & Accessibility Implementation +# Tài Liệu Frontend GoodGo - Triển Khai i18n & Accessibility -## 📚 Documentation Index +## 📚 Mục Lục Tài Liệu -This package contains comprehensive documentation for implementing **next-intl i18n support (Vietnamese + English)** and **WCAG 2.1 AA accessibility fixes** in the GoodGo Platform's Next.js frontend (`apps/web`). +Gói này chứa tài liệu toàn diện cho việc triển khai **hỗ trợ i18n next-intl (Tiếng Việt + Tiếng Anh)** và **sửa lỗi accessibility theo WCAG 2.1 AA** trong frontend Next.js của GoodGo Platform (`apps/web`). -### 📄 Documents Provided +### 📄 Các Tài Liệu Được Cung Cấp -#### 1. **EXPLORATION_SUMMARY.txt** ⭐ START HERE -**15-minute read | Executive overview** +#### 1. **EXPLORATION_SUMMARY.txt** ⭐ BẮT ĐẦU TỪ ĐÂY +**Đọc trong 15 phút | Tổng quan điều hành** -High-level summary of findings: -- Key strengths and gaps -- Technology stack overview -- Content inventory (200+ items to translate) -- Critical files to update -- A11y audit findings -- Timeline estimate (19-27 hours) +Tóm tắt cấp cao về các phát hiện: +- Điểm mạnh và khoảng trống chính +- Tổng quan về tech stack +- Kiểm kê nội dung (200+ mục cần dịch) +- Các tệp quan trọng cần cập nhật +- Kết quả kiểm tra A11y +- Ước tính thời gian (19-27 giờ) -**Best for:** Project managers, stakeholders, quick overview +**Phù hợp nhất cho:** Quản lý dự án, các bên liên quan, tổng quan nhanh --- -#### 2. **docs/audits/FRONTEND_EXPLORATION.md** 📋 DETAILED REFERENCE -**45-minute read | Comprehensive analysis** +#### 2. **docs/audits/FRONTEND_EXPLORATION.md** 📋 TÀI LIỆU THAM KHẢO CHI TIẾT +**Đọc trong 45 phút | Phân tích toàn diện** -Extremely thorough breakdown: -- Complete directory structure with descriptions -- All 90+ files analyzed -- Package.json detailed breakdown -- Root layout current state -- Middleware routing logic -- Tailwind CSS configuration -- Text content locations (hardcoded) -- Current accessibility status -- Data structures & enums -- Testing setup +Phân tích cực kỳ chi tiết: +- Cấu trúc thư mục đầy đủ kèm mô tả +- Toàn bộ 90+ tệp được phân tích +- Phân tích chi tiết package.json +- Trạng thái hiện tại của root layout +- Logic định tuyến middleware +- Cấu hình Tailwind CSS +- Vị trí nội dung văn bản (hardcoded) +- Trạng thái accessibility hiện tại +- Cấu trúc dữ liệu & enum +- Thiết lập kiểm thử -**Best for:** Developers, architects, implementation planning +**Phù hợp nhất cho:** Lập trình viên, kiến trúc sư, lập kế hoạch triển khai --- -#### 3. **IMPLEMENTATION_QUICK_REFERENCE.md** 🚀 QUICK START GUIDE -**30-minute read | Action-oriented** +#### 3. **IMPLEMENTATION_QUICK_REFERENCE.md** 🚀 HƯỚNG DẪN KHỞI ĐẦU NHANH +**Đọc trong 30 phút | Định hướng hành động** -Focused implementation guide: -- Key findings at a glance -- Strategic entry points (i18n, A11y, message structure) -- 5-phase implementation checklist -- Text content inventory by type -- Critical vs. high vs. medium priority files -- A11y priority roadmap -- Testing strategy -- Dependency requirements -- Quick win opportunities +Hướng dẫn triển khai tập trung: +- Các phát hiện chính tổng quan +- Các điểm vào chiến lược (i18n, A11y, cấu trúc message) +- Danh sách kiểm tra triển khai 5 giai đoạn +- Kiểm kê nội dung văn bản theo loại +- Tệp ưu tiên Quan trọng / Cao / Trung bình +- Lộ trình ưu tiên A11y +- Chiến lược kiểm thử +- Yêu cầu về dependency +- Cơ hội thắng lợi nhanh -**Best for:** Team leads, sprint planning, breaking down work +**Phù hợp nhất cho:** Trưởng nhóm kỹ thuật, lập kế hoạch sprint, phân chia công việc --- -#### 4. **FILE_MAPPING_GUIDE.md** 🗂️ DETAILED IMPLEMENTATION PLAN -**60-minute read | File-by-file guide** +#### 4. **FILE_MAPPING_GUIDE.md** 🗂️ KẾ HOẠCH TRIỂN KHAI CHI TIẾT +**Đọc trong 60 phút | Hướng dẫn từng tệp** -Phase-by-phase file update instructions: -- **Phase 1:** Infrastructure (middleware, root layout, config) -- **Phase 2:** Core component updates (layouts, pages) -- **Phase 3:** Form & validation updates -- **Phase 4:** Utility & API updates -- **Phase 5:** Accessibility fixes -- **Phase 6:** Test setup updates +Hướng dẫn cập nhật tệp theo từng giai đoạn: +- **Giai đoạn 1:** Hạ tầng (middleware, root layout, config) +- **Giai đoạn 2:** Cập nhật core component (layouts, pages) +- **Giai đoạn 3:** Cập nhật form & validation +- **Giai đoạn 4:** Cập nhật tiện ích & API +- **Giai đoạn 5:** Sửa lỗi accessibility +- **Giai đoạn 6:** Cập nhật thiết lập kiểm thử -Each section includes: -- Current state -- Changes needed -- Code examples (pseudo-code) -- Specific complexity ratings -- Test setup instructions +Mỗi phần bao gồm: +- Trạng thái hiện tại +- Các thay đổi cần thực hiện +- Ví dụ code (pseudo-code) +- Đánh giá độ phức tạp cụ thể +- Hướng dẫn thiết lập kiểm thử -Organized by file complexity: -- Trivial (5 min) - 5 files -- Simple (15-30 min) - 12 files -- Medium (30-60 min) - 10 files -- Complex (1-2 hours) - 4 files -- Critical infrastructure - 3 files +Được tổ chức theo độ phức tạp của tệp: +- Đơn giản (5 phút) - 5 tệp +- Dễ (15-30 phút) - 12 tệp +- Trung bình (30-60 phút) - 10 tệp +- Phức tạp (1-2 giờ) - 4 tệp +- Hạ tầng quan trọng - 3 tệp -**Best for:** Implementation team, developers, actual coding +**Phù hợp nhất cho:** Nhóm triển khai, lập trình viên, viết code thực tế --- -## 🎯 How to Use These Docs +## 🎯 Cách Sử Dụng Tài Liệu Này -### Scenario 1: I'm a Project Manager -1. Read **EXPLORATION_SUMMARY.txt** (15 min) -2. Share timeline and effort with team -3. Reference **IMPLEMENTATION_QUICK_REFERENCE.md** for phase definitions +### Tình huống 1: Tôi là Quản Lý Dự Án +1. Đọc **EXPLORATION_SUMMARY.txt** (15 phút) +2. Chia sẻ timeline và công sức với nhóm +3. Tham khảo **IMPLEMENTATION_QUICK_REFERENCE.md** để biết định nghĩa từng giai đoạn -### Scenario 2: I'm a Tech Lead Planning the Work -1. Read **EXPLORATION_SUMMARY.txt** (15 min) -2. Read **IMPLEMENTATION_QUICK_REFERENCE.md** (30 min) -3. Skim **FILE_MAPPING_GUIDE.md** to understand complexity distribution -4. Create sprint tasks based on file complexity ratings +### Tình huống 2: Tôi là Tech Lead Lập Kế Hoạch Công Việc +1. Đọc **EXPLORATION_SUMMARY.txt** (15 phút) +2. Đọc **IMPLEMENTATION_QUICK_REFERENCE.md** (30 phút) +3. Lướt qua **FILE_MAPPING_GUIDE.md** để hiểu phân bố độ phức tạp +4. Tạo task sprint dựa trên đánh giá độ phức tạp của từng tệp -### Scenario 3: I'm a Developer Implementing i18n -1. Quickly scan **EXPLORATION_SUMMARY.txt** (5 min) -2. Deep dive **docs/audits/FRONTEND_EXPLORATION.md** sections relevant to your task -3. Use **FILE_MAPPING_GUIDE.md** as step-by-step instructions -4. Reference code examples and pseudo-code provided +### Tình huống 3: Tôi là Lập Trình Viên Triển Khai i18n +1. Xem nhanh **EXPLORATION_SUMMARY.txt** (5 phút) +2. Đọc sâu các phần liên quan đến task của bạn trong **docs/audits/FRONTEND_EXPLORATION.md** +3. Dùng **FILE_MAPPING_GUIDE.md** như hướng dẫn từng bước +4. Tham khảo các ví dụ code và pseudo-code được cung cấp -### Scenario 4: I'm Implementing A11y Fixes -1. Read A11y section of **EXPLORATION_SUMMARY.txt** -2. Reference **IMPLEMENTATION_QUICK_REFERENCE.md** A11y section -3. Use **FILE_MAPPING_GUIDE.md** Phase 5 for specific fixes -4. Check validation checklist before considering work complete +### Tình huống 4: Tôi Đang Triển Khai Sửa Lỗi A11y +1. Đọc phần A11y trong **EXPLORATION_SUMMARY.txt** +2. Tham khảo phần A11y trong **IMPLEMENTATION_QUICK_REFERENCE.md** +3. Dùng Giai đoạn 5 của **FILE_MAPPING_GUIDE.md** để biết các sửa lỗi cụ thể +4. Kiểm tra danh sách xác nhận trước khi coi là hoàn thành -## 🗂️ Document Organization by Topic +## 🗂️ Tổ Chức Tài Liệu Theo Chủ Đề -### For i18n Implementation -- **EXPLORATION_SUMMARY.txt** → "Text Content Requiring Translation" section -- **IMPLEMENTATION_QUICK_REFERENCE.md** → Strategic Entry Points, Phase 1-2 -- **FILE_MAPPING_GUIDE.md** → Phase 1-3, message file structure section +### Về Triển Khai i18n +- **EXPLORATION_SUMMARY.txt** → phần "Text Content Requiring Translation" +- **IMPLEMENTATION_QUICK_REFERENCE.md** → Strategic Entry Points, Giai đoạn 1-2 +- **FILE_MAPPING_GUIDE.md** → Giai đoạn 1-3, phần cấu trúc tệp message -### For Accessibility Fixes -- **EXPLORATION_SUMMARY.txt** → "Accessibility Audit Findings" section -- **IMPLEMENTATION_QUICK_REFERENCE.md** → A11y Implementation Priority section -- **FILE_MAPPING_GUIDE.md** → Phase 5, specific component updates +### Về Sửa Lỗi Accessibility +- **EXPLORATION_SUMMARY.txt** → phần "Accessibility Audit Findings" +- **IMPLEMENTATION_QUICK_REFERENCE.md** → phần A11y Implementation Priority +- **FILE_MAPPING_GUIDE.md** → Giai đoạn 5, cập nhật component cụ thể -### For Infrastructure Setup -- **IMPLEMENTATION_QUICK_REFERENCE.md** → Checklist Phase 1 -- **FILE_MAPPING_GUIDE.md** → Phase 1: Infrastructure Setup +### Về Thiết Lập Hạ Tầng +- **IMPLEMENTATION_QUICK_REFERENCE.md** → Danh sách kiểm tra Giai đoạn 1 +- **FILE_MAPPING_GUIDE.md** → Giai đoạn 1: Infrastructure Setup -### For Testing & QA -- **IMPLEMENTATION_QUICK_REFERENCE.md** → Testing Strategy section -- **FILE_MAPPING_GUIDE.md** → Phase 6: Test Setup Updates, Validation Checklist +### Về Kiểm Thử & QA +- **IMPLEMENTATION_QUICK_REFERENCE.md** → phần Testing Strategy +- **FILE_MAPPING_GUIDE.md** → Giai đoạn 6: Test Setup Updates, Validation Checklist -## 📊 Key Statistics +## 📊 Thống Kê Chính -| Metric | Value | -|--------|-------| -| Files in apps/web | 90+ | -| Files requiring updates | 50-60 | -| Text items to translate | 200+ | -| Components to update | 35+ | -| Pages to update | 15+ | -| A11y issues found | 10+ | -| Estimated implementation time | 19-27 hours (~3-4 days) | -| Current i18n setup | None (0%) | -| Current A11y coverage | 60-70% | +| Chỉ số | Giá trị | +|--------|---------| +| Tệp trong apps/web | 90+ | +| Tệp cần cập nhật | 50-60 | +| Mục văn bản cần dịch | 200+ | +| Component cần cập nhật | 35+ | +| Trang cần cập nhật | 15+ | +| Lỗi A11y phát hiện | 10+ | +| Thời gian triển khai ước tính | 19-27 giờ (~3-4 ngày) | +| Thiết lập i18n hiện tại | Không có (0%) | +| Độ phủ A11y hiện tại | 60-70% | -## ✅ Pre-Implementation Checklist +## ✅ Danh Sách Kiểm Tra Trước Triển Khai -Before starting implementation: -- [ ] Review **EXPLORATION_SUMMARY.txt** -- [ ] Install **next-intl** package (`npm install next-intl`) -- [ ] Have **3-4 days** allocated for full implementation -- [ ] Team has experience with Next.js App Router -- [ ] Access to **axe DevTools** for accessibility testing -- [ ] Plan to test with screen reader (NVDA or JAWS) +Trước khi bắt đầu triển khai: +- [ ] Xem lại **EXPLORATION_SUMMARY.txt** +- [ ] Cài đặt gói **next-intl** (`npm install next-intl`) +- [ ] Phân bổ **3-4 ngày** cho triển khai đầy đủ +- [ ] Nhóm có kinh nghiệm với Next.js App Router +- [ ] Có quyền truy cập **axe DevTools** để kiểm thử accessibility +- [ ] Lập kế hoạch kiểm thử với screen reader (NVDA hoặc JAWS) -## 🚀 Quick Start +## 🚀 Khởi Đầu Nhanh -### Day 1 Morning -1. Read **EXPLORATION_SUMMARY.txt** (15 min) -2. Read **IMPLEMENTATION_QUICK_REFERENCE.md** (30 min) -3. Install next-intl: `npm install next-intl` -4. Create i18n config file: `i18n/config.ts` -5. Create message files: `public/locales/en.json` and `vi.json` +### Buổi Sáng Ngày 1 +1. Đọc **EXPLORATION_SUMMARY.txt** (15 phút) +2. Đọc **IMPLEMENTATION_QUICK_REFERENCE.md** (30 phút) +3. Cài đặt next-intl: `npm install next-intl` +4. Tạo tệp cấu hình i18n: `i18n/config.ts` +5. Tạo tệp message: `public/locales/en.json` và `vi.json` -### Day 1 Afternoon -6. Start with **FILE_MAPPING_GUIDE.md** Phase 1 -7. Update **middleware.ts** (30-45 min) -8. Update **app/layout.tsx** (30 min) +### Buổi Chiều Ngày 1 +6. Bắt đầu với Giai đoạn 1 của **FILE_MAPPING_GUIDE.md** +7. Cập nhật **middleware.ts** (30-45 phút) +8. Cập nhật **app/layout.tsx** (30 phút) -### Day 2 -- Continue with **FILE_MAPPING_GUIDE.md** Phase 2-3 -- Update core layout and page files -- Extract text from validations +### Ngày 2 +- Tiếp tục với Giai đoạn 2-3 của **FILE_MAPPING_GUIDE.md** +- Cập nhật các tệp core layout và page +- Trích xuất văn bản từ validation -### Day 3 -- Continue Phase 3-4 -- Update remaining components -- Start A11y fixes +### Ngày 3 +- Tiếp tục Giai đoạn 3-4 +- Cập nhật các component còn lại +- Bắt đầu sửa lỗi A11y -### Day 4 -- Complete A11y fixes -- Run comprehensive testing -- Fix any issues found +### Ngày 4 +- Hoàn thành sửa lỗi A11y +- Chạy kiểm thử toàn diện +- Sửa các vấn đề phát hiện được -## 📞 Questions While Implementing? +## 📞 Câu Hỏi Trong Khi Triển Khai? -Refer to specific sections: +Tham khảo các phần cụ thể: -**Q: How do I structure message files?** -A: See FILE_MAPPING_GUIDE.md → Phase 1 → `public/locales/en.json` structure +**H: Cách cấu trúc tệp message như thế nào?** +Đ: Xem FILE_MAPPING_GUIDE.md → Giai đoạn 1 → cấu trúc `public/locales/en.json` -**Q: What files do I update first?** -A: See IMPLEMENTATION_QUICK_REFERENCE.md → Critical Files for i18n +**H: Tôi cập nhật tệp nào trước?** +Đ: Xem IMPLEMENTATION_QUICK_REFERENCE.md → Critical Files for i18n -**Q: How do I add focus trapping to dialogs?** -A: See FILE_MAPPING_GUIDE.md → Phase 5 → `components/ui/dialog.tsx` +**H: Cách thêm focus trapping vào dialog như thế nào?** +Đ: Xem FILE_MAPPING_GUIDE.md → Giai đoạn 5 → `components/ui/dialog.tsx` -**Q: What's the timeline for this work?** -A: See EXPLORATION_SUMMARY.txt → Implementation Timeline section +**H: Timeline cho công việc này là bao lâu?** +Đ: Xem EXPLORATION_SUMMARY.txt → phần Implementation Timeline -**Q: Are there quick wins I can do now?** -A: Yes! See IMPLEMENTATION_QUICK_REFERENCE.md → Quick Win Opportunities +**H: Có những thắng lợi nhanh nào tôi có thể làm ngay không?** +Đ: Có! Xem IMPLEMENTATION_QUICK_REFERENCE.md → Quick Win Opportunities -## 🔍 Document Quality Metrics +## 🔍 Chỉ Số Chất Lượng Tài Liệu -| Metric | Value | -|--------|-------| -| Analysis depth | Very Thorough | -| File coverage | 100% of app/web | -| Code examples provided | Yes (40+ snippets) | -| Pseudo-code included | Yes | -| Complexity ratings | Yes (detailed) | -| Test coverage | Yes | -| Validation checklist | Yes | +| Chỉ số | Giá trị | +|--------|---------| +| Độ sâu phân tích | Rất kỹ lưỡng | +| Độ phủ tệp | 100% của app/web | +| Ví dụ code được cung cấp | Có (40+ đoạn) | +| Pseudo-code được bao gồm | Có | +| Đánh giá độ phức tạp | Có (chi tiết) | +| Độ phủ kiểm thử | Có | +| Danh sách xác nhận | Có | -## 📌 Important Notes +## 📌 Lưu Ý Quan Trọng -1. **No existing i18n:** Everything is hardcoded Vietnamese. This is a greenfield i18n implementation. +1. **Không có i18n hiện tại:** Tất cả đều được hardcode bằng tiếng Việt. Đây là triển khai i18n từ đầu (greenfield). -2. **A11y is partially done:** Good foundation exists (semantic HTML, ARIA labels, skip link), but focus management and some ARIA attributes are missing. +2. **A11y đã được thực hiện một phần:** Nền tảng tốt đã có sẵn (HTML ngữ nghĩa, ARIA label, skip link), nhưng quản lý focus và một số thuộc tính ARIA vẫn còn thiếu. -3. **Technology ready:** All necessary libraries are installed. This is a refactoring/addition project, not a framework change. +3. **Công nghệ đã sẵn sàng:** Tất cả thư viện cần thiết đã được cài đặt. Đây là dự án tái cấu trúc/bổ sung, không phải thay đổi framework. -4. **TypeScript helps:** Type safety will catch many issues during refactoring. +4. **TypeScript hỗ trợ:** Type safety sẽ phát hiện nhiều vấn đề trong quá trình tái cấu trúc. -5. **Testing is important:** Both locales should be tested thoroughly. +5. **Kiểm thử rất quan trọng:** Cả hai locale đều cần được kiểm thử kỹ lưỡng. -## 📚 Additional Resources +## 📚 Tài Nguyên Bổ Sung -The docs reference: -- Next.js App Router: `/app` directory structure -- next-intl library: Configuration and setup -- WCAG 2.1 AA: Accessibility standards -- Tailwind CSS: Styling approach -- Zod: Validation schemas -- TypeScript: Type safety +Tài liệu tham chiếu: +- Next.js App Router: cấu trúc thư mục `/app` +- Thư viện next-intl: cấu hình và thiết lập +- WCAG 2.1 AA: tiêu chuẩn accessibility +- Tailwind CSS: phương pháp tạo kiểu +- Zod: schema validation +- TypeScript: type safety -## 🎓 Learning Path +## 🎓 Lộ Trình Học Tập -If you're new to this codebase: -1. Start with **EXPLORATION_SUMMARY.txt** for overview -2. Read **docs/audits/FRONTEND_EXPLORATION.md** section "Directory Structure Overview" -3. Understand the App Router structure -4. Review current component patterns -5. Then start implementation with **FILE_MAPPING_GUIDE.md** +Nếu bạn mới làm quen với codebase này: +1. Bắt đầu với **EXPLORATION_SUMMARY.txt** để có cái nhìn tổng quan +2. Đọc phần "Directory Structure Overview" trong **docs/audits/FRONTEND_EXPLORATION.md** +3. Hiểu cấu trúc App Router +4. Xem lại các pattern component hiện tại +5. Sau đó bắt đầu triển khai với **FILE_MAPPING_GUIDE.md** -## 📝 Version & History +## 📝 Phiên Bản & Lịch Sử -**Current Version:** 1.0 - Pre-Implementation -**Generated:** April 9, 2026 -**Analysis Type:** Very Thorough -**Confidence Level:** HIGH ✅ -**Status:** Ready for Implementation +**Phiên bản hiện tại:** 1.0 - Trước khi triển khai +**Được tạo:** 9 tháng 4, 2026 +**Loại phân tích:** Rất kỹ lưỡng +**Mức độ tin cậy:** CAO ✅ +**Trạng thái:** Sẵn sàng triển khai --- -## 🎯 Success Criteria +## 🎯 Tiêu Chí Thành Công -Implementation is complete when: -- ✅ Both `/en/*` and `/vi/*` routes work -- ✅ All hardcoded text comes from message files -- ✅ Metadata changes with locale -- ✅ Validation messages are translated -- ✅ All enums use i18n -- ✅ Focus trap works in dialogs -- ✅ Form errors linked with aria-describedby -- ✅ All icon buttons have aria-labels -- ✅ Color contrast meets WCAG AA -- ✅ Keyboard navigation works -- ✅ Tests pass for both locales -- ✅ axe DevTools audit passes +Triển khai hoàn thành khi: +- ✅ Cả hai route `/en/*` và `/vi/*` đều hoạt động +- ✅ Tất cả văn bản hardcoded đến từ tệp message +- ✅ Metadata thay đổi theo locale +- ✅ Thông báo validation được dịch +- ✅ Tất cả enum sử dụng i18n +- ✅ Focus trap hoạt động trong dialog +- ✅ Lỗi form được liên kết với aria-describedby +- ✅ Tất cả nút icon có aria-label +- ✅ Độ tương phản màu đạt WCAG AA +- ✅ Điều hướng bằng bàn phím hoạt động +- ✅ Kiểm thử vượt qua cho cả hai locale +- ✅ Kiểm tra axe DevTools vượt qua --- -**Ready to implement? Start with EXPLORATION_SUMMARY.txt, then move to FILE_MAPPING_GUIDE.md** 🚀 +**Sẵn sàng triển khai? Bắt đầu với EXPLORATION_SUMMARY.txt, sau đó chuyển sang FILE_MAPPING_GUIDE.md** 🚀 diff --git a/docs/api-error-codes.md b/docs/api-error-codes.md index 5f08e43..14949ce 100644 --- a/docs/api-error-codes.md +++ b/docs/api-error-codes.md @@ -1,10 +1,10 @@ -# API Error Codes Reference +# Tài Liệu Tham Khảo Mã Lỗi API -All GoodGo Platform API errors follow a structured JSON format. This document lists every `errorCode` value, its HTTP status, description, and usage examples. +Tất cả các lỗi của GoodGo Platform API đều tuân theo định dạng JSON có cấu trúc thống nhất. Tài liệu này liệt kê mọi giá trị `errorCode`, mã HTTP tương ứng, mô tả và ví dụ sử dụng. -## Error Response Format +## Định Dạng Phản Hồi Lỗi -Every error response from the API has this shape: +Mỗi phản hồi lỗi từ API có dạng như sau: ```json { @@ -19,42 +19,42 @@ Every error response from the API has this shape: | Field | Type | Description | |-----------------|----------|-------------| -| `statusCode` | `number` | HTTP status code (e.g. `400`, `401`, `404`). | -| `errorCode` | `string` | Machine-readable error identifier (see tables below). | -| `message` | `string` | Human-readable explanation (Vietnamese for business rules, English for system errors). | -| `details` | `object` | Optional structured metadata (e.g. validation field names, current/target status). | -| `correlationId` | `string` | Echoed from the `X-Correlation-Id` request header when present. | -| `timestamp` | `string` | ISO 8601 timestamp of the error occurrence. | +| `statusCode` | `number` | Mã HTTP status (ví dụ: `400`, `401`, `404`). | +| `errorCode` | `string` | Mã lỗi dạng máy đọc được (xem các bảng bên dưới). | +| `message` | `string` | Giải thích dạng người đọc được (tiếng Việt cho các quy tắc nghiệp vụ, tiếng Anh cho lỗi hệ thống). | +| `details` | `object` | Metadata có cấu trúc tùy chọn (ví dụ: tên trường validation, trạng thái hiện tại/mục tiêu). | +| `correlationId` | `string` | Phản chiếu từ header `X-Correlation-Id` của request khi có. | +| `timestamp` | `string` | Dấu thời gian ISO 8601 tại thời điểm xảy ra lỗi. | --- -## General Error Codes +## Mã Lỗi Chung -These codes apply across all modules. They are also used as fallback codes when a plain `HttpException` (without a domain error code) is thrown. +Các mã này áp dụng cho tất cả các module. Chúng cũng được dùng làm mã dự phòng khi một `HttpException` thông thường (không có mã lỗi domain) được ném ra. | Error Code | HTTP Status | Description | When It Occurs | |---|---|---|---| -| `INTERNAL_ERROR` | `500` | Unexpected server error. | Unhandled exceptions, infrastructure failures. | -| `VALIDATION_FAILED` | `400` | Request data failed validation. | Invalid input fields, business rule violations (e.g. invalid phone format, bad status transitions). | -| `NOT_FOUND` | `404` | Requested resource does not exist. | Entity lookup by ID returns no result. | -| `CONFLICT` | `409` | Resource state conflict. | Duplicate creation, conflicting state transition. | -| `UNAUTHORIZED` | `401` | Authentication required or failed. | Missing/invalid/expired auth token, bad credentials. | -| `FORBIDDEN` | `403` | Insufficient permissions. | Role-based access denial, CSRF token failure, resource ownership mismatch. | -| `BAD_REQUEST` | `400` | Malformed request. | Invalid file upload, unsupported content type, bad query parameters. | -| `TOO_MANY_REQUESTS` | `429` | Rate limit exceeded. | Too many API requests in a short period. | +| `INTERNAL_ERROR` | `500` | Lỗi máy chủ không mong đợi. | Ngoại lệ chưa được xử lý, lỗi hạ tầng. | +| `VALIDATION_FAILED` | `400` | Dữ liệu request không qua xác thực. | Trường dữ liệu không hợp lệ, vi phạm quy tắc nghiệp vụ (ví dụ: định dạng số điện thoại sai, chuyển trạng thái không hợp lệ). | +| `NOT_FOUND` | `404` | Tài nguyên được yêu cầu không tồn tại. | Tra cứu thực thể theo ID không có kết quả. | +| `CONFLICT` | `409` | Xung đột trạng thái tài nguyên. | Tạo trùng lặp, chuyển đổi trạng thái xung đột. | +| `UNAUTHORIZED` | `401` | Yêu cầu xác thực hoặc xác thực thất bại. | Token xác thực thiếu/không hợp lệ/hết hạn, thông tin đăng nhập sai. | +| `FORBIDDEN` | `403` | Không đủ quyền truy cập. | Từ chối quyền theo vai trò, lỗi CSRF token, không khớp quyền sở hữu tài nguyên. | +| `BAD_REQUEST` | `400` | Request không đúng định dạng. | Tải lên tệp không hợp lệ, loại nội dung không được hỗ trợ, tham số truy vấn sai. | +| `TOO_MANY_REQUESTS` | `429` | Vượt quá giới hạn tốc độ. | Gửi quá nhiều request API trong thời gian ngắn. | --- -## Auth Error Codes +## Mã Lỗi Xác Thực | Error Code | HTTP Status | Description | When It Occurs | |---|---|---|---| -| `AUTH_INVALID_CREDENTIALS` | `401` | Login credentials are incorrect. | Phone number or password mismatch during local login. | -| `AUTH_TOKEN_EXPIRED` | `401` | JWT token has expired. | Access token or refresh token past expiration. | -| `AUTH_TOKEN_INVALID` | `401` | JWT token is malformed or tampered with. | Token signature verification failure. | -| `AUTH_INSUFFICIENT_PERMISSIONS` | `403` | Authenticated user lacks required role/permission. | Non-admin accessing admin endpoints, role mismatch. | +| `AUTH_INVALID_CREDENTIALS` | `401` | Thông tin đăng nhập không chính xác. | Số điện thoại hoặc mật khẩu không khớp khi đăng nhập nội bộ. | +| `AUTH_TOKEN_EXPIRED` | `401` | JWT token đã hết hạn. | Access token hoặc refresh token đã quá thời gian hết hạn. | +| `AUTH_TOKEN_INVALID` | `401` | JWT token bị sai định dạng hoặc bị giả mạo. | Xác minh chữ ký token thất bại. | +| `AUTH_INSUFFICIENT_PERMISSIONS` | `403` | Người dùng đã xác thực không có vai trò/quyền cần thiết. | Người dùng không phải admin truy cập endpoint admin, không khớp vai trò. | -### Auth Module Usage Examples +### Ví Dụ Sử Dụng Module Xác Thực ```json // POST /auth/login — wrong password @@ -88,15 +88,15 @@ These codes apply across all modules. They are also used as fallback codes when --- -## User Error Codes +## Mã Lỗi Người Dùng | Error Code | HTTP Status | Description | When It Occurs | |---|---|---|---| -| `USER_NOT_FOUND` | `404` | User does not exist. | Profile lookup, admin user management. | -| `USER_ALREADY_EXISTS` | `409` | User with given identifier already exists. | Duplicate registration (phone or email). | -| `USER_INVALID_PHONE` | `400` | Phone number format is invalid. | Registration or profile update with bad phone format. | +| `USER_NOT_FOUND` | `404` | Người dùng không tồn tại. | Tra cứu hồ sơ, quản lý người dùng qua admin. | +| `USER_ALREADY_EXISTS` | `409` | Người dùng với định danh đã cho tồn tại. | Đăng ký trùng lặp (số điện thoại hoặc email). | +| `USER_INVALID_PHONE` | `400` | Định dạng số điện thoại không hợp lệ. | Đăng ký hoặc cập nhật hồ sơ với số điện thoại sai định dạng. | -### User Module Usage Examples +### Ví Dụ Sử Dụng Module Người Dùng ```json // GET /auth/profile — deleted or nonexistent user @@ -116,16 +116,16 @@ These codes apply across all modules. They are also used as fallback codes when --- -## Listing Error Codes +## Mã Lỗi Tin Đăng | Error Code | HTTP Status | Description | When It Occurs | |---|---|---|---| -| `LISTING_NOT_FOUND` | `404` | Listing does not exist. | Lookup by ID for viewing, moderation, or status change. | -| `LISTING_INVALID_STATUS_TRANSITION` | `400` | Status transition is not allowed. | Attempting an invalid workflow step (e.g. `EXPIRED` → `ACTIVE`). | -| `LISTING_ALREADY_ACTIVE` | `409` | Listing is already in active state. | Re-activating a listing that is already published. | -| `LISTING_EXPIRED` | `400` | Listing has expired. | Attempting operations on an expired listing. | +| `LISTING_NOT_FOUND` | `404` | Tin đăng không tồn tại. | Tra cứu theo ID để xem, kiểm duyệt, hoặc thay đổi trạng thái. | +| `LISTING_INVALID_STATUS_TRANSITION` | `400` | Chuyển đổi trạng thái không được phép. | Thực hiện bước quy trình không hợp lệ (ví dụ: `EXPIRED` → `ACTIVE`). | +| `LISTING_ALREADY_ACTIVE` | `409` | Tin đăng đã ở trạng thái hoạt động. | Kích hoạt lại tin đăng đã được xuất bản. | +| `LISTING_EXPIRED` | `400` | Tin đăng đã hết hạn. | Thực hiện các thao tác trên tin đăng đã hết hạn. | -### Listing Module Usage Examples +### Ví Dụ Sử Dụng Module Tin Đăng ```json // PATCH /listings/:id/status — invalid transition @@ -156,13 +156,13 @@ These codes apply across all modules. They are also used as fallback codes when --- -## Property Error Codes +## Mã Lỗi Bất Động Sản | Error Code | HTTP Status | Description | When It Occurs | |---|---|---|---| -| `PROPERTY_NOT_FOUND` | `404` | Property does not exist. | Property lookup for media upload or listing creation. | +| `PROPERTY_NOT_FOUND` | `404` | Bất động sản không tồn tại. | Tra cứu bất động sản để tải media hoặc tạo tin đăng. | -### Property Module Usage Examples +### Ví Dụ Sử Dụng Module Bất Động Sản ```json // POST /properties/:id/media — property not found @@ -182,24 +182,24 @@ These codes apply across all modules. They are also used as fallback codes when --- -## Media Error Codes +## Mã Lỗi Media | Error Code | HTTP Status | Description | When It Occurs | |---|---|---|---| -| `MEDIA_UPLOAD_FAILED` | `500` | File upload to storage provider failed. | S3/cloud storage write failure. | -| `MEDIA_LIMIT_EXCEEDED` | `400` | Maximum number of media files reached. | Exceeding per-property media limit. | +| `MEDIA_UPLOAD_FAILED` | `500` | Tải tệp lên nhà cung cấp lưu trữ thất bại. | Lỗi ghi vào S3/cloud storage. | +| `MEDIA_LIMIT_EXCEEDED` | `400` | Đã đạt số lượng tệp media tối đa. | Vượt quá giới hạn media cho mỗi bất động sản. | --- -## Payment Error Codes +## Mã Lỗi Thanh Toán | Error Code | HTTP Status | Description | When It Occurs | |---|---|---|---| -| `PAYMENT_FAILED` | `500` | Payment processing failed. | Gateway error, provider timeout, payment link creation failure. | -| `PAYMENT_ALREADY_PROCESSED` | `409` | Payment has already been completed, failed, or refunded. | Duplicate callback, retry on non-pending payment, refunding a non-completed payment. | -| `PAYMENT_INVALID_AMOUNT` | `400` | Payment amount is invalid. | Zero/negative amount, amount below minimum threshold. | +| `PAYMENT_FAILED` | `500` | Xử lý thanh toán thất bại. | Lỗi cổng thanh toán, hết thời gian chờ nhà cung cấp, lỗi tạo liên kết thanh toán. | +| `PAYMENT_ALREADY_PROCESSED` | `409` | Thanh toán đã được hoàn tất, thất bại, hoặc hoàn tiền. | Callback trùng lặp, thử lại trên thanh toán không ở trạng thái chờ, hoàn tiền thanh toán chưa hoàn tất. | +| `PAYMENT_INVALID_AMOUNT` | `400` | Số tiền thanh toán không hợp lệ. | Số tiền bằng 0/âm, số tiền dưới ngưỡng tối thiểu. | -### Payment Module Usage Examples +### Ví Dụ Sử Dụng Module Thanh Toán ```json // POST /payments — duplicate idempotency key @@ -233,17 +233,17 @@ These codes apply across all modules. They are also used as fallback codes when --- -## Subscription Error Codes +## Mã Lỗi Gói Dịch Vụ | Error Code | HTTP Status | Description | When It Occurs | |---|---|---|---| -| `SUBSCRIPTION_NOT_FOUND` | `404` | Subscription does not exist. | Lookup for cancellation, upgrade, or usage metering. | -| `SUBSCRIPTION_ALREADY_ACTIVE` | `409` | User already has an active subscription. | Attempting to create a second active subscription. | -| `SUBSCRIPTION_ALREADY_CANCELLED` | `409` | Subscription has already been cancelled. | Re-cancelling a subscription. | -| `SUBSCRIPTION_INACTIVE` | `409` | Subscription is not in an active state. | Upgrading, expiring, or marking past-due on a non-active subscription. | -| `QUOTA_EXCEEDED` | `403` | Usage quota for the current plan has been exceeded. | Exceeding listing, lead, or search quota limits. | +| `SUBSCRIPTION_NOT_FOUND` | `404` | Gói dịch vụ không tồn tại. | Tra cứu để hủy, nâng cấp, hoặc đo lường sử dụng. | +| `SUBSCRIPTION_ALREADY_ACTIVE` | `409` | Người dùng đã có gói dịch vụ đang hoạt động. | Cố tạo gói dịch vụ hoạt động thứ hai. | +| `SUBSCRIPTION_ALREADY_CANCELLED` | `409` | Gói dịch vụ đã bị hủy trước đó. | Hủy lại gói dịch vụ đã hủy. | +| `SUBSCRIPTION_INACTIVE` | `409` | Gói dịch vụ không ở trạng thái hoạt động. | Nâng cấp, hết hạn, hoặc đánh dấu quá hạn trên gói không hoạt động. | +| `QUOTA_EXCEEDED` | `403` | Đã vượt quá hạn mức sử dụng của gói hiện tại. | Vượt quá giới hạn tin đăng, khách hàng tiềm năng, hoặc tìm kiếm. | -### Subscription Module Usage Examples +### Ví Dụ Sử Dụng Module Gói Dịch Vụ ```json // POST /subscriptions — already has active subscription @@ -284,17 +284,17 @@ These codes apply across all modules. They are also used as fallback codes when --- -## Course Error Codes +## Mã Lỗi Khóa Học | Error Code | HTTP Status | Description | When It Occurs | |---|---|---|---| -| `COURSE_NOT_FOUND` | `404` | Course does not exist. | Course lookup by ID. | -| `COURSE_ALREADY_PUBLISHED` | `409` | Course is already in published state. | Re-publishing an active course. | -| `COURSE_ENROLLMENT_CLOSED` | `400` | Course enrollment period has ended. | Attempting to enroll after the cutoff date. | +| `COURSE_NOT_FOUND` | `404` | Khóa học không tồn tại. | Tra cứu khóa học theo ID. | +| `COURSE_ALREADY_PUBLISHED` | `409` | Khóa học đã ở trạng thái xuất bản. | Xuất bản lại khóa học đang hoạt động. | +| `COURSE_ENROLLMENT_CLOSED` | `400` | Thời hạn đăng ký khóa học đã kết thúc. | Cố đăng ký sau ngày chốt danh sách. | --- -## Error Code Quick-Reference (Sorted Alphabetically) +## Tra Cứu Nhanh Mã Lỗi (Sắp Xếp Theo Bảng Chữ Cái) | Error Code | HTTP Status | Module | |---|---|---| @@ -333,9 +333,9 @@ These codes apply across all modules. They are also used as fallback codes when --- -## Frontend Integration Guide +## Hướng Dẫn Tích Hợp Frontend -### TypeScript Error Type +### Kiểu Lỗi TypeScript ```typescript interface ApiError { @@ -348,7 +348,7 @@ interface ApiError { } ``` -### Handling Errors by Code +### Xử Lý Lỗi Theo Mã ```typescript import axios, { AxiosError } from 'axios'; @@ -391,9 +391,9 @@ async function handleApiCall() { } ``` -### Error Code Constants (Optional) +### Hằng Số Mã Lỗi (Tùy Chọn) -For type safety, maintain error codes as a union type on the frontend: +Để đảm bảo an toàn kiểu, hãy duy trì các mã lỗi dưới dạng union type ở phía frontend: ```typescript type ErrorCode = @@ -434,8 +434,8 @@ type ErrorCode = --- -## Source Files +## Tệp Nguồn -- **Error code enum**: `apps/api/src/modules/shared/domain/error-codes.ts` +- **Enum mã lỗi**: `apps/api/src/modules/shared/domain/error-codes.ts` - **Domain exceptions**: `apps/api/src/modules/shared/domain/domain-exception.ts` - **Global exception filter**: `apps/api/src/modules/shared/infrastructure/filters/global-exception.filter.ts` diff --git a/docs/architecture.md b/docs/architecture.md index 956d15d..a4f056c 100644 --- a/docs/architecture.md +++ b/docs/architecture.md @@ -1,8 +1,8 @@ -# Architecture +# Kiến Trúc Hệ Thống -## System Overview +## Tổng Quan Hệ Thống -GoodGo Platform AI is a monorepo containing a NestJS backend, Next.js frontend, Python AI services, and MCP (Model Context Protocol) servers. The system is orchestrated with Turborepo and pnpm workspaces. +GoodGo Platform AI là một monorepo bao gồm backend NestJS, frontend Next.js, các dịch vụ AI bằng Python, và các máy chủ MCP (Model Context Protocol). Hệ thống được điều phối bằng Turborepo và pnpm workspaces. ``` ┌──────────────────────────────────────────┐ @@ -57,52 +57,52 @@ GoodGo Platform AI is a monorepo containing a NestJS backend, Next.js frontend, └──────────────────────────────────────┘ ``` -## Module Architecture +## Kiến Trúc Module -Each API module follows a layered Domain-Driven Design structure: +Mỗi module API tuân theo cấu trúc phân lớp theo Domain-Driven Design: ``` modules/{module-name}/ -├── presentation/ # HTTP layer -│ ├── controllers/ # Route handlers -│ └── dtos/ # Request/response DTOs (class-validator) -├── application/ # Business orchestration -│ ├── commands/ # Write operations (CQRS) -│ ├── queries/ # Read operations (CQRS) -│ ├── handlers/ # Command/query handlers -│ └── services/ # Application services -├── domain/ # Core business logic -│ ├── entities/ # Domain entities & value objects -│ ├── repositories/ # Repository interfaces (abstractions) -│ └── events/ # Domain events -├── infrastructure/ # External integrations -│ ├── repositories/ # Prisma repository implementations -│ └── services/ # External service adapters -└── {module-name}.module.ts # NestJS module definition +├── presentation/ # Tầng HTTP +│ ├── controllers/ # Xử lý route +│ └── dtos/ # DTO yêu cầu/phản hồi (class-validator) +├── application/ # Điều phối nghiệp vụ +│ ├── commands/ # Thao tác ghi (CQRS) +│ ├── queries/ # Thao tác đọc (CQRS) +│ ├── handlers/ # Handler cho command/query +│ └── services/ # Dịch vụ ứng dụng +├── domain/ # Lõi logic nghiệp vụ +│ ├── entities/ # Entity domain & value object +│ ├── repositories/ # Giao diện repository (trừu tượng hoá) +│ └── events/ # Domain event +├── infrastructure/ # Tích hợp bên ngoài +│ ├── repositories/ # Triển khai repository bằng Prisma +│ └── services/ # Adapter cho dịch vụ ngoài +└── {module-name}.module.ts # Định nghĩa module NestJS ``` -### CQRS Pattern +### Mẫu CQRS -The platform uses NestJS CQRS (`@nestjs/cqrs`) for complex operations: +Nền tảng sử dụng NestJS CQRS (`@nestjs/cqrs`) cho các thao tác phức tạp: -- **Commands** — mutate state (create listing, process payment, register user) -- **Queries** — read state (search properties, get analytics) -- **Events** — cross-module communication (listing published → index in Typesense, payment completed → send notification) +- **Commands** — thay đổi trạng thái (tạo tin đăng, xử lý thanh toán, đăng ký người dùng) +- **Queries** — đọc trạng thái (tìm kiếm bất động sản, lấy phân tích) +- **Events** — giao tiếp liên module (tin đăng được duyệt → đánh chỉ mục vào Typesense, thanh toán hoàn tất → gửi thông báo) -### Shared Module +### Module Shared -The `shared/` module provides cross-cutting concerns: +Module `shared/` cung cấp các mối quan tâm xuyên suốt: -- **Prisma service** — database connection and client -- **Redis service** — caching and session management +- **Prisma service** — kết nối cơ sở dữ liệu và client +- **Redis service** — bộ nhớ đệm và quản lý phiên - **Guards** — JWT auth guard, roles guard, throttle guard -- **Pipes** — global validation pipe (whitelist mode) -- **Filters** — exception filters for consistent error responses +- **Pipes** — pipe xác thực toàn cục (chế độ whitelist) +- **Filters** — exception filter cho phản hồi lỗi nhất quán - **Decorators** — `@CurrentUser()`, `@Roles()`, `@Public()` -## Data Flow +## Luồng Dữ Liệu -### Property Listing Lifecycle +### Vòng Đời Tin Đăng Bất Động Sản ``` DRAFT → PENDING_REVIEW → ACTIVE → RESERVED → SOLD/RENTED @@ -111,14 +111,14 @@ DRAFT → PENDING_REVIEW → ACTIVE → RESERVED → SOLD/RENTED REJECTED EXPIRED ``` -1. **Seller/Agent** creates listing (status: `DRAFT`) -2. **Seller** submits for review → `PENDING_REVIEW` -3. **Admin** moderates (AI moderation score assists) → `ACTIVE` or `REJECTED` -4. Active listings are indexed in Typesense for search -5. **Buyer** makes inquiry → `Inquiry` record created -6. Transaction workflow: `OFFER_MADE → DEPOSIT_PAID → CONTRACT_SIGNING → COMPLETED` +1. **Người bán/Đại lý** tạo tin đăng (trạng thái: `DRAFT`) +2. **Người bán** gửi để duyệt → `PENDING_REVIEW` +3. **Quản trị viên** kiểm duyệt (điểm kiểm duyệt AI hỗ trợ) → `ACTIVE` hoặc `REJECTED` +4. Các tin đăng đang hoạt động được đánh chỉ mục vào Typesense để tìm kiếm +5. **Người mua** gửi yêu cầu → bản ghi `Inquiry` được tạo +6. Quy trình giao dịch: `OFFER_MADE → DEPOSIT_PAID → CONTRACT_SIGNING → COMPLETED` -### Search Flow +### Luồng Tìm Kiếm ``` User Query → NestJS Search Module → Typesense @@ -128,7 +128,7 @@ User Query → NestJS Search Module → Typesense └─ Geo-spatial (lat/long + radius) ``` -### Payment Flow +### Luồng Thanh Toán ``` User → API (create payment) → Provider (VNPay/MoMo/ZaloPay) @@ -140,7 +140,7 @@ Provider callback → API → Verify signature → Update Payment status SUCCESS / FAILED ``` -### AI Valuation Flow +### Luồng Định Giá AI ``` API Request → MCP Valuation Server → AI Service (FastAPI) @@ -155,9 +155,9 @@ API Request → MCP Valuation Server → AI Service (FastAPI) └─────────────┘ ``` -## Database Schema +## Sơ Đồ Cơ Sở Dữ Liệu -### Core Models +### Các Model Cốt Lõi ``` User ──┬── Agent (1:1, for AGENT role users) @@ -183,16 +183,16 @@ Plan ── Subscription (1:N) MarketIndex (standalone — city/district/month aggregates) ``` -### Key Design Decisions +### Các Quyết Định Thiết Kế Chính -- **PostGIS** for spatial queries — property locations stored as `Point` geometry -- **JSON columns** for flexible data: amenities, nearby POIs, KYC data, subscription features -- **Token family tracking** for secure refresh token rotation (detects reuse attacks) -- **Soft statuses** over soft deletes — listings use status workflow, not `deletedAt` +- **PostGIS** cho các truy vấn không gian — vị trí bất động sản được lưu dạng hình học `Point` +- **Cột JSON** cho dữ liệu linh hoạt: tiện ích, điểm POI lân cận, dữ liệu KYC, tính năng gói đăng ký +- **Theo dõi token family** để xoay vòng refresh token an toàn (phát hiện tấn công tái sử dụng) +- **Soft status** thay vì soft delete — tin đăng sử dụng quy trình trạng thái, không dùng `deletedAt` -## MCP Servers +## Máy Chủ MCP -Three Model Context Protocol servers provide AI tool interfaces: +Ba máy chủ Model Context Protocol cung cấp giao diện công cụ cho AI: | Server | Tools | Data Source | |--------|-------|-------------| @@ -200,46 +200,46 @@ Three Model Context Protocol servers provide AI tool interfaces: | **Market Analytics** | `get_market_report`, `analyze_trends`, `get_price_indices` | PostgreSQL | | **Valuation** | `estimate_valuation`, `extract_features`, `compare_valuations` | AI Services (FastAPI) | -MCP servers are registered via `McpModule` in NestJS, managed by `McpRegistryService`, and exposed through `McpTransportController` over HTTP. +Các máy chủ MCP được đăng ký qua `McpModule` trong NestJS, quản lý bởi `McpRegistryService`, và được phơi ra qua `McpTransportController` qua HTTP. -## AI Services +## Dịch Vụ AI -Python FastAPI microservice (`libs/ai-services/`) provides: +Microservice Python FastAPI (`libs/ai-services/`) cung cấp: | Endpoint | Model | Purpose | |----------|-------|---------| -| `POST /avm/estimate` | XGBoost | Property price estimation with confidence score | -| `POST /moderation/check` | Claude API | Content moderation for listing descriptions | -| `GET /health` | — | Health check | +| `POST /avm/estimate` | XGBoost | Ước tính giá bất động sản kèm điểm tin cậy | +| `POST /moderation/check` | Claude API | Kiểm duyệt nội dung mô tả tin đăng | +| `GET /health` | — | Kiểm tra tình trạng hoạt động | -- **Underthesea** handles Vietnamese text tokenization and NLP preprocessing -- XGBoost model uses engineered features (area, location, property type, amenities) +- **Underthesea** xử lý phân tách từ và tiền xử lý NLP tiếng Việt +- Mô hình XGBoost sử dụng các đặc trưng được thiết kế (diện tích, vị trí, loại bất động sản, tiện ích) -## Security +## Bảo Mật -- **JWT + Refresh Token Rotation** — 15-minute access tokens, 7-day refresh tokens with family-based rotation -- **OAuth** — Google and Zalo social login -- **Rate Limiting** — 60 req/60s default, 10 req/60s for auth endpoints -- **Helmet** — HTTP security headers -- **CORS** — Configurable origins via `CORS_ORIGINS` +- **JWT + Refresh Token Rotation** — access token có hiệu lực 15 phút, refresh token 7 ngày với xoay vòng dựa trên token family +- **OAuth** — đăng nhập mạng xã hội qua Google và Zalo +- **Rate Limiting** — mặc định 60 yêu cầu/60 giây, 10 yêu cầu/60 giây cho các endpoint xác thực +- **Helmet** — các header bảo mật HTTP +- **CORS** — các origin được cấu hình linh hoạt qua `CORS_ORIGINS` - **Input Validation** — class-validator (backend), Zod (frontend) -- **Content Sanitization** — sanitize-html for user-generated content -- **KYC** — Agent verification workflow (NONE → PENDING → VERIFIED/REJECTED) +- **Content Sanitization** — sanitize-html cho nội dung người dùng tạo +- **KYC** — quy trình xác minh đại lý (NONE → PENDING → VERIFIED/REJECTED) -## Monitoring +## Giám Sát -- **Prometheus** scrapes `/api/v1/metrics` endpoint every 15 seconds -- **Grafana** dashboards auto-provisioned from `monitoring/grafana/dashboards/` -- **Loki + Promtail** aggregate container logs; viewable in Grafana -- **Pino** structured JSON logging with configurable log levels -- Metrics include HTTP request duration, error rates, web vitals, and custom business metrics -- Log retention: 15 days (configured in `monitoring/loki/loki-config.yml`) +- **Prometheus** thu thập dữ liệu từ endpoint `/api/v1/metrics` mỗi 15 giây +- **Grafana** các dashboard được cung cấp tự động từ `monitoring/grafana/dashboards/` +- **Loki + Promtail** tổng hợp log container; có thể xem trong Grafana +- **Pino** ghi log JSON có cấu trúc với cấp độ log có thể cấu hình +- Các chỉ số bao gồm thời gian xử lý yêu cầu HTTP, tỷ lệ lỗi, web vitals, và các chỉ số nghiệp vụ tùy chỉnh +- Thời gian lưu giữ log: 15 ngày (được cấu hình trong `monitoring/loki/loki-config.yml`) -## Event System +## Hệ Thống Sự Kiện -The platform uses `@nestjs/event-emitter` for loose coupling between modules: +Nền tảng sử dụng `@nestjs/event-emitter` để kết nối lỏng lẻo giữa các module: -- `listing.published` → Typesense indexer updates search index -- `payment.completed` → Notification service sends confirmation -- `inquiry.created` → Agent notification triggered -- `user.registered` → Welcome email sent +- `listing.published` → Typesense indexer cập nhật chỉ mục tìm kiếm +- `payment.completed` → Dịch vụ thông báo gửi xác nhận +- `inquiry.created` → Kích hoạt thông báo cho đại lý +- `user.registered` → Gửi email chào mừng diff --git a/docs/audits/ACCESSIBILITY_AUDIT_2026-04-10.md b/docs/audits/ACCESSIBILITY_AUDIT_2026-04-10.md index 8c860b7..e123b9d 100644 --- a/docs/audits/ACCESSIBILITY_AUDIT_2026-04-10.md +++ b/docs/audits/ACCESSIBILITY_AUDIT_2026-04-10.md @@ -1,49 +1,49 @@ -# GoodGo Platform Frontend - Comprehensive Accessibility Audit Report -**Date:** April 10, 2026 -**Audited:** apps/web (Next.js 15) -**Total Files Analyzed:** 90+ TSX/JSX files -**ARIA Attributes Found:** 75 instances across 14 files +# Báo Cáo Kiểm Tra Toàn Diện Khả Năng Tiếp Cận Frontend GoodGo Platform +**Ngày:** 10 tháng 4, 2026 +**Đối tượng kiểm tra:** apps/web (Next.js 15) +**Tổng số tệp đã phân tích:** 90+ tệp TSX/JSX +**Thuộc tính ARIA tìm thấy:** 75 trường hợp trên 14 tệp --- -## Executive Summary +## Tóm Tắt Điều Hành -The GoodGo Platform frontend demonstrates **good foundational accessibility practices** with a skip-to-content link, proper semantic HTML roles, ARIA labels on interactive elements, and form validation. However, there are several areas requiring improvement: +Giao diện frontend của GoodGo Platform thể hiện **các thực hành khả năng tiếp cận nền tảng tốt** với liên kết bỏ qua nội dung, các vai trò HTML ngữ nghĩa phù hợp, nhãn ARIA trên các phần tử tương tác và xác thực biểu mẫu. Tuy nhiên, có một số lĩnh vực cần cải thiện: -**Key Findings:** -- ✅ Skip-to-content link implemented -- ✅ 75 ARIA attributes across codebase -- ✅ Dialog component with focus management -- ✅ Error handling with proper ARIA attributes -- ⚠️ Icon-only buttons missing aria-labels in some areas -- ⚠️ Thumbnail buttons in image gallery lack accessible names -- ⚠️ Dialog component missing accessibility features (role, focus trap) -- ⚠️ No color contrast definitions documented -- ❌ Some form inputs missing proper label associations +**Phát hiện chính:** +- ✅ Đã triển khai liên kết bỏ qua nội dung +- ✅ 75 thuộc tính ARIA trên toàn codebase +- ✅ Thành phần Dialog với quản lý tiêu điểm +- ✅ Xử lý lỗi với các thuộc tính ARIA phù hợp +- ⚠️ Một số nơi còn thiếu aria-labels cho các nút chỉ có biểu tượng +- ⚠️ Các nút ảnh thu nhỏ trong thư viện hình ảnh thiếu tên có thể tiếp cận +- ⚠️ Thành phần Dialog thiếu các tính năng khả năng tiếp cận (role, focus trap) +- ⚠️ Chưa có tài liệu về định nghĩa độ tương phản màu sắc +- ❌ Một số ô nhập biểu mẫu thiếu liên kết nhãn phù hợp --- -## 1. CURRENT ARIA USAGE ANALYSIS +## 1. PHÂN TÍCH SỬ DỤNG ARIA HIỆN TẠI -### Summary -- **Total ARIA Attributes:** 75 instances -- **Files Using ARIA:** 14 files -- **Most Common:** aria-label (41 instances), aria-hidden (17 instances) +### Tóm Tắt +- **Tổng số thuộc tính ARIA:** 75 trường hợp +- **Các tệp sử dụng ARIA:** 14 tệp +- **Phổ biến nhất:** aria-label (41 trường hợp), aria-hidden (17 trường hợp) -### Detailed ARIA Breakdown by File +### Phân Tích ARIA Chi Tiết Theo Tệp -#### Public Layout (`apps/web/app/[locale]/(public)/layout.tsx`) -**Line 49:** `aria-label={t('nav.mainNav')}` -- Location: Desktop navigation element -- Type: Semantic navigation landmark +#### Layout Công Khai (`apps/web/app/[locale]/(public)/layout.tsx`) +**Dòng 49:** `aria-label={t('nav.mainNav')}` +- Vị trí: Phần tử điều hướng trên máy tính để bàn +- Loại: Điểm mốc điều hướng ngữ nghĩa -**Line 91:** `aria-label={mobileMenuOpen ? t('nav.closeMenu') : t('nav.openMenu')}` -- Location: Mobile hamburger button -- Type: Dynamically updated label based on state -- Status: ✅ Properly implemented +**Dòng 91:** `aria-label={mobileMenuOpen ? t('nav.closeMenu') : t('nav.openMenu')}` +- Vị trí: Nút hamburger trên di động +- Loại: Nhãn được cập nhật động dựa trên trạng thái +- Trạng thái: ✅ Được triển khai đúng cách -#### Root Layout (`apps/web/app/[locale]/layout.tsx`) -**Lines 105-109:** Skip-to-content link +#### Layout Gốc (`apps/web/app/[locale]/layout.tsx`) +**Dòng 105-109:** Liên kết bỏ qua nội dung ```tsx ``` -- Status: ✅ Properly implemented with focus visibility -- Hidden by default with -translate-y-16, visible on focus -- Links to `id="main-content"` on main element +- Trạng thái: ✅ Được triển khai đúng cách với khả năng hiển thị tiêu điểm +- Ẩn theo mặc định với -translate-y-16, hiển thị khi được tiêu điểm +- Liên kết đến `id="main-content"` trên phần tử main -#### Dashboard Layout (`apps/web/app/[locale]/(dashboard)/layout.tsx`) -**Line 47:** `aria-label={t('nav.dashboardNav')}` -- Location: Mobile sidebar navigation -- Type: Navigation landmark +#### Layout Dashboard (`apps/web/app/[locale]/(dashboard)/layout.tsx`) +**Dòng 47:** `aria-label={t('nav.dashboardNav')}` +- Vị trí: Điều hướng thanh bên trên di động +- Loại: Điểm mốc điều hướng -**Line 58:** `aria-label={t('nav.closeMenu')}` -- Location: Mobile sidebar close button -- Type: Icon-only button with label +**Dòng 58:** `aria-label={t('nav.closeMenu')}` +- Vị trí: Nút đóng thanh bên trên di động +- Loại: Nút chỉ có biểu tượng với nhãn -**Line 79:** `aria-hidden="true"` -- Location: Emoji icon in navigation items -- Type: Decorative content hiding +**Dòng 79:** `aria-hidden="true"` +- Vị trí: Biểu tượng Emoji trong các mục điều hướng +- Loại: Ẩn nội dung trang trí -**Line 95:** `aria-hidden="true"` -- Location: LogOut icon -- Type: Decorative icon hiding +**Dòng 95:** `aria-hidden="true"` +- Vị trí: Biểu tượng LogOut +- Loại: Ẩn biểu tượng trang trí -**Line 108:** `aria-label={t('nav.openMenu')}` -- Location: Mobile hamburger button -- Type: Icon-only button +**Dòng 108:** `aria-label={t('nav.openMenu')}` +- Vị trí: Nút hamburger trên di động +- Loại: Nút chỉ có biểu tượng -**Line 120:** `aria-label={t('nav.dashboardNav')}` -- Location: Desktop navigation -- Type: Navigation landmark +**Dòng 120:** `aria-label={t('nav.dashboardNav')}` +- Vị trí: Điều hướng trên máy tính để bàn +- Loại: Điểm mốc điều hướng -**Line 125:** `aria-label={item.label}` -- Location: Navigation items -- Type: Redundant label (text already visible) -- Status: ⚠️ Not needed when text is visible +**Dòng 125:** `aria-label={item.label}` +- Vị trí: Các mục điều hướng +- Loại: Nhãn dư thừa (văn bản đã hiển thị) +- Trạng thái: ⚠️ Không cần thiết khi văn bản đã hiển thị -**Line 133:** `aria-hidden="true"` -- Location: Icon in navigation items -- Type: Decorative content +**Dòng 133:** `aria-hidden="true"` +- Vị trí: Biểu tượng trong các mục điều hướng +- Loại: Nội dung trang trí -**Line 150:** `aria-label={theme === 'light' ? t('dashboard.darkMode') : t('dashboard.lightMode')}` -- Location: Theme toggle button -- Type: Dynamic aria-label ✅ Good +**Dòng 150:** `aria-label={theme === 'light' ? t('dashboard.darkMode') : t('dashboard.lightMode')}` +- Vị trí: Nút chuyển đổi chủ đề +- Loại: aria-label động ✅ Tốt -**Lines 154, 158:** `aria-hidden="true"` on SVGs -- Location: Theme toggle icons -- Type: Decorative content hiding +**Dòng 154, 158:** `aria-hidden="true"` trên SVG +- Vị trí: Biểu tượng chuyển đổi chủ đề +- Loại: Ẩn nội dung trang trí -#### Admin Layout (`apps/web/app/[locale]/(admin)/layout.tsx`) -**Line 60:** `aria-hidden="true"` -- Location: Mobile overlay backdrop +#### Layout Quản Trị (`apps/web/app/[locale]/(admin)/layout.tsx`) +**Dòng 60:** `aria-hidden="true"` +- Vị trí: Nền phủ di động -**Line 67:** `aria-label={t('nav.adminNav')}` -- Location: Sidebar navigation +**Dòng 67:** `aria-label={t('nav.adminNav')}` +- Vị trí: Điều hướng thanh bên -**Line 81:** `aria-label={t('adminNav.closeMenu')}` -- Location: Close button +**Dòng 81:** `aria-label={t('adminNav.closeMenu')}` +- Vị trí: Nút đóng -**Line 89:** `aria-label={t('nav.adminNav')}` -- Location: Navigation container (duplicate) +**Dòng 89:** `aria-label={t('nav.adminNav')}` +- Vị trí: Vùng chứa điều hướng (trùng lặp) -**Line 108:** `aria-hidden="true"` -- Location: Navigation icon +**Dòng 108:** `aria-hidden="true"` +- Vị trí: Biểu tượng điều hướng -**Line 126:** `aria-hidden="true"` -- Location: LogOut icon +**Dòng 126:** `aria-hidden="true"` +- Vị trí: Biểu tượng LogOut -**Line 135:** `aria-label={t('adminNav.openMenu')}` -- Location: Mobile hamburger button +**Dòng 135:** `aria-label={t('adminNav.openMenu')}` +- Vị trí: Nút hamburger trên di động -#### Language Switcher (`apps/web/components/ui/language-switcher.tsx`) -**Line 29:** `aria-label={`${t('label')}: ${t(locale)} → ${t(nextLocale)}`}` -- Location: Language toggle button -- Status: ✅ Descriptive label indicating action +#### Bộ Chuyển Đổi Ngôn Ngữ (`apps/web/components/ui/language-switcher.tsx`) +**Dòng 29:** `aria-label={`${t('label')}: ${t(locale)} → ${t(nextLocale)}`}` +- Vị trí: Nút chuyển đổi ngôn ngữ +- Trạng thái: ✅ Nhãn mô tả cho biết hành động -**Line 31:** `aria-hidden="true"` -- Location: Emoji display -- Type: Decorative content +**Dòng 31:** `aria-hidden="true"` +- Vị trí: Hiển thị Emoji +- Loại: Nội dung trang trí -#### Search/Filter Components (`apps/web/components/search/filter-bar.tsx`) -**Line 79:** `role="search" aria-label={t('filters')}` -- Location: Filter section -- Status: ✅ Proper semantic role with label +#### Thành Phần Tìm Kiếm/Bộ Lọc (`apps/web/components/search/filter-bar.tsx`) +**Dòng 79:** `role="search" aria-label={t('filters')}` +- Vị trí: Phần bộ lọc +- Trạng thái: ✅ Vai trò ngữ nghĩa phù hợp với nhãn -**Lines 87, 101, 115, 129:** `aria-label` on select inputs -- Location: Filter dropdowns -- Pattern: `aria-label={t('allTransactions')}`, `aria-label={t('allPropertyTypes')}`, etc. -- Status: ✅ Accessible form controls +**Dòng 87, 101, 115, 129:** `aria-label` trên các ô nhập chọn +- Vị trí: Danh sách thả xuống bộ lọc +- Mẫu: `aria-label={t('allTransactions')}`, `aria-label={t('allPropertyTypes')}`, v.v. +- Trạng thái: ✅ Điều khiển biểu mẫu có thể tiếp cận -**Lines 150, 158, 167, 182, 192:** `aria-label` on range inputs -- Location: Area and bedroom filters -- Status: ✅ Clear labels for input ranges +**Dòng 150, 158, 167, 182, 192:** `aria-label` trên các ô nhập phạm vi +- Vị trí: Bộ lọc diện tích và số phòng ngủ +- Trạng thái: ✅ Nhãn rõ ràng cho các phạm vi nhập -#### Image Gallery (`apps/web/components/listings/image-gallery.tsx`) -**Line 47:** `aria-label="Ảnh trước"` (Previous image) -- Location: Previous button -- Status: ✅ Icon-only button with aria-label +#### Thư Viện Hình Ảnh (`apps/web/components/listings/image-gallery.tsx`) +**Dòng 47:** `aria-label="Ảnh trước"` (Hình ảnh trước) +- Vị trí: Nút trước +- Trạng thái: ✅ Nút chỉ có biểu tượng với aria-label -**Line 54:** `aria-label="Ảnh tiếp"` (Next image) -- Location: Next button -- Status: ✅ Icon-only button with aria-label +**Dòng 54:** `aria-label="Ảnh tiếp"` (Hình ảnh tiếp theo) +- Vị trí: Nút tiếp theo +- Trạng thái: ✅ Nút chỉ có biểu tượng với aria-label -#### Property Card (`apps/web/components/search/property-card.tsx`) -**Line 36:** `aria-label={`${listing.property.title} — ${transactionLabel} ${propertyTypeLabel}, ${formatPrice(listing.priceVND)} VNĐ`}` -- Location: Article element wrapping property card -- Status: ✅ Descriptive accessible name for card +#### Thẻ Bất Động Sản (`apps/web/components/search/property-card.tsx`) +**Dòng 36:** `aria-label={`${listing.property.title} — ${transactionLabel} ${propertyTypeLabel}, ${formatPrice(listing.priceVND)} VNĐ`}` +- Vị trí: Phần tử article bao quanh thẻ bất động sản +- Trạng thái: ✅ Tên có thể tiếp cận mô tả cho thẻ -**Line 50:** `aria-hidden="true"` -- Location: "No image" placeholder -- Type: Decorative content +**Dòng 50:** `aria-hidden="true"` +- Vị trí: Chỗ giữ chỗ "Không có hình ảnh" +- Loại: Nội dung trang trí -**Line 64:** `aria-label={`${listing.property.media.length} ảnh`}` -- Location: Image count badge -- Status: ⚠️ Badge is decorative, aria-label not needed +**Dòng 64:** `aria-label={`${listing.property.media.length} ảnh`}` +- Vị trí: Huy hiệu số lượng hình ảnh +- Trạng thái: ⚠️ Huy hiệu mang tính trang trí, không cần aria-label -**Line 81:** `aria-label="Thông tin bất động sản"` -- Location: Property details list -- Status: ✅ List with semantic label +**Dòng 81:** `aria-label="Thông tin bất động sản"` +- Vị trí: Danh sách chi tiết bất động sản +- Trạng thái: ✅ Danh sách với nhãn ngữ nghĩa -#### Authentication Pages +#### Các Trang Xác Thực -**Login Page (`apps/web/app/[locale]/(auth)/login/page.tsx`)** -- Line 76: `aria-describedby={errors.phone ? 'phone-error' : undefined}` -- Line 77: `aria-invalid={!!errors.phone}` -- Line 92: `aria-label={showPassword ? t('hidePassword') : t('showPassword')}` -- Line 102: `aria-describedby={errors.password ? 'password-error' : undefined}` -- Line 103: `aria-invalid={!!errors.password}` -- Line 112: `aria-hidden="true"` on loading spinner -- Status: ✅ Comprehensive form accessibility +**Trang Đăng Nhập (`apps/web/app/[locale]/(auth)/login/page.tsx`)** +- Dòng 76: `aria-describedby={errors.phone ? 'phone-error' : undefined}` +- Dòng 77: `aria-invalid={!!errors.phone}` +- Dòng 92: `aria-label={showPassword ? t('hidePassword') : t('showPassword')}` +- Dòng 102: `aria-describedby={errors.password ? 'password-error' : undefined}` +- Dòng 103: `aria-invalid={!!errors.password}` +- Dòng 112: `aria-hidden="true"` trên vòng xoay tải +- Trạng thái: ✅ Khả năng tiếp cận biểu mẫu toàn diện -**Register Page (`apps/web/app/[locale]/(auth)/register/page.tsx`)** -- Similar pattern to login page with aria-describedby and aria-invalid -- Lines 70, 71, 86, 87, 102, 103, 118, 128, 129, 144, 145 -- Status: ✅ Properly implemented +**Trang Đăng Ký (`apps/web/app/[locale]/(auth)/register/page.tsx`)** +- Mẫu tương tự trang đăng nhập với aria-describedby và aria-invalid +- Dòng 70, 71, 86, 87, 102, 103, 118, 128, 129, 144, 145 +- Trạng thái: ✅ Được triển khai đúng cách -#### Landing/Home Page (`apps/web/app/[locale]/(public)/page.tsx`) -**Line 85:** `role="search" aria-label={t('common.search')}` -- Location: Main search form -- Status: ✅ Proper semantic role +#### Trang Đích/Trang Chủ (`apps/web/app/[locale]/(public)/page.tsx`) +**Dòng 85:** `role="search" aria-label={t('common.search')}` +- Vị trí: Biểu mẫu tìm kiếm chính +- Trạng thái: ✅ Vai trò ngữ nghĩa phù hợp -**Line 92:** `aria-label={t('landing.searchPlaceholder')}` -- Location: Search input -- Status: ⚠️ Redundant with placeholder +**Dòng 92:** `aria-label={t('landing.searchPlaceholder')}` +- Vị trí: Ô nhập tìm kiếm +- Trạng thái: ⚠️ Dư thừa với placeholder -**Line 99:** `aria-label={t('landing.transactionTypeLabel')}` -- Location: Transaction type select -- Status: ✅ Good for form accessibility +**Dòng 99:** `aria-label={t('landing.transactionTypeLabel')}` +- Vị trí: Lựa chọn loại giao dịch +- Trạng thái: ✅ Tốt cho khả năng tiếp cận biểu mẫu -**Line 114:** `aria-hidden="true"` -- Location: Decorative SVG +**Dòng 114:** `aria-hidden="true"` +- Vị trí: SVG trang trí -**Line 147:** `aria-labelledby="featured-heading"` -- Location: Featured listings section -- Status: ✅ Section properly labeled +**Dòng 147:** `aria-labelledby="featured-heading"` +- Vị trí: Phần danh sách nổi bật +- Trạng thái: ✅ Phần được gắn nhãn đúng cách -**Line 162:** `role="status" aria-label={t('common.loading')}` -- Location: Loading indicator -- Status: ✅ Proper role for status messages +**Dòng 162:** `role="status" aria-label={t('common.loading')}` +- Vị trí: Chỉ báo tải +- Trạng thái: ✅ Vai trò phù hợp cho thông báo trạng thái -**Line 163:** `aria-hidden="true"` -- Location: Spinner animation +**Dòng 163:** `aria-hidden="true"` +- Vị trí: Hoạt ảnh vòng xoay -**Line 188:** `aria-labelledby="districts-heading"` -- Location: Districts section -- Status: ✅ Section label +**Dòng 188:** `aria-labelledby="districts-heading"` +- Vị trí: Phần quận huyện +- Trạng thái: ✅ Nhãn phần -**Line 204:** `aria-hidden="true"` -- Location: Emoji decorations +**Dòng 204:** `aria-hidden="true"` +- Vị trí: Trang trí Emoji -**Line 219:** `aria-labelledby="stats-heading"` -- Location: Statistics section -- Status: ✅ Section label +**Dòng 219:** `aria-labelledby="stats-heading"` +- Vị trí: Phần thống kê +- Trạng thái: ✅ Nhãn phần -**Line 234:** `aria-hidden="true"` -- Location: Emoji icons in stats +**Dòng 234:** `aria-hidden="true"` +- Vị trí: Biểu tượng Emoji trong thống kê -#### Error and Not-Found Pages +#### Trang Lỗi và Không Tìm Thấy **error.tsx:** -- Line 51: `aria-hidden="true"` on decorative emoji -- Line 85: `aria-hidden="true"` on SVG spinner +- Dòng 51: `aria-hidden="true"` trên emoji trang trí +- Dòng 85: `aria-hidden="true"` trên vòng xoay SVG **not-found.tsx:** -- Line 10: `aria-hidden="true"` on 404 number +- Dòng 10: `aria-hidden="true"` trên số 404 -#### UI Component Tests (`components/ui/__tests__/select.spec.tsx`) -- Lines 9, 22, 34: `aria-label` on select components -- Status: ✅ Tests verify accessibility +#### Kiểm Thử Thành Phần UI (`components/ui/__tests__/select.spec.tsx`) +- Dòng 9, 22, 34: `aria-label` trên các thành phần select +- Trạng thái: ✅ Kiểm thử xác minh khả năng tiếp cận --- -## 2. ICON-ONLY BUTTONS ANALYSIS +## 2. PHÂN TÍCH CÁC NÚT CHỈ CÓ BIỂU TƯỢNG -### Buttons Requiring aria-label +### Các Nút Cần aria-label -#### ✅ Properly Labeled Icon Buttons +#### ✅ Các Nút Biểu Tượng Được Gắn Nhãn Đúng Cách -1. **Mobile Menu Toggle** (`apps/web/app/[locale]/(public)/layout.tsx:90-96`) +1. **Nút Chuyển Đổi Menu Di Động** (`apps/web/app/[locale]/(public)/layout.tsx:90-96`) ```tsx ``` - - Status: ✅ Dynamic aria-label based on state + - Trạng thái: ✅ aria-label động dựa trên trạng thái -2. **Theme Toggle** (`apps/web/app/[locale]/(dashboard)/layout.tsx:146-160`) +2. **Nút Chuyển Đổi Chủ Đề** (`apps/web/app/[locale]/(dashboard)/layout.tsx:146-160`) ```tsx ``` - - Status: ✅ Proper button with icon and aria-label + - Trạng thái: ✅ Nút phù hợp với biểu tượng và aria-label -3. **Language Switcher** (`apps/web/components/ui/language-switcher.tsx:25-34`) +3. **Bộ Chuyển Đổi Ngôn Ngữ** (`apps/web/components/ui/language-switcher.tsx:25-34`) ```tsx ``` - - Status: ✅ Uses both aria-label and sr-only for redundancy + - Trạng thái: ✅ Sử dụng cả aria-label và sr-only để tăng tính dự phòng -4. **Image Gallery Navigation** (`apps/web/components/listings/image-gallery.tsx:44-57`) +4. **Điều Hướng Thư Viện Hình Ảnh** (`apps/web/components/listings/image-gallery.tsx:44-57`) ```tsx ``` - - Status: ✅ Previous/Next buttons have clear labels + - Trạng thái: ✅ Các nút Trước/Tiếp theo có nhãn rõ ràng -#### ⚠️ Icon-Only Buttons Requiring Attention +#### ⚠️ Các Nút Chỉ Có Biểu Tượng Cần Chú Ý -1. **Thumbnail Buttons** (`apps/web/components/listings/image-gallery.tsx:69-84`) +1. **Các Nút Ảnh Thu Nhỏ** (`apps/web/components/listings/image-gallery.tsx:69-84`) ```tsx ``` - - **Issue:** No aria-label on thumbnail buttons - - **Impact:** Screen reader users can't identify which thumbnail they're selecting - - **Fix:** Add `aria-label={`Select image ${index + 1}`}` + - **Vấn đề:** Không có aria-label trên các nút ảnh thu nhỏ + - **Tác động:** Người dùng trình đọc màn hình không thể xác định ảnh thu nhỏ nào họ đang chọn + - **Sửa:** Thêm `aria-label={`Select image ${index + 1}`}` -2. **Admin/Dashboard Mobile Close Button** (`apps/web/app/[locale]/(admin)/layout.tsx:80-86`) +2. **Nút Đóng Di Động Admin/Dashboard** (`apps/web/app/[locale]/(admin)/layout.tsx:80-86`) ```tsx ``` - - Status: ✅ Has aria-label (verified) + - Trạng thái: ✅ Đã có aria-label (đã xác minh) -3. **Dashboard Mobile Close Button** (`apps/web/app/[locale]/(dashboard)/layout.tsx:57-63`) +3. **Nút Đóng Di Động Dashboard** (`apps/web/app/[locale]/(dashboard)/layout.tsx:57-63`) ```tsx ``` - - Status: ✅ Has aria-label (verified) + - Trạng thái: ✅ Đã có aria-label (đã xác minh) -4. **Admin Mobile Menu Button** (`apps/web/app/[locale]/(admin)/layout.tsx:135`) +4. **Nút Menu Di Động Admin** (`apps/web/app/[locale]/(admin)/layout.tsx:135`) ```tsx ``` - - Status: ✅ Has aria-label (verified) + - Trạng thái: ✅ Đã có aria-label (đã xác minh) -5. **Password Show/Hide Button** (`apps/web/app/[locale]/(auth)/login/page.tsx:88-95`) +5. **Nút Hiện/Ẩn Mật Khẩu** (`apps/web/app/[locale]/(auth)/login/page.tsx:88-95`) ```tsx ``` - - **Problem:** No aria-label or aria-labelledby - - **Impact:** Screen reader users see only "button" without context - - **Fix:** Add `aria-label={`Select image ${index + 1}: ${img.caption || 'unlabeled'}`}` + - **Vấn đề:** Không có aria-label hoặc aria-labelledby + - **Tác động:** Người dùng trình đọc màn hình chỉ thấy "button" mà không có ngữ cảnh + - **Sửa:** Thêm `aria-label={`Select image ${index + 1}: ${img.caption || 'unlabeled'}`}` -2. **Navigation Links with Only Icons** (in Dashboard/Admin) - - **File:** `apps/web/app/[locale]/(dashboard)/layout.tsx:122-135` - - **Current:** Links on mobile with icon only - - **Status:** ✅ Actually has text on desktop, hidden on mobile - - **Code:** +2. **Liên Kết Điều Hướng Chỉ Có Biểu Tượng** (trong Dashboard/Admin) + - **Tệp:** `apps/web/app/[locale]/(dashboard)/layout.tsx:122-135` + - **Hiện tại:** Liên kết trên di động chỉ có biểu tượng + - **Trạng thái:** ✅ Thực ra có văn bản trên máy tính để bàn, ẩn trên di động + - **Mã:** ```tsx {item.label} ``` - - **Note:** aria-label is redundant here since text is visible on some screens - - **Recommendation:** Consider removing aria-label, as visible text is preferred + - **Lưu ý:** aria-label là dư thừa ở đây vì văn bản hiển thị trên một số màn hình + - **Khuyến nghị:** Cân nhắc loại bỏ aria-label, vì văn bản hiển thị được ưu tiên -3. **OAuth Buttons** (Potentially Problematic) - - **File:** `apps/web/components/auth/oauth-buttons.tsx:10-53` - - **Current:** +3. **Nút OAuth** (Có thể có vấn đề) + - **Tệp:** `apps/web/components/auth/oauth-buttons.tsx:10-53` + - **Hiện tại:** ```tsx ``` - - **Status:** ✅ Has visible text "Google" and "Zalo" - - **Issue:** SVG icons lack alt text, but not critical since text label exists + - **Trạng thái:** ✅ Có văn bản hiển thị "Google" và "Zalo" + - **Vấn đề:** Biểu tượng SVG thiếu alt text, nhưng không nghiêm trọng vì nhãn văn bản đã tồn tại -4. **Search Form with Select Dropdown** (MINOR) - - **File:** `apps/web/app/[locale]/(public)/page.tsx:95-114` - - **Status:** ✅ All controls have aria-labels - - **Note:** Dropdowns are properly accessible +4. **Biểu Mẫu Tìm Kiếm Có Danh Sách Thả Xuống** (NHỎ) + - **Tệp:** `apps/web/app/[locale]/(public)/page.tsx:95-114` + - **Trạng thái:** ✅ Tất cả điều khiển đều có aria-labels + - **Lưu ý:** Các danh sách thả xuống có thể tiếp cận đúng cách -### Summary: Interactive Elements -- **Properly Named:** ~95% of interactive elements -- **Critical Issues:** Thumbnail buttons (1 location, multiple instances) -- **Minor Issues:** Some redundant aria-labels on visible text links -- **Action Items:** Add accessible names to image thumbnails +### Tóm Tắt: Các Phần Tử Tương Tác +- **Được đặt tên đúng cách:** ~95% phần tử tương tác +- **Vấn đề nghiêm trọng:** Các nút ảnh thu nhỏ (1 vị trí, nhiều trường hợp) +- **Vấn đề nhỏ:** Một số aria-labels dư thừa trên liên kết có văn bản hiển thị +- **Hành động cần thực hiện:** Thêm tên có thể tiếp cận vào ảnh thu nhỏ hình ảnh --- -## 6. LAYOUT STRUCTURE & LANDMARK REGIONS +## 6. CẤU TRÚC LAYOUT & CÁC VÙNG ĐIỂM MỐC -### Main Layout Files +### Các Tệp Layout Chính -#### 1. **Root Layout** (`apps/web/app/[locale]/layout.tsx`) -**Structure:** +#### 1. **Layout Gốc** (`apps/web/app/[locale]/layout.tsx`) +**Cấu trúc:** ``` @@ -615,63 +615,63 @@ The GoodGo Platform frontend demonstrates **good foundational accessibility prac ``` -- Status: ✅ Proper language attribute -- Providers properly nested -- Skip-to-content link present +- Trạng thái: ✅ Thuộc tính ngôn ngữ phù hợp +- Các provider được lồng nhau đúng cách +- Liên kết bỏ qua nội dung có mặt -#### 2. **Public Layout** (`apps/web/app/[locale]/(public)/layout.tsx`) -**Landmarks:** -- `
` (Line 39-146) - - Navigation: `