A minimal but complete foundation for SSR React apps — with type-safe loaders & actions, Zod validation, shadcn/ui, TailwindCSS v4, and commit-safe tooling wired up from day one.
Quick start
# scaffold pnpm create react-router7 new my-app cd my-app # install & run pnpm install pnpm dev
Stack
Included patterns
Intent-based action routing
A single action() per route handles all mutations
via a discriminated intent field — create, update,
delete.
Optimistic UI via useFetcher
Mutations reflect immediately before the server responds. Revalidation syncs state on completion. No external state manager needed.
Server-only guard
Add import "@/lib/server/server-only" to any file
that must never reach the client bundle. Throws loudly if
imported on the browser.
Two-level error boundaries
Root boundary replaces the full document. Route boundary keeps the nav shell visible and handles 404s, 403s, and unexpected errors per route.
Feature-based folder structure
Each feature owns its components, server code, types, and schemas. Routes import from features — features never import from routes.
Swappable data layer
The mock in-memory store matches the same async interface a real ORM would. Swap Prisma or Drizzle in by replacing function bodies only.
Folder structure