Next.js App Router Deep Dive: Server Components, Streaming, and Caching
The Next.js App Router fundamentally changes how you build React applications with server-first rendering and fine-grained caching.
Server Components by Default
// app/dashboard/page.tsx - Server Component (no 'use client')
import { prisma } from '@/lib/prisma'
export default async function DashboardPage() {
const projects = await prisma.project.findMany({
orderBy: { createdAt: 'desc' },
take: 10,
})
return (
<div>
<h1>Dashboard</h1>
{projects.map(p => <ProjectCard key={p.id} project={p} />)}
</div>
)
}Streaming with Suspense
import { Suspense } from 'react'
export default function Dashboard() {
return (
<div>
<h1>Dashboard</h1>
<Suspense fallback={<StatsSkeleton />}>
<StatsPanel />
</Suspense>
<Suspense fallback={<ProjectsSkeleton />}>
<ProjectsList />
</Suspense>
</div>
)
}Server Actions
'use server'
import { revalidatePath } from 'next/cache'
export async function createProject(formData: FormData) {
await prisma.project.create({
data: { name: formData.get('name') as string },
})
revalidatePath('/dashboard')
}Caching Strategies
Use revalidatePath, revalidateTag, and unstable_cache for fine-grained cache control.
The Bottom Line
The SaaS Starter Kit from BreafIO is built on the App Router with Server Components. The Admin Dashboard Pro demonstrates streaming patterns. The API Boilerplate uses route handlers. The Analytics Dashboard showcases data fetching, and the Landing Page Bundle uses ISR for optimal performance.
Related Template
Try this production-ready starter kit to build your project faster.
Launch Your SaaS in Days
Production-ready boilerplate with auth, billing, team management, and a beautiful dashboard.
Auth & Users
Email, Google, GitHub login
Team Management
Invite & manage members
Dashboard
Analytics & metrics
Stripe Billing
Subscriptions & invoices
Simple, Transparent Pricing
Starter
$29/mo
- 3 projects
- 5 team members
- Basic analytics
- Email support
Pro
$79/mo
- Unlimited projects
- 20 team members
- Advanced analytics
- Priority support
- API access
Enterprise
$199/mo
- Everything in Pro
- Unlimited members
- SSO & SAML
- Dedicated support
- Custom integrations
Frequently Asked Questions
SaaS Starter Kit
Launch your SaaS in days, not months
Ready to Build?
Get started with our production-ready starter kits and ship your project faster.
Browse Starter Kits