nextjs

The React Framework for the Web - App Router, SSR, Security

SKILL.md

GitHub

Next.js - The React Framework for the Web

Basics

  • SSR vs SSG vs ISR concepts → See basics
  • App Router vs Pages Router → See basics
  • Directory structure → See basics
  • Routing fundamentals → See basics

App Router

Data Fetching

Rendering

Styling

API & Backend

Performance

Deployment

Security

Quick Start

npx create-next-app@latest my-app --typescript --tailwind --eslint
cd my-app
npm run dev

Key Features

  • App Router: New filesystem-based routing
  • Server Components: Default rendering on server
  • Streaming: Suspense for progressive loading
  • Data Cache: Intelligent caching by default
  • Middleware: Edge middleware for routing
  • TypeScript: First-class TypeScript support

Project Structure

app/
├── layout.tsx      # Root layout
├── page.tsx        # Home page
├── globals.css     # Global styles
├── (marketing)/    # Route group
│   └── about/
│       └── page.tsx
├── blog/
│   ├── page.tsx
│   └── [slug]/
│       └── page.tsx
└── api/
    └── route.ts   # API route