Framework
Route shell
Compose modules, declare page metadata, and translate route inputs. Keep business decisions out.
adapterAPP / STANDARD · V1
REFERENCE RUNTIME / NEXT.JS
A framework-neutral operating model for building product slices that stay understandable, testable, and portable.
Inspect the architecture01 / THE SHAPE
Frameworks are delivery mechanisms. Product language, contracts, and behavior are the durable center.
Framework
Compose modules, declare page metadata, and translate route inputs. Keep business decisions out.
adapterFeature
Own the use case, its public entry point, and the smallest complete product slice.
portableBoundary
Validate every external input before it becomes trusted application data.
portableInfrastructure
Keep secrets, persistence, provider SDKs, and fallbacks behind an explicit server-only seam.
adapterInterface
Build primitives from tokens; build product UI from primitives; isolate browser state at the leaf.
portableDelivery
Test contracts and failure paths first, then verify type safety, production output, and accessibility.
portable02 / THE ADAPTERS
Switch runtimes to see where framework syntax changes—and where the architecture must not.
Route composition
app/**/page.tsxThe route translates framework context and renders a feature entry point.
Server reads
Async Server ComponentFetch at the server boundary and return validated, serializable data.
External HTTP
route.ts handlerPublic endpoints use Web Request/Response and authenticate at the data boundary.
Private code
server-only + *.server.tsProvider SDKs and secrets must fail the build if imported by client code.
Document metadata
metadata / generateMetadataEvery shareable route owns an accurate title, description, and preview contract.
Failure UI
error.tsx / not-found.tsxExpected failures are modeled; unexpected failures become observable and recoverable.
03 / THE REFERENCE SLICE
The tree is intentionally boring. Predictability is a feature when teams and agents share a codebase.
app/ or src/routes/ # framework-owned route adapters modules/<feature>/ # product-owned vertical slices <feature>.contract.ts # runtime input/output boundary <feature>.server.ts # secrets, persistence, providers <feature>.client.tsx # smallest interactive island <feature>.tsx # server-safe feature composition index.ts # intentional public API ui/primitives/ # token-driven, product-agnostic UI lib/ # truly cross-feature capabilities tests/ # contracts, failures, integration proof
Routes know modules. Modules know contracts and UI. The portable core never knows the router.
Use explicit .server and .client seams so runtime mistakes fail early.
Every module exposes a small, deliberate entry point instead of making its internals globally reachable.
04 / DEFINITION OF ALIGNED
This is the review lens—not a collection of optional suggestions.
A new contributor can locate a feature without knowing the framework.
REQUIREDEvery network, database, environment, and user input crosses a runtime contract.
REQUIREDFramework imports stop at route, navigation, metadata, and server-runtime adapters.
REQUIREDClient state is local to the interaction that needs it; the page shell stays server-rendered.
REQUIREDThe application has a safe fallback for optional external services.
REQUIREDTests name the contract and failure behavior they protect.
REQUIREDThe same product vocabulary appears in code, UI, telemetry, and documentation.
REQUIREDProduction build evidence is required before release evidence is recorded.
REQUIREDTHE OPERATING BELIEF
“Portable does not mean generic. It means the product owns the idea and the framework owns the translation.”Review from the top