routes.ts
routes.ts
file, located in the root of the routes
directory.
This file defines the structure and access levels of all routes using the routesConfiguration
object.
PUBLIC
: Routes accessible without user authentication.PRIVATE
: Routes requiring user authentication.MAIN
: Main layout for authenticated users.UNAUTHORIZED
: Layout for non-authenticated users or authentication pages./pages/_app/PageConfig/index.tsx
file) plays a crucial role in applying these configurations.
It uses the route configuration from routes.ts
to determine the appropriate scope and layout for each page.
PageConfig
component, using the Next.js router, matches the current route against the routesConfiguration
..page.tsx
postfix..api.ts
postfix.next.config.js
if needed.