What problem does it solve?
Next.js 15 developers need clear, production-ready guidance for structuring App Router code, handling server vs client boundaries, and implementing routing, data fetching, caching, and streaming correctly.
Core Features & Use Cases
- App Router file conventions: Organize layouts, pages, route groups, private components, and API route handlers in app/ using the expected folder structure.
- Server Components vs Client Components: Default to Server Components for async rendering while isolating client-only logic when needed.
- Server Actions & mutations: Implement form-driven server-side mutations using the "use server" directive, then trigger navigation or cache updates (revalidate/redirect) safely.
- Data fetching, parallelism, and streaming: Fetch data efficiently (e.g., Promise.all) and use Suspense to progressively render slow parts of the UI.
- Route Handlers (API routes): Build GET/POST endpoints using NextRequest and NextResponse for JSON APIs.
- Middleware for access control: Redirect unauthorized users based on cookies and path matchers (e.g., protecting /dashboard/*).
- Metadata strategy: Define static metadata and use generateMetadata for dynamic per-route titles and descriptions.
Quick Start
Ask your AI to generate an App Router scaffold for a new Next.js 15 app that includes a root layout, a dashboard route protected by middleware, an API route handler returning JSON, and a Server Action that revalidates cached data after a form submission.