Date: 2025-10-22 (Wednesday)
Status: “Done”
/app/books/[id]/page.tsx route handles data fetching and returns a pre-rendered UI.generateMetadata supplies SEO meta tags based on the book payload.// app/books/[id]/page.tsx
import { getBook } from "@/lib/api";
export default async function BookDetail({ params }) {
const book = await getBook(params.id);
if (!book) return notFound();
return <BookPage book={book} />;
}
not-found.tsx is needed for missing books—treat it as an expected branch.error.tsx to avoid double handling; log unexpected issues on the backend.NEXT_PUBLIC_API_URL for the frontend and API_URL for route handlers..env.example in sync whenever a new variable is introduced.lib/api.ts to prevent duplication.not-found.tsx with navigation CTAs.getBook(id) helper for server components and tests.npm run lint && npm run build to ensure the Next.js configuration stays clean.