nextjs-ssr-architecture

Enforce SSR-first architecture in Next.js App Router projects.

2|1|Updated Aug 24, 2024
One-click install
npx skills add https://github.com/armanisadeghi/ai-matrx --skill nextjs-ssr-architecture
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: nextjs-ssr-architecture
Source: https://github.com/armanisadeghi/ai-matrx/tree/main/.cursor/skills/nextjs-ssr-architecture
Command: npx skills add https://github.com/armanisadeghi/ai-matrx --skill nextjs-ssr-architecture

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Guides developers to enforce an SSR-first architecture in Next.js App Router projects.

Core Features & Use Cases

  • Enforces Server Components as default; Client Components only as needed.
  • Provides data-fetching and hydration patterns for Redux and Suspense-based loading.
  • Helps structure routes/pages/layouts with proper server/client boundaries and performance focus.

Quick Start

Identify a page or route in a Next.js App Router project and apply server-first and client-islands boundaries per this skill.

Frequently Asked Questions about nextjs-ssr-architecture

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I structure Next.js App Router projects to use Server Components by default?

To structure Next.js App Router projects with Server Components by default, enforce an SSR-first architecture that isolates Client Components strictly for interactivity, ensuring server-side rendering handles data fetching and initial page loads.

What is the best way to handle Redux hydration in Next.js Server Components?

The best way to handle Redux hydration in Next.js Server Components is to use specific hydration patterns that pass server-fetched state to client-side stores, preventing mismatches and ensuring proper data streaming alongside Suspense boundaries.

How do I use Suspense boundaries for data streaming in Next.js?

To use Suspense boundaries for data streaming in Next.js, wrap dynamic route segments or data-fetching components to stream HTML chunks progressively, isolating loading states and skeletons while keeping the main architecture server-rendered.

When should I use Client Components instead of Server Components in Next.js?

You should use Client Components instead of Server Components in Next.js only when you need client-side interactivity, state management, or browser APIs, keeping the default routing architecture server-rendered to maximize performance.

Does this SSR-first approach work with existing Next.js routing and layouts?

Yes, this SSR-first approach works with Next.js routing and layouts by applying server-first and client-islands boundaries to existing pages, ensuring proper server/client component separation while maintaining performance-focused route structures.