Next.js App Router API patterns — Route Handlers, Server Actions, middleware, validation, caching, error handling
92
90%
Does it follow best practices?
Impact
95%
1.58xAverage score across 5 eval scenarios
Passed
No known issues
Middleware with proper matcher
75%
83%
Auth check in middleware returns 401
70%
100%
Params awaited in dynamic routes
0%
100%
Search params for pagination
62%
100%
GET cache control for dynamic data
66%
100%
Validation on POST endpoint
40%
100%
request.json() wrapped in try/catch
100%
100%
Structured error responses
30%
100%
No internal error leaks
100%
100%
Functional implementation
80%
100%
Route Handlers for public API
100%
100%
Server Actions for admin forms
100%
100%
Revalidation after mutations
100%
100%
Validation in both Route Handlers and Server Actions
16%
66%
Server Action error handling pattern
0%
100%
Params awaited in dynamic routes
10%
100%
Structured error responses from Route Handlers
33%
100%
use client on form components
62%
100%
Functional implementation
90%
100%
Server Action used (not Route Handler)
100%
100%
Zod validation with safeParse
0%
100%
Field-level errors returned as state
100%
100%
useActionState hook used
100%
100%
Revalidation after mutation
0%
100%
'use client' on form component
100%
100%
Loading/pending state
100%
100%
Error boundary
0%
0%
Functional implementation
70%
90%
Params awaited in dynamic routes
0%
100%
Zod or schema validation on input
0%
100%
Structured error responses
38%
100%
request.json() wrapped in try/catch
100%
100%
NextResponse.json used correctly
70%
100%
GET caching control
100%
100%
No internal error leaks
37%
100%
Error boundary for menu page
0%
100%
CRUD endpoints functional
100%
100%
Middleware with matcher config
71%
78%
Middleware at project root
100%
100%
Middleware uses only Web APIs
100%
100%
request.json() wrapped in try/catch
100%
100%
Webhook payload validation
58%
100%
Structured error responses
50%
70%
Signature verification
100%
100%
GET events endpoint with cache control
0%
100%
No internal error leaks
62%
62%
Functional implementation
100%
100%