Move 36 root-level audit/analysis documents and 7 web app audit documents into docs/audits/ directory to declutter the project root. Remove stale EXPLORATION_SUMMARY.txt. Co-Authored-By: Paperclip <noreply@paperclip.ing>
12 KiB
Property Detail Page - Documentation Index
Created: 2026-04-11
Project: GoodGo Platform (Vietnamese Real Estate)
📚 Documentation Files
1. PROPERTY_DETAIL_PAGE_ANALYSIS.md (17KB, 553 lines)
Comprehensive Analysis - Start here for complete understanding
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
Use when: You need a deep understanding of the architecture
2. PROPERTY_DETAIL_QUICK_REFERENCE.md (13KB, 583 lines)
Code Snippets & Patterns - Quick lookup guide
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
Use when: You need code snippets, patterns, or quick answers
3. PROPERTY_DETAIL_COMPONENTS_MAP.md (14KB, 601 lines)
Component Hierarchy & Architecture - Visual reference
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
Use when: You need to understand component relationships
🎯 Quick Start Guide
For Understanding the Current Implementation:
- 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
For Making Changes:
-
Check PROPERTY_DETAIL_QUICK_REFERENCE.md:
- Find the relevant pattern or component
- Copy the code snippet
- Adapt to your needs
-
Reference PROPERTY_DETAIL_COMPONENTS_MAP.md:
- Understand where component fits
- Check data flow
- Verify state management
For Building New Image Features:
- PROPERTY_DETAIL_PAGE_ANALYSIS.md - Section 5 (Next.js Image Usage)
- PROPERTY_DETAIL_QUICK_REFERENCE.md - Section "Working with Images"
- PROPERTY_DETAIL_COMPONENTS_MAP.md - "Image Gallery Component Details"
📍 Key File Locations
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
Configuration
- Tailwind Config:
apps/web/tailwind.config.ts - Next.js Config:
apps/web/next.config.js - Global Styles:
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
UI Components
- Button:
apps/web/components/ui/button.tsx - Badge:
apps/web/components/ui/badge.tsx - Card:
apps/web/components/ui/card.tsx - Dialog:
apps/web/components/ui/dialog.tsx
🔑 Key Technologies
| Technology | Version | Purpose |
|---|---|---|
| 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 |
✨ Current Features
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
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
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
🚀 NOT Currently Implemented
- ❌ 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
📋 Data Structure Quick Reference
PropertyMedia
{
id: string;
url: string; // HTTPS URL to image
type: 'image' | 'video'; // Type filter
order: number; // Sort order (0, 1, 2...)
caption: string | null; // Optional caption
}
ListingDetail (partial)
{
id: string;
property: {
media: PropertyMedia[]; // Array of images/videos
// ... other property fields
};
// ... other listing fields
}
🎓 Learning Paths
I want to understand how images work:
- Read: PROPERTY_DETAIL_PAGE_ANALYSIS.md - Section 2
- Review: PROPERTY_DETAIL_QUICK_REFERENCE.md - Section "Working with Images"
- Check:
image-gallery.tsxsource code - Check:
next.config.jsimage configuration
I want to modify the gallery:
- Check: PROPERTY_DETAIL_QUICK_REFERENCE.md - "Modify Image Gallery"
- Edit:
apps/web/components/listings/image-gallery.tsx - Test: Responsive behavior and state changes
- Reference: PROPERTY_DETAIL_COMPONENTS_MAP.md - "Image Gallery Component Details"
I want to add a new feature (like lightbox):
- Choose library: PROPERTY_DETAIL_PAGE_ANALYSIS.md - Section 7
- Install: Use
pnpm add package-name -F @goodgo/web - Create: New component wrapper
- Integrate: With existing ImageGallery
- Test: Multiple images, responsive, edge cases
I want to understand state management:
- Read: PROPERTY_DETAIL_PAGE_ANALYSIS.md - Section 6
- Review: PROPERTY_DETAIL_QUICK_REFERENCE.md - Section "State Management"
- Check:
auth-store.tsandcomparison-store.ts
I want to understand component patterns:
- Read: PROPERTY_DETAIL_PAGE_ANALYSIS.md - Section 4
- Check: PROPERTY_DETAIL_COMPONENTS_MAP.md - "Component Complexity Levels"
- Review: PROPERTY_DETAIL_QUICK_REFERENCE.md - Section "UI Component Patterns"
🔗 Navigation Between Docs
PROPERTY_DETAIL_PAGE_ANALYSIS.md
├─ "Section 1" → Component structure → See PROPERTY_DETAIL_COMPONENTS_MAP.md
├─ "Section 2" → Image implementation → See PROPERTY_DETAIL_QUICK_REFERENCE.md "Working with Images"
├─ "Section 4" → Component patterns → See PROPERTY_DETAIL_QUICK_REFERENCE.md "UI Component Patterns"
├─ "Section 5" → Next.js patterns → See PROPERTY_DETAIL_QUICK_REFERENCE.md "Using Images in Components"
└─ "Section 6" → State management → See PROPERTY_DETAIL_QUICK_REFERENCE.md "State Management"
PROPERTY_DETAIL_QUICK_REFERENCE.md
├─ Quick navigation → See PROPERTY_DETAIL_COMPONENTS_MAP.md for full tree
├─ Working with images → See PROPERTY_DETAIL_PAGE_ANALYSIS.md Section 2
└─ Common tasks → See PROPERTY_DETAIL_COMPONENTS_MAP.md "Maintenance Guide"
PROPERTY_DETAIL_COMPONENTS_MAP.md
├─ Page hierarchy → Overview → See PROPERTY_DETAIL_PAGE_ANALYSIS.md Section 1
├─ Gallery details → Implementation → See PROPERTY_DETAIL_PAGE_ANALYSIS.md Section 2
└─ Import map → File paths → See PROPERTY_DETAIL_PAGE_ANALYSIS.md Section 10
💡 Tips & Best Practices
Image Optimization
- Always use
sizesprop 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)
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
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
Testing
- Mock Next.js Image component
- Test responsive behavior
- Test edge cases (empty state, many images)
- Mock Zustand stores
🤝 Contributing Changes
To modify the image gallery:
- Create a new branch
- Edit
apps/web/components/listings/image-gallery.tsx - Test responsive behavior
- Update type definitions if needed
- Submit PR with description
To add a new image feature:
- Check PROPERTY_DETAIL_PAGE_ANALYSIS.md Section 12 (not present section)
- Evaluate library options
- Create component wrapper
- Integrate without breaking existing features
- Document changes
To update documentation:
- Edit corresponding
.mdfile - Keep sections organized
- Include code examples
- Cross-reference other docs
- Maintain consistent formatting
📞 Quick Answers
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"
Q: How do I add state management?
A: Use Zustand for global, React.useState for local. See PROPERTY_DETAIL_PAGE_ANALYSIS.md Section 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"
Q: Where are the UI components?
A: apps/web/components/ui/. See PROPERTY_DETAIL_PAGE_ANALYSIS.md Section 10
Q: What image formats are allowed?
A: JPEG, PNG, WebP. See PROPERTY_DETAIL_QUICK_REFERENCE.md "File Upload Component"
Q: Is there keyboard navigation?
A: Not currently. See PROPERTY_DETAIL_COMPONENTS_MAP.md "Component Checklist"
📊 Documentation Statistics
| Metric | Value |
|---|---|
| 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+ |
✅ Checklist for New Developers
- 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
🎓 Next Steps
-
Understand Current State
- Read comprehensive analysis
- Review component hierarchy
- Check existing components
-
Plan Your Changes
- Reference quick guide
- Check code patterns
- Verify data structure
-
Implement & Test
- Use provided snippets
- Follow patterns
- Test responsively
-
Document Updates
- Update this index if needed
- Add to relevant sections
- Maintain consistency
Last Updated: 2026-04-11
Documentation Version: 1.0
Status: Complete & Comprehensive