Web Frameworks Mastery
Build modern full-stack applications with Next.js App Router and Turborepo monorepo.
Framework Selection
| Need |
Choose |
| Single full-stack app |
Next.js standalone |
| Multiple apps sharing code |
Next.js + Turborepo monorepo |
| Static marketing site |
Next.js with SSG |
| SaaS with dashboard |
Next.js App Router + RSC |
| API-only backend |
Use Rust-backend-advance (Axum) instead |
Quick Start
# Single app
npx create-next-app@latest my-app
cd my-app && npm run dev
# Monorepo
npx create-turbo@latest my-monorepo
cd my-monorepo && npm run dev
Reference Navigation
Next.js
- App Router Architecture — Routing, layouts, pages, loading/error states, parallel routes
- Server Components — RSC patterns, client vs server, streaming, use client/server
- Data Fetching — fetch, caching, revalidation, server actions, loading.tsx
- Optimization — Images, fonts, scripts, bundle analysis, PPR, metadata/SEO
Turborepo
- Monorepo Setup — Workspace config, package structure, shared dependencies
- Pipelines & Caching — Task dependencies, remote cache, parallel execution
Key Patterns
App Router Structure
app/
├── layout.tsx # Root layout (wraps all pages)
├── page.tsx # Home page (/)
├── loading.tsx # Loading UI
├── error.tsx # Error boundary
├── not-found.tsx # 404 page
├── dashboard/
│ ├── layout.tsx # Dashboard layout
│ ├── page.tsx # /dashboard
│ └── settings/
│ └── page.tsx # /dashboard/settings
└── api/
└── users/
└── route.ts # API route handler
Server Component (default)
// app/users/page.tsx — Server Component (no "use client")
export default async function UsersPage() {
const users = await fetch('https://api.example.com/users', {
next: { revalidate: 3600 } // ISR: refresh every hour
}).then(r => r.json())
return (
<main>
<h1>Users</h1>
{users.map(u => <UserCard key={u.id} user={u} />)}
</main>
)
}
Client Component
"use client"
import { useState } from 'react'
export function Counter() {
const [count, setCount] = useState(0)
return <button => setCount(c => c + 1)}>Count: {count}</button>
}
Monorepo Structure
my-monorepo/
├── apps/
│ ├── web/ # Customer-facing Next.js
│ ├── admin/ # Admin dashboard Next.js
│ └── docs/ # Documentation
├── packages/
│ ├── ui/ # Shared components
│ ├── config/ # ESLint, TypeScript configs
│ └── types/ # Shared types
├── turbo.json
└── package.json
Best Practices
Next.js: Default to Server Components, use "use client" only when needed. Implement proper loading/error states. Use Image component for optimization. Set metadata for SEO.
Turborepo: Clear separation (apps/ + packages/). Define task dependencies correctly. Enable remote caching. Use --filter for targeted builds.
Related Skills
Converted and distributed by TomeVault — claim your Tome and manage your conversions.
1---2name: nextjs-turborepo3description: Full-stack web frameworks — Next.js 15 (App Router, Server Components, RSC, PPR, SSR/SSG/ISR), Turborepo (monorepo, task pipelines, remote caching). Use for building React applications, server-side rendering, monorepo management, build optimization, and full-stack TypeScript projects. Use when this capability is needed.4---56# Web Frameworks Mastery78Build modern full-stack applications with Next.js App Router and Turborepo monorepo.910## Framework Selection1112| Need | Choose |13|------|--------|14| Single full-stack app | Next.js standalone |15| Multiple apps sharing code | Next.js + Turborepo monorepo |16| Static marketing site | Next.js with SSG |17| SaaS with dashboard | Next.js App Router + RSC |18| API-only backend | Use `Rust-backend-advance` (Axum) instead |1920## Quick Start2122```bash23# Single app24npx create-next-app@latest my-app25cd my-app && npm run dev2627# Monorepo28npx create-turbo@latest my-monorepo29cd my-monorepo && npm run dev30```3132## Reference Navigation3334### Next.js35- **[App Router Architecture](references/nextjs-app-router.md)** — Routing, layouts, pages, loading/error states, parallel routes36- **[Server Components](references/nextjs-server-components.md)** — RSC patterns, client vs server, streaming, use client/server37- **[Data Fetching](references/nextjs-data-fetching.md)** — fetch, caching, revalidation, server actions, loading.tsx38- **[Optimization](references/nextjs-optimization.md)** — Images, fonts, scripts, bundle analysis, PPR, metadata/SEO3940### Turborepo41- **[Monorepo Setup](references/turborepo-setup.md)** — Workspace config, package structure, shared dependencies42- **[Pipelines & Caching](references/turborepo-pipelines.md)** — Task dependencies, remote cache, parallel execution4344## Key Patterns4546### App Router Structure47```48app/49├── layout.tsx # Root layout (wraps all pages)50├── page.tsx # Home page (/)51├── loading.tsx # Loading UI52├── error.tsx # Error boundary53├── not-found.tsx # 404 page54├── dashboard/55│ ├── layout.tsx # Dashboard layout56│ ├── page.tsx # /dashboard57│ └── settings/58│ └── page.tsx # /dashboard/settings59└── api/60 └── users/61 └── route.ts # API route handler62```6364### Server Component (default)65```tsx66// app/users/page.tsx — Server Component (no "use client")67export default async function UsersPage() {68 const users = await fetch('https://api.example.com/users', {69 next: { revalidate: 3600 } // ISR: refresh every hour70 }).then(r => r.json())7172 return (73 <main>74 <h1>Users</h1>75 {users.map(u => <UserCard key={u.id} user={u} />)}76 </main>77 )78}79```8081### Client Component82```tsx83"use client"84import { useState } from 'react'8586export function Counter() {87 const [count, setCount] = useState(0)88 return <button onClick={() => setCount(c => c + 1)}>Count: {count}</button>89}90```9192### Monorepo Structure93```94my-monorepo/95├── apps/96│ ├── web/ # Customer-facing Next.js97│ ├── admin/ # Admin dashboard Next.js98│ └── docs/ # Documentation99├── packages/100│ ├── ui/ # Shared components101│ ├── config/ # ESLint, TypeScript configs102│ └── types/ # Shared types103├── turbo.json104└── package.json105```106107## Best Practices108109**Next.js:** Default to Server Components, use `"use client"` only when needed. Implement proper loading/error states. Use Image component for optimization. Set metadata for SEO.110111**Turborepo:** Clear separation (apps/ + packages/). Define task dependencies correctly. Enable remote caching. Use `--filter` for targeted builds.112113## Related Skills114115| Skill | When to Use |116|-------|-------------|117| [ui-styling](../ui-styling/SKILL.md) | Tailwind CSS, shadcn/ui components |118| [frontend-design](../frontend-design/SKILL.md) | Design tokens, typography, color systems |119| [authentication](../authentication/SKILL.md) | Next.js authentication setup |120| [testing](../testing/SKILL.md) | E2E testing with Playwright |121| [devops](../devops/SKILL.md) | Deployment, Vercel, Docker |122123---124> Converted and distributed by [TomeVault](https://tomevault.io/claim/thienty1207) — claim your Tome and manage your conversions.125<!-- tomevault:4.0:skill_md:2026-04-15 -->