runtime and dependency management
Node LTS + npm lockfile
LTS production policy and reproducible dependency install
Limits: Pin resolved runtime/dependencies; latest is a scaffold-time lookup, not a CI dependency strategy
React interfaces with server rendering, routes and application logic.
React · Next.js · PostgreSQL · Drizzle
These recipes and dependency combinations need checking in your actual project before you rely on them.
Paste the guide address into your agent chat, together with what you want to build.
Use cases: Authenticated web products; Server-rendered React interfaces; Browser applications with owned APIs and relational data.
Generator documentation reviewed: 2026-10-23. Evidence: documentation-reviewed; commands not executed.
Use when: A new full-stack React/Next.js application; do not rerun over an existing application.
Working directory: A local source-workspace parent outside synchronized storage; my-app must not already exist
Check the selected runtime.
node --versionWorking directory: A local source-workspace parent outside synchronized storage; my-app must not already exist
Inspect the currently resolved scaffolder options.
npx create-next-app@latest --helpWorking directory: A local source-workspace parent outside synchronized storage; my-app must not already exist
Generate the TypeScript App Router baseline while leaving styling, cache, instruction and feedback preferences available for interactive selection.
npx create-next-app@latest my-app --ts --eslint --app --src-dir --use-npm --disable-gitUse when: Only after this application has selected PostgreSQL/Drizzle, installed compatible drizzle-orm/driver/drizzle-kit dependencies, and configured a schema and drizzle.config.ts.
Working directory: The generated my-app directory
Generate SQL migration files from the configured schema changes.
npx drizzle-kit generateWorking directory: The generated my-app directory
Apply reviewed migrations to the configured development database after checking its connection.
npx drizzle-kit migrateChoose the tools your application needs. The brief includes your selections, their purpose and their limits; the complete guide keeps all recommendations and sources.
Node LTS + npm lockfile
LTS production policy and reproducible dependency install
Limits: Pin resolved runtime/dependencies; latest is a scaffold-time lookup, not a CI dependency strategy
Next.js App Router + React + strict TypeScript
Full-stack React with version-matched agent documentation
Limits: TanStack Start 1.0 became stable on 13 October 2026; the imported 10 October RC observation is historical. Consider Start when its typed routing and server-function model fit the project, after checking the selected adapter and integrations. Web UI is not native UI; no framework supplies business correctness.
README navigation + generated version-matched agent guidance
Keep repository instructions and installed framework documentation discoverable
Limits: Honor existing instruction ownership. Optional README-only policy: scaffold with --no-agents-md and set agentRules:false before next dev; neither is required by this stack.
Next.js development MCP endpoint with real browser inspection
Combine version-matched framework context, compilation errors, routes and runtime logs with the actual rendered application.
Limits: Development only. Inspect the installed Next.js and next-devtools-mcp versions before configuring tools. Some runtime inspection requires an open browser session; Turbopack compilation tools have their own constraints. Framework tools do not replace authorization tests or real browser verification. Do not install optional skills or enable automatic upgrades merely to read this reference.
Zod
Runtime schemas with inferred TypeScript types
Limits: Validate requests/environment/external results; shape checks do not establish permission or truth
PostgreSQL + Drizzle + reviewed SQL migrations
Typed schema with inspectable SQL history
Limits: Configure schema paths and target environment; apply migration once; rehearse fresh DB and forward compatibility
Better Auth + Drizzle PostgreSQL adapter
Integrated session/provider support without designing password/session primitives
Limits: Auth schema generate then Drizzle migrations; direct Better Auth migrate is Kysely-only; configure origin/secrets/recovery; authorize near data
Inngest durable workflows when required
Checkpointed steps, retries and waits
Limits: Idempotent effects and authorized approvals required; use outbox for DB/event consistency; avoid beta durable endpoints as default
TypeScript strict
Independent deterministic checks for generated edits
Limits: Next build does not run lint; never ignore build/type errors to satisfy a check
ESLint
Independent deterministic checks for generated edits
Limits: Next build does not run lint; never ignore build/type errors to satisfy a check
Vitest
Run isolated domain behavior checks with a configured test environment
Limits: Install/configure Vitest and DOM environment for UI tests. Next async Server Components require browser/integration coverage instead.
React Testing Library
Test rendered components through user-visible DOM behavior
Limits: Install @testing-library/react and its @testing-library/dom peer; configure the test runner/DOM environment. This is a component utility library, not a test runner.
Playwright
Exercise critical journeys in actual browser engines
Limits: Install @playwright/test and matching browsers; configure an isolated test server/data and test session expiry, routing and authorization failures.
Project-selected Node or Docker host
Documented full Next feature support with Node/Docker
Limits: Adapters vary; verify chosen host, secrets, DB connections, sessions, migrations and restore; Cloudflare needs separate compatibility review
TanStack Query for client-owned remote state
Queries, mutations and invalidation support interactive API screens
Limits: Install @tanstack/react-query and provide QueryClient. Define tenant-aware keys, staleTime/retry policy and clear session data on sign-out; in Next prefer server loading until a client cache has a job.
React Hook Form for complex client forms
Separates client form state and validation from page components
Limits: Install react-hook-form only where needed; wire existing runtime schemas deliberately. Render accessible labels/errors; validate and authorize submissions on the server.
Tailwind CSS when utility styling fits the project
Reusable styling without a runtime component dependency
Limits: For Vite install tailwindcss and @tailwindcss/vite, add the plugin and CSS import. Use the framework-specific installation path for Next; retain established styles when present.
Radix Primitives for complex controls
Provides focus and keyboard behavior for common interaction patterns
Limits: Install only used components. Authors still supply names, contrast and meaningful composition; verify keyboard and assistive-technology behavior.
axe-core through Playwright + manual keyboard review
Automated audits identify common accessibility defects in real pages
Limits: Install @axe-core/playwright; scan representative states and use a screen reader/keyboard. Passing automated rules is not complete accessibility evidence.
Nodemailer with project-selected SMTP provider
SMTP transport avoids coupling email templates to a hosting vendor
Limits: Install nodemailer; configure server-only transport, verified sender and TLS. Test locally, queue required delivery, handle ambiguous results and bounces; SMTP acceptance is not inbox delivery. Verify the resolved Nodemailer release supports the pinned Node runtime and preserves TLS certificate validation.
AWS SDK for JavaScript v3 S3 client
Object storage separates durable files from ephemeral application disks
Limits: Install @aws-sdk/client-s3; authorize object keys, restrict size/type and configure lifecycle. Keep credentials server-side; add presigner only for direct uploads and validate provider compatibility.
EventSource for one-way server events
Browser-standard streaming suits status/progress feeds
Limits: Backend owns authenticated stream and event IDs. Test reconnect, replay and proxy buffering; EventSource is one-way and its constructor offers no arbitrary authorization-header option. Confirm long-lived connection support on host.
Build with the stack’s strengths
A Next application contains server rendering and browser interactivity with an explicit trust boundary. Recommendation: preserve an existing backend's domain ownership during UI adoption; for a new owned backend use server-only data access. Node/Docker and alternative adapters require separate runtime checks.
Version scope: Documentation reviewed 11 October 2026: current Next.js App Router docs label 16.4.0. Pin the installed Next, React, Node and database packages; distinguish cacheComponents:true from the previous caching model. This profile does not qualify a lockfile or hosting adapter. · Reviewed 2026-10-11 · Evidence: documentation-reviewed · Source: inputs/research/migrations-clients.json
For an existing application
These are documented options and proposed checks. Inspect the actual source application before adopting a transition.
Existing REST/GraphQL behavior, DTOs, authorization, transactions and one schema owner.
Recommendation: Adopt server-rendered routes that call the old API; keep its writer and migration authority. Compare read-only fixtures without replaying real side effects.
Recommendation: Retain the API permanently if appropriate, or transfer a bounded domain to a server-only DAL with minimal DTOs after mixed-version checks.
Route the cohort back while old-compatible schema remains; reconcile writes before any writer reversal.
Server loading can reduce client waterfalls; an owned DAL centralizes authorization.
Requires: Server-reachable API or reviewed database ownership; measurable user journeys.
Tradeoffs: A new domain writer requires schema/transaction review; framework adoption alone changes neither.
Existing session issuer, cookie/token format, expiry, revocation, tenant membership and CSRF behavior.
Recommendation: Retain the issuer behind an adapter and authorize data/mutations in both implementations; inventory origin/domain/cookie differences before sharing.
Recommendation: Use an explicitly selected issuer and server-side authorization boundary; transfer session contracts or require a controlled sign-in when compatibility cannot be preserved.
Restore old routes/issuer acceptance only while its keys and session semantics remain supported; do not resurrect revoked sessions.
One identity authority can support gradual UI/backend replacement.
Requires: Validated issuer integration and old/new expiry/revocation fixtures.
Tradeoffs: Session sharing is format/security work; sign-in continuity is not guaranteed by using cookies.
Actual enabled caching model, personalized response policy, keys, freshness, invalidation and shared-instance behavior.
Recommendation: Keep the prior policy while converting one route/data category; separate old/new cache namespaces and observe stale/account-crossing outcomes.
Recommendation: Choose Cache Components or version-matched previous-model APIs explicitly; keep user-specific data outside shared public entries and coordinate shared invalidation when deployed across instances.
Disable the new cache path and purge its namespace; keep source data unchanged and retain old invalidation until transfer completes.
Repeated eligible work can be reused without refetching each time.
Requires: A documented freshness tolerance, safe keys and working invalidation.
Tradeoffs: Coordination/storage adds operations; freshness and cost gains require measurement.
Existing job producer/consumer payloads, ready/scheduled/retry/failed/in-flight states and external-effect idempotency.
Recommendation: Keep existing workers; move a named job type behind a versioned event contract. Reconcile backlog and retain one consumer owner per item.
Recommendation: Use selected durable execution such as Inngest for required workflows; a transactional outbox is a proposed design when domain commit and event submission are separate systems.
Stop new producers for the transferred type, account for active runs and resume old workers with compatible payloads; reconcile irreversible effects first.
Checkpointed completed steps allow retry/resume without starting every step again.
Requires: Selected service/SDK integration, stable step IDs, replay-safe external effects and delivery reconciliation.
Tradeoffs: Operating a workflow service adds dependency/cost; checkpoints do not supply business exactly-once effects.
Current hosting/runtime, static assets, open-tab state, prefetched payloads and Server Function compatibility.
Recommendation: Keep old assets and compatible API routes; promote one built artifact per deployment and rehearse an old tab against the new deployment.
Recommendation: Use version-matched deploymentId support and infrastructure routing as needed; same-build instances share required action keys and cache coordination.
Restore the prior artifact and routing while compatible assets/data remain; do not claim traffic rollback reverses schema or external effects.
Explicit rollout handling reduces missing-chunk/navigation mismatches.
Requires: A qualified host, retained assets and tested old-client behavior.
Tradeoffs: Hard navigation can lose component state; same encryption key does not make old action IDs compatible.
Run these in the configured application. They are instructions, not recorded passes.
npm ci
npx next typegen
npx tsc --noEmit
npx eslint .
npx vitest run
npm run build
npx playwright testCurrent correction reviewed 2026-10-23: TanStack Start 1.0 became stable on 13 October 2026; the imported 10 October RC observation is historical. Consider Start when its typed routing and server-function model fit the project, after checking the selected adapter and integrations. Web UI is not native UI; no framework supplies business correctness. Evidence: documentation-reviewed; no TanStack Start application integration executed.
Original source review: 2026-10-10. Core guidance rechecked: 2026-10-13. Check scope.