feat(web): add error boundaries, 404 page, loading states, and SEO metadata

- Add branded not-found.tsx with navigation links
- Add global error.tsx boundary with retry and error digest display
- Add root loading.tsx skeleton for route transitions
- Expand root layout metadata: OpenGraph, Twitter cards, robots, viewport
- Add sitemap.ts and robots.ts for SEO
- Add search page and listing detail metadata via route layouts

Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
Ho Ngoc Hai
2026-04-08 04:06:14 +07:00
parent 7e64e32d8f
commit 325cd4c421
8 changed files with 269 additions and 3 deletions

32
apps/web/app/sitemap.ts Normal file
View File

@@ -0,0 +1,32 @@
import type { MetadataRoute } from 'next';
export default function sitemap(): MetadataRoute.Sitemap {
const siteUrl = process.env['NEXT_PUBLIC_SITE_URL'] || 'https://goodgo.vn';
return [
{
url: siteUrl,
lastModified: new Date(),
changeFrequency: 'daily',
priority: 1,
},
{
url: `${siteUrl}/search`,
lastModified: new Date(),
changeFrequency: 'daily',
priority: 0.9,
},
{
url: `${siteUrl}/login`,
lastModified: new Date(),
changeFrequency: 'monthly',
priority: 0.3,
},
{
url: `${siteUrl}/register`,
lastModified: new Date(),
changeFrequency: 'monthly',
priority: 0.3,
},
];
}