feat: comprehensive seed, Lucide icons, grouped dashboard nav, API fixes

- Rewrite prisma/seed.ts to populate all 27 models with realistic
  Vietnamese real estate data (8 users with login, 10 properties,
  10 listings, orders, payments, reviews, notifications, etc.)
- Replace all emoji icons with Lucide React SVG icons across frontend
  for consistent rendering, sizing, and accessibility
- Redesign dashboard nav: grouped sidebar with section headers,
  primary/secondary split on desktop, icon-only secondary items
- Replace language switcher flag emoji with Globe icon
- Replace SVG theme toggle with Lucide Moon/Sun icons
- Fix API startup: graceful fallback for Sentry profiling, Google OAuth,
  and Zalo OAuth when credentials are not configured
- Relax rate limiting in development mode (10k req/min)
- Fix listings API to include media[] array in search response
- Add optional chaining for property.media across frontend components
- Update OAuth strategy tests to match graceful fallback behavior

Co-Authored-By: Claude Opus 4 (1M context) <noreply@anthropic.com>
This commit is contained in:
Ho Ngoc Hai
2026-04-13 11:13:04 +07:00
parent db0fe8b9b7
commit a9fa214544
22 changed files with 876 additions and 744 deletions

View File

@@ -1,5 +1,6 @@
'use client';
import { Building2, CheckCircle2, Home, MapPin, Users, type LucideIcon } from 'lucide-react';
import { useTranslations } from 'next-intl';
import * as React from 'react';
import { PropertyCard } from '@/components/search/property-card';
@@ -24,11 +25,11 @@ const DISTRICTS = [
type StatKey = 'listings' | 'users' | 'transactions' | 'provinces';
const STATS: { key: StatKey; value: string; icon: string }[] = [
{ key: 'listings', value: '10,000+', icon: '🏠' },
{ key: 'users', value: '50,000+', icon: '👥' },
{ key: 'transactions', value: '2,000+', icon: '✅' },
{ key: 'provinces', value: '63', icon: '📍' },
const STATS: { key: StatKey; value: string; icon: LucideIcon }[] = [
{ key: 'listings', value: '10,000+', icon: Home },
{ key: 'users', value: '50,000+', icon: Users },
{ key: 'transactions', value: '2,000+', icon: CheckCircle2 },
{ key: 'provinces', value: '63', icon: MapPin },
];
const PROPERTY_TYPE_KEYS = ['APARTMENT', 'HOUSE', 'VILLA', 'LAND', 'OFFICE', 'SHOPHOUSE'] as const;
@@ -201,7 +202,7 @@ export default function LandingPage() {
<Card className="group cursor-pointer overflow-hidden transition-shadow hover:shadow-md">
<div className="aspect-[16/9] bg-gradient-to-br from-primary/10 to-primary/5">
<div className="flex h-full items-center justify-center">
<span className="text-3xl" aria-hidden="true">🏙</span>
<Building2 className="h-8 w-8 text-primary" aria-hidden="true" />
</div>
</div>
<CardContent className="p-3">
@@ -231,7 +232,7 @@ export default function LandingPage() {
key={stat.key}
className="rounded-lg border bg-card p-6 text-center shadow-sm"
>
<span className="text-3xl" aria-hidden="true">{stat.icon}</span>
<stat.icon className="h-8 w-8 text-primary" aria-hidden="true" />
<p className="mt-2 text-3xl font-bold text-primary">{stat.value}</p>
<p className="mt-1 text-sm text-muted-foreground">{t(`stats.${stat.key}`)}</p>
</div>