
Over 53% of mobile visitors abandon a landing page that takes longer than 3 seconds to render. Worse yet, Google uses field-measured Core Web Vitals (LCP, INP, CLS) and structured Schema.org JSON-LD directly in both organic search rankings and Google Ads Quality Score calculations. In this comprehensive guide, we walk through the exact Next.js App Router architecture and TypeScript code we use to achieve sub-second rendering and international multi-language SEO.
What You Will Master in This Guide:
1. Complete Next.js App Router SEO directory structure (sitemap.ts,robots.ts,rss.xml/route.ts,lib/seo/metadata.ts).
2. Engineering for the 3 Core Web Vitals: LCP (< 2.5s), INP (< 200ms), and CLS (< 0.1).
3. React Server Components (RSC) vs. Client Hydration payload pruning.
4. Internationalhreflangandx-defaultcanonical link generation.
5. XSS-safe JSON-LD structured data forOrganization,Service, andFAQPagerich snippets.
1. Production Next.js SEO Directory Tree
src/
├── app/
│ ├── layout.tsx # Root HTML, Poppins swap font & Organization JSON-LD
│ ├── robots.ts # Crawler directives (/robots.txt)
│ ├── sitemap.ts # Dynamic multilingual /sitemap.xml
│ ├── rss.xml/route.ts # Full-content RSS 2.0 syndication feed
│ └── [locale]/
│ ├── page.tsx # SSR Homepage with LCP image preload
│ └── services/[slug]/page.tsx # Service landing pages with Service & FAQPage JSON-LD
├── components/SEO/
│ ├── JsonLd.tsx # Verified corporate entity & founder graph
│ └── StructuredData.tsx # XSS-safe application/ld+json renderer
└── lib/seo/
└── metadata.ts # Centralized Canonical, OpenGraph & Hreflang builder
2. Centralizing Multilingual Canonicals and hreflang (src/lib/seo/metadata.ts)
import type { Metadata } from "next";
export const SITE_URL = "https://dgtalhat.com";
export const SEO_LOCALES = ["tr", "en", "de"] as const;
export const pageUrl = (locale: string, path = "") =>
`${SITE_URL}/${locale}${path === "/" ? "" : path}`;
export function localizedUrls(path: string) {
return Object.fromEntries([
...SEO_LOCALES.map(locale => [locale, pageUrl(locale, path)]),
["x-default", pageUrl("en", path)],
]);
}
Did you find this engineering guide helpful?
Give it a like or share it with your team and network.