At 09:12 on launch day, a finance user opens /invoices and sees another company’s balance. The UI is immaculate; the fault is a fetch cached above the tenant boundary. By 09:30, support is exporting screenshots, engineers are hunting request headers, and a “fast dashboard” has become an incident. This is the difference between assembling an App Router interface and operating a Next.js product with real accounts, payments, and permissions.

Duskel treats Next.js as a boundary layer, not a substitute for system design. It handles server rendering, route handlers, streaming, and browser-code reduction well. It does not define authorization rules, make webhook delivery idempotent, prevent N+1 queries, size a connection pool, or tell on-call staff why checkout failed. A credible delivery team names those boundaries before implementation, because production failures usually begin as decisions nobody wrote down.

Start with the request path

Before estimating screens, trace one request from browser to database and back. In a B2B portal, middleware establishes the session; a server component loads organization-scoped records; a policy checks whether that identity may read the requested invoice; and a server action or route handler performs mutations. Document exactly where identity is established and where tenant filtering occurs. A client-side organization check is not authorization: anyone can replay the request with a different record ID.

This turns soft requirements into testable cases. “Users can manage invoices” becomes: Can an accountant read all subsidiaries? Can a manager export 50,000 rows? Does a signed download URL expire after 15 minutes? What happens when an admin removes a role while the user still holds a valid session? Put those answers into integration tests and database constraints. Leaving them in a Figma annotation produces the classic IDOR failure: authenticated users reading records that belong to another tenant.

Caching needs an owner

Caching fails when nobody can answer three questions: what is stored, which user can receive it, and which write makes it stale? We have inherited dashboards that cached balance queries to improve Lighthouse scores, then displayed yesterday’s balance after a payment webhook completed. The remedy was not setting every route to no-store. Public catalogue data, organization data, and request-specific data need separate policies, with invalidation assigned to the mutation that changes each resource.

For CMS content, tag-based revalidation works when the publish webhook invalidates the affected tag or path and its signature is verified. For account pages, explicit dynamic rendering and tenant-scoped queries are usually easier to audit than a maze of cached fetches. Test this after deployment, not only in local development: CDN behavior, regional execution, and environment configuration can change the result. A content editor should see a published correction within an agreed window—say, 60 seconds—not after an unexplained 20-minute cache TTL.

Server actions are not a permission system

Moving a form mutation into a server action removes browser exposure; it does not authorize the operation. Every action that changes money, access, or customer data needs authentication, record-level authorization, schema validation, and an audit event containing actor, target, timestamp, and outcome. Derive tenant identity from the verified session, never from a hidden organizationId field. Use one transaction when creating an order also reserves inventory and writes an audit record; partial success is how stock counts and payment states drift apart.

Background work needs a worker, not a hopeful HTTP request. Password emails, report generation, inventory synchronization, and CSV imports should enter a queue with retry limits, dead-letter handling, and idempotency keys. Payment and commerce providers resend events; that is normal behavior. Store each provider event under a unique external event ID before processing it. Then the third delivery of the same payment becomes a harmless duplicate instead of a second charge, duplicate order, or support escalation.

Deployment is part of the application

A green Next.js build proves only that a build completed. Test the production artifact on its actual hosting target; confirm which environment variables exist at build time versus runtime; inspect error tracking, structured logs, and slow-query traces. Preview deployments help reviewers, but they cannot prove that OAuth callback URLs, payment webhooks, object-storage permissions, cron authentication, and DNS configuration work under production-like constraints.

Ask a prospective partner: “How do you detect a checkout failure within ten minutes, roll back the release, and migrate a table with 20 million rows without blocking writes?” “We use Vercel” is not an answer. The stack may use Vercel, AWS, containers, or managed services; the operational plan must specify health checks, alert owners, rollback steps, migration sequencing, and recovery expectations. At handoff, the team should leave deployment notes, alert routing, runbooks for the top failure modes, and data-access code a new engineer can follow without archaeological excavation. Launch polish matters. Recovering from the first bad deploy matters more.