Reserve Files
In a Mantou app, similar to Next.js, specific files are reserved for different roles within the application structure
page.tsx: This client-side file renders the content of a specific page using React components, handling UI and user interactions for a given route.
layout.tsx: Also client-side, layout.tsx ensures a consistent UI across pages by providing shared components like headers and footers.
route.ts: Serving server-side logic, this file manages routing for paths, handling operations such as data fetching and server-side rendering.
middleware.ts: Unlike Next.js, Mantou allows multiple middleware.ts files to act as entry guards or processors for specific routes, managing tasks like authentication or request validation on a per-route basis.
This structure helps developers maintain clear divisions between client-side and server-side tasks while allowing flexible route-specific middleware configurations.
Last updated