chore: update project documentation, audit reports, and initialize IDE configuration files
Some checks failed
CI / Lint → Typecheck → Test → Build (22) (push) Failing after 29s
CI / E2E Tests (push) Has been skipped
CodeQL Analysis / CodeQL (javascript-typescript) (push) Failing after 2m42s
Deploy / Build Web Image (push) Failing after 27s
Deploy / Build AI Services Image (push) Failing after 29s
E2E Tests / Playwright E2E (push) Failing after 43s
Deploy / Build API Image (push) Failing after 1m31s
Security Scanning / Dependency Audit (pnpm) (push) Failing after 6s
Security Scanning / Trivy Scan — API Image (push) Failing after 5m35s
Security Scanning / Trivy Scan — AI Services Image (push) Failing after 3m45s
Deploy / Deploy to Staging (push) Has been skipped
Deploy / Smoke Test Staging (push) Has been skipped
Deploy / Deploy to Production (push) Has been skipped
Deploy / Smoke Test Production (push) Has been skipped
Deploy / Rollback Staging (push) Has been skipped
Deploy / Rollback Production (push) Has been skipped
Security Scanning / Trivy Scan — Web Image (push) Failing after 13m51s
Security Scanning / Trivy Filesystem Scan (push) Failing after 14m46s
Security Scanning / Security Gate (push) Has been cancelled
Some checks failed
CI / Lint → Typecheck → Test → Build (22) (push) Failing after 29s
CI / E2E Tests (push) Has been skipped
CodeQL Analysis / CodeQL (javascript-typescript) (push) Failing after 2m42s
Deploy / Build Web Image (push) Failing after 27s
Deploy / Build AI Services Image (push) Failing after 29s
E2E Tests / Playwright E2E (push) Failing after 43s
Deploy / Build API Image (push) Failing after 1m31s
Security Scanning / Dependency Audit (pnpm) (push) Failing after 6s
Security Scanning / Trivy Scan — API Image (push) Failing after 5m35s
Security Scanning / Trivy Scan — AI Services Image (push) Failing after 3m45s
Deploy / Deploy to Staging (push) Has been skipped
Deploy / Smoke Test Staging (push) Has been skipped
Deploy / Deploy to Production (push) Has been skipped
Deploy / Smoke Test Production (push) Has been skipped
Deploy / Rollback Staging (push) Has been skipped
Deploy / Rollback Production (push) Has been skipped
Security Scanning / Trivy Scan — Web Image (push) Failing after 13m51s
Security Scanning / Trivy Filesystem Scan (push) Failing after 14m46s
Security Scanning / Security Gate (push) Has been cancelled
This commit is contained in:
@@ -1,125 +1,125 @@
|
||||
# Property Detail Page - Documentation Index
|
||||
# Trang Chi Tiết Bất Động Sản - Mục Lục Tài Liệu
|
||||
|
||||
Created: 2026-04-11
|
||||
Project: GoodGo Platform (Vietnamese Real Estate)
|
||||
Ngày tạo: 2026-04-11
|
||||
Dự án: GoodGo Platform (Bất Động Sản Việt Nam)
|
||||
|
||||
---
|
||||
|
||||
## 📚 Documentation Files
|
||||
## 📚 Các Tệp Tài Liệu
|
||||
|
||||
### 1. **PROPERTY_DETAIL_PAGE_ANALYSIS.md** (17KB, 553 lines)
|
||||
**Comprehensive Analysis** - Start here for complete understanding
|
||||
### 1. **PROPERTY_DETAIL_PAGE_ANALYSIS.md** (17KB, 553 dòng)
|
||||
**Phân Tích Toàn Diện** - Bắt đầu từ đây để hiểu đầy đủ
|
||||
|
||||
Contains:
|
||||
- ✅ Project overview (Next.js 15, Tailwind, Zustand)
|
||||
- ✅ Full page structure & architecture
|
||||
- ✅ Property images implementation
|
||||
- ✅ Image-related components (gallery, upload)
|
||||
- ✅ Project component structure & patterns
|
||||
- ✅ Next.js Image usage patterns
|
||||
- ✅ State management patterns (Zustand)
|
||||
- ✅ Available third-party libraries
|
||||
- ✅ Tailwind & design tokens
|
||||
- ✅ API & data types (PropertyMedia, ListingDetail)
|
||||
- ✅ Complete file structure
|
||||
- ✅ Key insights & best practices
|
||||
- ✅ Dependencies not present
|
||||
Nội dung:
|
||||
- ✅ Tổng quan dự án (Next.js 15, Tailwind, Zustand)
|
||||
- ✅ Cấu trúc trang đầy đủ và kiến trúc
|
||||
- ✅ Triển khai ảnh bất động sản
|
||||
- ✅ Các thành phần liên quan đến ảnh (thư viện ảnh, tải lên)
|
||||
- ✅ Cấu trúc và mẫu thành phần dự án
|
||||
- ✅ Mẫu sử dụng Next.js Image
|
||||
- ✅ Mẫu quản lý trạng thái (Zustand)
|
||||
- ✅ Các thư viện bên thứ ba hiện có
|
||||
- ✅ Tailwind và các token thiết kế
|
||||
- ✅ API và kiểu dữ liệu (PropertyMedia, ListingDetail)
|
||||
- ✅ Cấu trúc tệp đầy đủ
|
||||
- ✅ Những điểm quan trọng và thực hành tốt nhất
|
||||
- ✅ Các phụ thuộc chưa có
|
||||
|
||||
**Use when:** You need a deep understanding of the architecture
|
||||
**Dùng khi:** Bạn cần hiểu sâu về kiến trúc
|
||||
|
||||
---
|
||||
|
||||
### 2. **PROPERTY_DETAIL_QUICK_REFERENCE.md** (13KB, 583 lines)
|
||||
**Code Snippets & Patterns** - Quick lookup guide
|
||||
### 2. **PROPERTY_DETAIL_QUICK_REFERENCE.md** (13KB, 583 dòng)
|
||||
**Đoạn Mã & Mẫu** - Hướng dẫn tra cứu nhanh
|
||||
|
||||
Contains:
|
||||
- 🎯 Quick navigation (file paths, routes)
|
||||
- 🖼️ Working with images (gallery, upload, data structure)
|
||||
- 🎨 Styling patterns (aspect ratios, Tailwind classes)
|
||||
- 🔄 State management patterns (Zustand, local state)
|
||||
- 🧩 UI component patterns (Button, Badge, Card, Dialog)
|
||||
- 📱 Responsive design patterns (breakpoints, grid)
|
||||
- 🔗 Common imports (ready-to-copy imports)
|
||||
- 📊 Data fetching examples
|
||||
- 🌐 Internationalization
|
||||
- 🔐 Security features
|
||||
- 🧪 Testing considerations
|
||||
- 🚀 Performance optimization tips
|
||||
- 📋 Common tasks (add UI element, modify gallery)
|
||||
- 🐛 Common issues & solutions
|
||||
Nội dung:
|
||||
- 🎯 Điều hướng nhanh (đường dẫn tệp, các route)
|
||||
- 🖼️ Làm việc với ảnh (thư viện ảnh, tải lên, cấu trúc dữ liệu)
|
||||
- 🎨 Mẫu tạo kiểu (tỉ lệ khung hình, các lớp Tailwind)
|
||||
- 🔄 Mẫu quản lý trạng thái (Zustand, trạng thái cục bộ)
|
||||
- 🧩 Mẫu thành phần UI (Button, Badge, Card, Dialog)
|
||||
- 📱 Mẫu thiết kế đáp ứng (điểm dừng, lưới)
|
||||
- 🔗 Các import thông dụng (import sẵn sàng để sao chép)
|
||||
- 📊 Ví dụ lấy dữ liệu
|
||||
- 🌐 Quốc tế hóa
|
||||
- 🔐 Tính năng bảo mật
|
||||
- 🧪 Các cân nhắc kiểm thử
|
||||
- 🚀 Mẹo tối ưu hóa hiệu suất
|
||||
- 📋 Các tác vụ thông dụng (thêm phần tử UI, chỉnh sửa thư viện ảnh)
|
||||
- 🐛 Các vấn đề phổ biến & giải pháp
|
||||
|
||||
**Use when:** You need code snippets, patterns, or quick answers
|
||||
**Dùng khi:** Bạn cần đoạn mã, mẫu, hoặc câu trả lời nhanh
|
||||
|
||||
---
|
||||
|
||||
### 3. **PROPERTY_DETAIL_COMPONENTS_MAP.md** (14KB, 601 lines)
|
||||
**Component Hierarchy & Architecture** - Visual reference
|
||||
### 3. **PROPERTY_DETAIL_COMPONENTS_MAP.md** (14KB, 601 dòng)
|
||||
**Phân Cấp Thành Phần & Kiến Trúc** - Tài liệu tham khảo trực quan
|
||||
|
||||
Contains:
|
||||
- 🎯 Page component hierarchy (visual tree)
|
||||
- 🖼️ Image Gallery component details
|
||||
- 📱 Image Upload component details
|
||||
- 🧩 Related components (search results, property card)
|
||||
- 🌐 Data flow & API mapping
|
||||
- 🎨 Styling architecture
|
||||
- 📊 State management patterns
|
||||
- 🔗 Import map & file references
|
||||
- 📈 Component complexity levels
|
||||
- 🚀 Performance considerations
|
||||
- 🔄 Navigation flows
|
||||
- 📋 Component checklists
|
||||
- 🛠️ Maintenance guide
|
||||
Nội dung:
|
||||
- 🎯 Phân cấp thành phần trang (cây trực quan)
|
||||
- 🖼️ Chi tiết thành phần Thư Viện Ảnh
|
||||
- 📱 Chi tiết thành phần Tải Lên Ảnh
|
||||
- 🧩 Các thành phần liên quan (kết quả tìm kiếm, thẻ bất động sản)
|
||||
- 🌐 Luồng dữ liệu & ánh xạ API
|
||||
- 🎨 Kiến trúc tạo kiểu
|
||||
- 📊 Mẫu quản lý trạng thái
|
||||
- 🔗 Bản đồ import & tham chiếu tệp
|
||||
- 📈 Mức độ phức tạp của thành phần
|
||||
- 🚀 Các cân nhắc về hiệu suất
|
||||
- 🔄 Luồng điều hướng
|
||||
- 📋 Danh sách kiểm tra thành phần
|
||||
- 🛠️ Hướng dẫn bảo trì
|
||||
|
||||
**Use when:** You need to understand component relationships
|
||||
**Dùng khi:** Bạn cần hiểu mối quan hệ giữa các thành phần
|
||||
|
||||
---
|
||||
|
||||
## 🎯 Quick Start Guide
|
||||
## 🎯 Hướng Dẫn Bắt Đầu Nhanh
|
||||
|
||||
### For Understanding the Current Implementation:
|
||||
1. Start with **PROPERTY_DETAIL_PAGE_ANALYSIS.md** sections:
|
||||
- Section 1: Property Detail Page Structure
|
||||
- Section 2: Property Images - Current Implementation
|
||||
- Section 3: Image-Related Components
|
||||
### Để Hiểu Triển Khai Hiện Tại:
|
||||
1. Bắt đầu với **PROPERTY_DETAIL_PAGE_ANALYSIS.md** phần:
|
||||
- Phần 1: Cấu Trúc Trang Chi Tiết Bất Động Sản
|
||||
- Phần 2: Ảnh Bất Động Sản - Triển Khai Hiện Tại
|
||||
- Phần 3: Các Thành Phần Liên Quan Đến Ảnh
|
||||
|
||||
### For Making Changes:
|
||||
1. Check **PROPERTY_DETAIL_QUICK_REFERENCE.md**:
|
||||
- Find the relevant pattern or component
|
||||
- Copy the code snippet
|
||||
- Adapt to your needs
|
||||
### Để Thực Hiện Thay Đổi:
|
||||
1. Kiểm tra **PROPERTY_DETAIL_QUICK_REFERENCE.md**:
|
||||
- Tìm mẫu hoặc thành phần liên quan
|
||||
- Sao chép đoạn mã
|
||||
- Điều chỉnh cho phù hợp nhu cầu của bạn
|
||||
|
||||
2. Reference **PROPERTY_DETAIL_COMPONENTS_MAP.md**:
|
||||
- Understand where component fits
|
||||
- Check data flow
|
||||
- Verify state management
|
||||
2. Tham chiếu **PROPERTY_DETAIL_COMPONENTS_MAP.md**:
|
||||
- Hiểu vị trí của thành phần
|
||||
- Kiểm tra luồng dữ liệu
|
||||
- Xác minh quản lý trạng thái
|
||||
|
||||
### For Building New Image Features:
|
||||
1. **PROPERTY_DETAIL_PAGE_ANALYSIS.md** - Section 5 (Next.js Image Usage)
|
||||
2. **PROPERTY_DETAIL_QUICK_REFERENCE.md** - Section "Working with Images"
|
||||
### Để Xây Dựng Tính Năng Ảnh Mới:
|
||||
1. **PROPERTY_DETAIL_PAGE_ANALYSIS.md** - Phần 5 (Cách Sử Dụng Next.js Image)
|
||||
2. **PROPERTY_DETAIL_QUICK_REFERENCE.md** - Phần "Working with Images"
|
||||
3. **PROPERTY_DETAIL_COMPONENTS_MAP.md** - "Image Gallery Component Details"
|
||||
|
||||
---
|
||||
|
||||
## 📍 Key File Locations
|
||||
## 📍 Vị Trí Các Tệp Quan Trọng
|
||||
|
||||
### Main Files
|
||||
- **Page**: `apps/web/app/[locale]/(public)/listings/[id]/page.tsx`
|
||||
- **Detail Client**: `apps/web/components/listings/listing-detail-client.tsx`
|
||||
- **Image Gallery**: `apps/web/components/listings/image-gallery.tsx`
|
||||
- **Image Upload**: `apps/web/components/listings/image-upload.tsx`
|
||||
- **Property Card**: `apps/web/components/search/property-card.tsx`
|
||||
### Tệp Chính
|
||||
- **Trang**: `apps/web/app/[locale]/(public)/listings/[id]/page.tsx`
|
||||
- **Client Chi Tiết**: `apps/web/components/listings/listing-detail-client.tsx`
|
||||
- **Thư Viện Ảnh**: `apps/web/components/listings/image-gallery.tsx`
|
||||
- **Tải Lên Ảnh**: `apps/web/components/listings/image-upload.tsx`
|
||||
- **Thẻ Bất Động Sản**: `apps/web/components/search/property-card.tsx`
|
||||
|
||||
### Configuration
|
||||
- **Tailwind Config**: `apps/web/tailwind.config.ts`
|
||||
- **Next.js Config**: `apps/web/next.config.js`
|
||||
- **Global Styles**: `apps/web/app/globals.css`
|
||||
### Cấu Hình
|
||||
- **Cấu Hình Tailwind**: `apps/web/tailwind.config.ts`
|
||||
- **Cấu Hình Next.js**: `apps/web/next.config.js`
|
||||
- **Kiểu Dáng Toàn Cục**: `apps/web/app/globals.css`
|
||||
|
||||
### API & State
|
||||
- **Listings API**: `apps/web/lib/listings-api.ts`
|
||||
- **Auth Store**: `apps/web/lib/auth-store.ts`
|
||||
- **Comparison Store**: `apps/web/lib/comparison-store.ts`
|
||||
### API & Trạng Thái
|
||||
- **API Listings**: `apps/web/lib/listings-api.ts`
|
||||
- **Store Xác Thực**: `apps/web/lib/auth-store.ts`
|
||||
- **Store So Sánh**: `apps/web/lib/comparison-store.ts`
|
||||
|
||||
### UI Components
|
||||
### Thành Phần UI
|
||||
- **Button**: `apps/web/components/ui/button.tsx`
|
||||
- **Badge**: `apps/web/components/ui/badge.tsx`
|
||||
- **Card**: `apps/web/components/ui/card.tsx`
|
||||
@@ -127,75 +127,75 @@ Contains:
|
||||
|
||||
---
|
||||
|
||||
## 🔑 Key Technologies
|
||||
## 🔑 Các Công Nghệ Chính
|
||||
|
||||
| Technology | Version | Purpose |
|
||||
| Công Nghệ | Phiên Bản | Mục Đích |
|
||||
|-----------|---------|---------|
|
||||
| Next.js | 15.5.14 | Full-stack framework (App Router) |
|
||||
| React | 18.3.0 | UI library |
|
||||
| Tailwind CSS | 3.4.0 | Styling with CSS variables |
|
||||
| Zustand | 5.0.12 | State management |
|
||||
| next-intl | 4.9.0 | i18n (Vietnamese/English) |
|
||||
| React Query | 5.96.2 | Server state management |
|
||||
| Lucide React | 1.7.0 | Icons |
|
||||
| Mapbox GL | 3.21.0 | Maps |
|
||||
| CVA | 0.7.1 | Component variants |
|
||||
| Next.js | 15.5.14 | Framework full-stack (App Router) |
|
||||
| React | 18.3.0 | Thư viện UI |
|
||||
| Tailwind CSS | 3.4.0 | Tạo kiểu với biến CSS |
|
||||
| Zustand | 5.0.12 | Quản lý trạng thái |
|
||||
| next-intl | 4.9.0 | i18n (Tiếng Việt/Tiếng Anh) |
|
||||
| React Query | 5.96.2 | Quản lý trạng thái máy chủ |
|
||||
| Lucide React | 1.7.0 | Biểu tượng |
|
||||
| Mapbox GL | 3.21.0 | Bản đồ |
|
||||
| CVA | 0.7.1 | Biến thể thành phần |
|
||||
|
||||
---
|
||||
|
||||
## ✨ Current Features
|
||||
## ✨ Tính Năng Hiện Tại
|
||||
|
||||
### Image Display
|
||||
- ✅ Responsive main image (16:9 aspect ratio)
|
||||
- ✅ Previous/Next navigation buttons
|
||||
- ✅ Image counter badge ("X / Total")
|
||||
- ✅ Horizontal scrollable thumbnails (64x64px)
|
||||
- ✅ Selected thumbnail highlighting
|
||||
- ✅ Empty state fallback
|
||||
- ✅ Next.js Image optimization (responsive sizes)
|
||||
- ✅ Lazy loading for thumbnails
|
||||
- ✅ Priority loading for first image
|
||||
### Hiển Thị Ảnh
|
||||
- ✅ Ảnh chính đáp ứng (tỉ lệ khung hình 16:9)
|
||||
- ✅ Nút điều hướng Trước/Tiếp theo
|
||||
- ✅ Huy hiệu đếm ảnh ("X / Tổng số")
|
||||
- ✅ Hình thu nhỏ cuộn ngang (64x64px)
|
||||
- ✅ Tô sáng hình thu nhỏ được chọn
|
||||
- ✅ Dự phòng trạng thái trống
|
||||
- ✅ Tối ưu hóa Next.js Image (kích thước đáp ứng)
|
||||
- ✅ Tải chậm cho hình thu nhỏ
|
||||
- ✅ Tải ưu tiên cho ảnh đầu tiên
|
||||
|
||||
### Image Upload
|
||||
- ✅ Drag & drop support
|
||||
- ✅ Click to browse
|
||||
- ✅ File type validation (JPEG, PNG, WebP)
|
||||
- ✅ File size validation (10MB max)
|
||||
- ✅ Max 20 files limit
|
||||
- ✅ Preview grid
|
||||
- ✅ Delete button on hover
|
||||
- ✅ Cover photo indicator
|
||||
- ✅ URL cleanup on unmount
|
||||
### Tải Lên Ảnh
|
||||
- ✅ Hỗ trợ kéo & thả
|
||||
- ✅ Nhấp để duyệt
|
||||
- ✅ Xác thực loại tệp (JPEG, PNG, WebP)
|
||||
- ✅ Xác thực kích thước tệp (tối đa 10MB)
|
||||
- ✅ Giới hạn tối đa 20 tệp
|
||||
- ✅ Lưới xem trước
|
||||
- ✅ Nút xóa khi di chuột qua
|
||||
- ✅ Chỉ báo ảnh bìa
|
||||
- ✅ Dọn dẹp URL khi unmount
|
||||
|
||||
### Page Features
|
||||
- ✅ SEO metadata (Open Graph, Twitter Cards)
|
||||
- ✅ JSON-LD structured data
|
||||
- ✅ Breadcrumb navigation
|
||||
- ✅ Property details cards
|
||||
- ✅ Amenities list
|
||||
- ✅ Map integration
|
||||
- ✅ Contact sidebar (sticky)
|
||||
- ✅ Statistics (views, saves, inquiries)
|
||||
- ✅ Comparison feature integration
|
||||
### Tính Năng Trang
|
||||
- ✅ Siêu dữ liệu SEO (Open Graph, Twitter Cards)
|
||||
- ✅ Dữ liệu có cấu trúc JSON-LD
|
||||
- ✅ Điều hướng breadcrumb
|
||||
- ✅ Thẻ chi tiết bất động sản
|
||||
- ✅ Danh sách tiện ích
|
||||
- ✅ Tích hợp bản đồ
|
||||
- ✅ Thanh bên liên hệ (cố định)
|
||||
- ✅ Thống kê (lượt xem, lưu, hỏi thăm)
|
||||
- ✅ Tích hợp tính năng so sánh
|
||||
|
||||
---
|
||||
|
||||
## 🚀 NOT Currently Implemented
|
||||
## 🚀 CHƯA Được Triển Khai
|
||||
|
||||
- ❌ Image lightbox / modal zoom
|
||||
- ❌ Keyboard navigation (← →)
|
||||
- ❌ Touch gestures / swipe support
|
||||
- ❌ Image carousel transitions
|
||||
- ❌ Upload progress bar
|
||||
- ❌ Multiple file upload progress
|
||||
- ❌ Image cropping / editing
|
||||
- ❌ Video playback
|
||||
- ❌ 360° panorama viewer
|
||||
- ❌ AI image analysis
|
||||
- ❌ Lightbox ảnh / zoom modal
|
||||
- ❌ Điều hướng bàn phím (← →)
|
||||
- ❌ Cử chỉ chạm / hỗ trợ vuốt
|
||||
- ❌ Hiệu ứng chuyển tiếp carousel ảnh
|
||||
- ❌ Thanh tiến trình tải lên
|
||||
- ❌ Tiến trình tải lên nhiều tệp
|
||||
- ❌ Cắt / chỉnh sửa ảnh
|
||||
- ❌ Phát lại video
|
||||
- ❌ Trình xem toàn cảnh 360°
|
||||
- ❌ Phân tích ảnh bằng AI
|
||||
|
||||
---
|
||||
|
||||
## 📋 Data Structure Quick Reference
|
||||
## 📋 Tài Liệu Tham Khảo Nhanh Cấu Trúc Dữ Liệu
|
||||
|
||||
### PropertyMedia
|
||||
```typescript
|
||||
@@ -208,7 +208,7 @@ Contains:
|
||||
}
|
||||
```
|
||||
|
||||
### ListingDetail (partial)
|
||||
### ListingDetail (một phần)
|
||||
```typescript
|
||||
{
|
||||
id: string;
|
||||
@@ -222,40 +222,40 @@ Contains:
|
||||
|
||||
---
|
||||
|
||||
## 🎓 Learning Paths
|
||||
## 🎓 Lộ Trình Học Tập
|
||||
|
||||
### I want to understand how images work:
|
||||
1. Read: **PROPERTY_DETAIL_PAGE_ANALYSIS.md** - Section 2
|
||||
2. Review: **PROPERTY_DETAIL_QUICK_REFERENCE.md** - Section "Working with Images"
|
||||
3. Check: `image-gallery.tsx` source code
|
||||
4. Check: `next.config.js` image configuration
|
||||
### Tôi muốn hiểu cách ảnh hoạt động:
|
||||
1. Đọc: **PROPERTY_DETAIL_PAGE_ANALYSIS.md** - Phần 2
|
||||
2. Xem lại: **PROPERTY_DETAIL_QUICK_REFERENCE.md** - Phần "Working with Images"
|
||||
3. Kiểm tra: mã nguồn `image-gallery.tsx`
|
||||
4. Kiểm tra: cấu hình ảnh `next.config.js`
|
||||
|
||||
### I want to modify the gallery:
|
||||
1. Check: **PROPERTY_DETAIL_QUICK_REFERENCE.md** - "Modify Image Gallery"
|
||||
2. Edit: `apps/web/components/listings/image-gallery.tsx`
|
||||
3. Test: Responsive behavior and state changes
|
||||
4. Reference: **PROPERTY_DETAIL_COMPONENTS_MAP.md** - "Image Gallery Component Details"
|
||||
### Tôi muốn chỉnh sửa thư viện ảnh:
|
||||
1. Kiểm tra: **PROPERTY_DETAIL_QUICK_REFERENCE.md** - "Modify Image Gallery"
|
||||
2. Chỉnh sửa: `apps/web/components/listings/image-gallery.tsx`
|
||||
3. Kiểm thử: Hành vi đáp ứng và thay đổi trạng thái
|
||||
4. Tham chiếu: **PROPERTY_DETAIL_COMPONENTS_MAP.md** - "Image Gallery Component Details"
|
||||
|
||||
### I want to add a new feature (like lightbox):
|
||||
1. Choose library: **PROPERTY_DETAIL_PAGE_ANALYSIS.md** - Section 7
|
||||
2. Install: Use `pnpm add package-name -F @goodgo/web`
|
||||
3. Create: New component wrapper
|
||||
4. Integrate: With existing ImageGallery
|
||||
5. Test: Multiple images, responsive, edge cases
|
||||
### Tôi muốn thêm tính năng mới (như lightbox):
|
||||
1. Chọn thư viện: **PROPERTY_DETAIL_PAGE_ANALYSIS.md** - Phần 7
|
||||
2. Cài đặt: Dùng `pnpm add package-name -F @goodgo/web`
|
||||
3. Tạo: Thành phần wrapper mới
|
||||
4. Tích hợp: Với ImageGallery hiện có
|
||||
5. Kiểm thử: Nhiều ảnh, đáp ứng, các trường hợp ngoại lệ
|
||||
|
||||
### I want to understand state management:
|
||||
1. Read: **PROPERTY_DETAIL_PAGE_ANALYSIS.md** - Section 6
|
||||
2. Review: **PROPERTY_DETAIL_QUICK_REFERENCE.md** - Section "State Management"
|
||||
3. Check: `auth-store.ts` and `comparison-store.ts`
|
||||
### Tôi muốn hiểu quản lý trạng thái:
|
||||
1. Đọc: **PROPERTY_DETAIL_PAGE_ANALYSIS.md** - Phần 6
|
||||
2. Xem lại: **PROPERTY_DETAIL_QUICK_REFERENCE.md** - Phần "State Management"
|
||||
3. Kiểm tra: `auth-store.ts` và `comparison-store.ts`
|
||||
|
||||
### I want to understand component patterns:
|
||||
1. Read: **PROPERTY_DETAIL_PAGE_ANALYSIS.md** - Section 4
|
||||
2. Check: **PROPERTY_DETAIL_COMPONENTS_MAP.md** - "Component Complexity Levels"
|
||||
3. Review: **PROPERTY_DETAIL_QUICK_REFERENCE.md** - Section "UI Component Patterns"
|
||||
### Tôi muốn hiểu mẫu thành phần:
|
||||
1. Đọc: **PROPERTY_DETAIL_PAGE_ANALYSIS.md** - Phần 4
|
||||
2. Kiểm tra: **PROPERTY_DETAIL_COMPONENTS_MAP.md** - "Component Complexity Levels"
|
||||
3. Xem lại: **PROPERTY_DETAIL_QUICK_REFERENCE.md** - Phần "UI Component Patterns"
|
||||
|
||||
---
|
||||
|
||||
## 🔗 Navigation Between Docs
|
||||
## 🔗 Điều Hướng Giữa Các Tài Liệu
|
||||
|
||||
```
|
||||
PROPERTY_DETAIL_PAGE_ANALYSIS.md
|
||||
@@ -278,135 +278,134 @@ PROPERTY_DETAIL_COMPONENTS_MAP.md
|
||||
|
||||
---
|
||||
|
||||
## 💡 Tips & Best Practices
|
||||
## 💡 Mẹo & Thực Hành Tốt Nhất
|
||||
|
||||
### Image Optimization
|
||||
- Always use `sizes` prop with Next.js Image
|
||||
- Set `priority={true}` only for above-fold images
|
||||
- Use aspect ratio containers to prevent layout shift
|
||||
- Let Next.js handle format selection (WebP, AVIF)
|
||||
### Tối Ưu Hóa Ảnh
|
||||
- Luôn dùng thuộc tính `sizes` với Next.js Image
|
||||
- Chỉ đặt `priority={true}` cho ảnh hiển thị trên màn hình đầu tiên
|
||||
- Dùng container tỉ lệ khung hình để tránh dịch chuyển bố cục
|
||||
- Để Next.js tự chọn định dạng (WebP, AVIF)
|
||||
|
||||
### Component Design
|
||||
- Keep components focused (single responsibility)
|
||||
- Use CVA for variant management
|
||||
- Use composition over inheritance
|
||||
- Keep local state for UI, global for app state
|
||||
### Thiết Kế Thành Phần
|
||||
- Giữ các thành phần tập trung (trách nhiệm đơn lẻ)
|
||||
- Dùng CVA để quản lý biến thể
|
||||
- Ưu tiên kết hợp hơn kế thừa
|
||||
- Giữ trạng thái cục bộ cho UI, trạng thái toàn cục cho ứng dụng
|
||||
|
||||
### State Management
|
||||
- Use Zustand for global state (auth, comparison)
|
||||
- Use local React state for component UI (gallery index)
|
||||
- Use React Query for server state
|
||||
- Persist only essential data to localStorage
|
||||
### Quản Lý Trạng Thái
|
||||
- Dùng Zustand cho trạng thái toàn cục (xác thực, so sánh)
|
||||
- Dùng trạng thái React cục bộ cho UI thành phần (chỉ số thư viện ảnh)
|
||||
- Dùng React Query cho trạng thái máy chủ
|
||||
- Chỉ lưu dữ liệu thiết yếu vào localStorage
|
||||
|
||||
### Testing
|
||||
- Mock Next.js Image component
|
||||
- Test responsive behavior
|
||||
- Test edge cases (empty state, many images)
|
||||
- Mock Zustand stores
|
||||
### Kiểm Thử
|
||||
- Mock thành phần Next.js Image
|
||||
- Kiểm thử hành vi đáp ứng
|
||||
- Kiểm thử các trường hợp ngoại lệ (trạng thái trống, nhiều ảnh)
|
||||
- Mock các store Zustand
|
||||
|
||||
---
|
||||
|
||||
## 🤝 Contributing Changes
|
||||
## 🤝 Đóng Góp Thay Đổi
|
||||
|
||||
### To modify the image gallery:
|
||||
1. Create a new branch
|
||||
2. Edit `apps/web/components/listings/image-gallery.tsx`
|
||||
3. Test responsive behavior
|
||||
4. Update type definitions if needed
|
||||
5. Submit PR with description
|
||||
### Để chỉnh sửa thư viện ảnh:
|
||||
1. Tạo nhánh mới
|
||||
2. Chỉnh sửa `apps/web/components/listings/image-gallery.tsx`
|
||||
3. Kiểm thử hành vi đáp ứng
|
||||
4. Cập nhật định nghĩa kiểu nếu cần
|
||||
5. Gửi PR kèm mô tả
|
||||
|
||||
### To add a new image feature:
|
||||
1. Check PROPERTY_DETAIL_PAGE_ANALYSIS.md Section 12 (not present section)
|
||||
2. Evaluate library options
|
||||
3. Create component wrapper
|
||||
4. Integrate without breaking existing features
|
||||
5. Document changes
|
||||
### Để thêm tính năng ảnh mới:
|
||||
1. Kiểm tra PROPERTY_DETAIL_PAGE_ANALYSIS.md Phần 12 (phần chưa có)
|
||||
2. Đánh giá các lựa chọn thư viện
|
||||
3. Tạo thành phần wrapper
|
||||
4. Tích hợp mà không phá vỡ các tính năng hiện có
|
||||
5. Ghi lại các thay đổi
|
||||
|
||||
### To update documentation:
|
||||
1. Edit corresponding `.md` file
|
||||
2. Keep sections organized
|
||||
3. Include code examples
|
||||
4. Cross-reference other docs
|
||||
5. Maintain consistent formatting
|
||||
### Để cập nhật tài liệu:
|
||||
1. Chỉnh sửa tệp `.md` tương ứng
|
||||
2. Giữ các phần có tổ chức
|
||||
3. Bao gồm ví dụ mã
|
||||
4. Tham chiếu chéo các tài liệu khác
|
||||
5. Duy trì định dạng nhất quán
|
||||
|
||||
---
|
||||
|
||||
## 📞 Quick Answers
|
||||
## 📞 Câu Trả Lời Nhanh
|
||||
|
||||
**Q: How do I display an image?**
|
||||
A: Use `next/image` with `fill` layout and aspect ratio container. See PROPERTY_DETAIL_QUICK_REFERENCE.md "Using Images in Components"
|
||||
**H: Làm thế nào để hiển thị ảnh?**
|
||||
Đ: Dùng `next/image` với bố cục `fill` và container tỉ lệ khung hình. Xem PROPERTY_DETAIL_QUICK_REFERENCE.md "Using Images in Components"
|
||||
|
||||
**Q: How do I add state management?**
|
||||
A: Use Zustand for global, React.useState for local. See PROPERTY_DETAIL_PAGE_ANALYSIS.md Section 6
|
||||
**H: Làm thế nào để thêm quản lý trạng thái?**
|
||||
Đ: Dùng Zustand cho toàn cục, React.useState cho cục bộ. Xem PROPERTY_DETAIL_PAGE_ANALYSIS.md Phần 6
|
||||
|
||||
**Q: How do I add a lightbox?**
|
||||
A: Install library, create wrapper, integrate with gallery. See PROPERTY_DETAIL_QUICK_REFERENCE.md "Add Image Lightbox"
|
||||
**H: Làm thế nào để thêm lightbox?**
|
||||
Đ: Cài đặt thư viện, tạo wrapper, tích hợp với thư viện ảnh. Xem PROPERTY_DETAIL_QUICK_REFERENCE.md "Add Image Lightbox"
|
||||
|
||||
**Q: Where are the UI components?**
|
||||
A: `apps/web/components/ui/`. See PROPERTY_DETAIL_PAGE_ANALYSIS.md Section 10
|
||||
**H: Các thành phần UI ở đâu?**
|
||||
Đ: `apps/web/components/ui/`. Xem PROPERTY_DETAIL_PAGE_ANALYSIS.md Phần 10
|
||||
|
||||
**Q: What image formats are allowed?**
|
||||
A: JPEG, PNG, WebP. See PROPERTY_DETAIL_QUICK_REFERENCE.md "File Upload Component"
|
||||
**H: Những định dạng ảnh nào được cho phép?**
|
||||
Đ: JPEG, PNG, WebP. Xem PROPERTY_DETAIL_QUICK_REFERENCE.md "File Upload Component"
|
||||
|
||||
**Q: Is there keyboard navigation?**
|
||||
A: Not currently. See PROPERTY_DETAIL_COMPONENTS_MAP.md "Component Checklist"
|
||||
**H: Có điều hướng bàn phím không?**
|
||||
Đ: Hiện chưa có. Xem PROPERTY_DETAIL_COMPONENTS_MAP.md "Component Checklist"
|
||||
|
||||
---
|
||||
|
||||
## 📊 Documentation Statistics
|
||||
## 📊 Thống Kê Tài Liệu
|
||||
|
||||
| Metric | Value |
|
||||
| Chỉ Số | Giá Trị |
|
||||
|--------|-------|
|
||||
| Total Lines | 1,737 |
|
||||
| Analysis Document | 553 lines |
|
||||
| Quick Reference | 583 lines |
|
||||
| Components Map | 601 lines |
|
||||
| Code Examples | 50+ snippets |
|
||||
| Key Files Documented | 20+ |
|
||||
| Technologies Covered | 10+ |
|
||||
| Tổng Số Dòng | 1.737 |
|
||||
| Tài Liệu Phân Tích | 553 dòng |
|
||||
| Tài Liệu Tham Khảo Nhanh | 583 dòng |
|
||||
| Bản Đồ Thành Phần | 601 dòng |
|
||||
| Ví Dụ Mã | 50+ đoạn |
|
||||
| Tệp Quan Trọng Được Ghi Lại | 20+ |
|
||||
| Công Nghệ Được Đề Cập | 10+ |
|
||||
|
||||
---
|
||||
|
||||
## ✅ Checklist for New Developers
|
||||
## ✅ Danh Sách Kiểm Tra Cho Nhà Phát Triển Mới
|
||||
|
||||
- [ ] Read PROPERTY_DETAIL_PAGE_ANALYSIS.md (Sections 1-3)
|
||||
- [ ] Review PROPERTY_DETAIL_COMPONENTS_MAP.md (Page hierarchy)
|
||||
- [ ] Check key file locations (listed above)
|
||||
- [ ] Understand data structure (PropertyMedia, ListingDetail)
|
||||
- [ ] Review image gallery source code
|
||||
- [ ] Understand Zustand store pattern
|
||||
- [ ] Review UI component patterns
|
||||
- [ ] Familiarize with Tailwind classes
|
||||
- [ ] Test with local development environment
|
||||
- [ ] Bookmark this index for quick reference
|
||||
- [ ] Đọc PROPERTY_DETAIL_PAGE_ANALYSIS.md (Phần 1-3)
|
||||
- [ ] Xem lại PROPERTY_DETAIL_COMPONENTS_MAP.md (Phân cấp trang)
|
||||
- [ ] Kiểm tra vị trí tệp quan trọng (liệt kê ở trên)
|
||||
- [ ] Hiểu cấu trúc dữ liệu (PropertyMedia, ListingDetail)
|
||||
- [ ] Xem lại mã nguồn thư viện ảnh
|
||||
- [ ] Hiểu mẫu Zustand store
|
||||
- [ ] Xem lại mẫu thành phần UI
|
||||
- [ ] Làm quen với các lớp Tailwind
|
||||
- [ ] Kiểm thử với môi trường phát triển cục bộ
|
||||
- [ ] Đánh dấu trang mục lục này để tham chiếu nhanh
|
||||
|
||||
---
|
||||
|
||||
## 🎓 Next Steps
|
||||
## 🎓 Các Bước Tiếp Theo
|
||||
|
||||
1. **Understand Current State**
|
||||
- Read comprehensive analysis
|
||||
- Review component hierarchy
|
||||
- Check existing components
|
||||
1. **Hiểu Trạng Thái Hiện Tại**
|
||||
- Đọc phân tích toàn diện
|
||||
- Xem lại phân cấp thành phần
|
||||
- Kiểm tra các thành phần hiện có
|
||||
|
||||
2. **Plan Your Changes**
|
||||
- Reference quick guide
|
||||
- Check code patterns
|
||||
- Verify data structure
|
||||
2. **Lên Kế Hoạch Thay Đổi**
|
||||
- Tham chiếu hướng dẫn nhanh
|
||||
- Kiểm tra mẫu mã
|
||||
- Xác minh cấu trúc dữ liệu
|
||||
|
||||
3. **Implement & Test**
|
||||
- Use provided snippets
|
||||
- Follow patterns
|
||||
- Test responsively
|
||||
3. **Triển Khai & Kiểm Thử**
|
||||
- Dùng các đoạn mã được cung cấp
|
||||
- Tuân theo các mẫu
|
||||
- Kiểm thử đáp ứng
|
||||
|
||||
4. **Document Updates**
|
||||
- Update this index if needed
|
||||
- Add to relevant sections
|
||||
- Maintain consistency
|
||||
4. **Cập Nhật Tài Liệu**
|
||||
- Cập nhật mục lục này nếu cần
|
||||
- Thêm vào các phần liên quan
|
||||
- Duy trì tính nhất quán
|
||||
|
||||
---
|
||||
|
||||
**Last Updated:** 2026-04-11
|
||||
**Documentation Version:** 1.0
|
||||
**Status:** Complete & Comprehensive
|
||||
|
||||
**Cập Nhật Lần Cuối:** 2026-04-11
|
||||
**Phiên Bản Tài Liệu:** 1.0
|
||||
**Trạng Thái:** Hoàn Chỉnh & Toàn Diện
|
||||
|
||||
Reference in New Issue
Block a user