Routing uses React Router v6 createBrowserRouter. Route configs live in src/routes/.

Router entry — routes/index.tsx

LoginRoutes is listed first; both share root path / with different layout children.

Login routes — routes/LoginRoutes.tsx

Register, forgot-password, and reset-password routes exist in comments but are not active.

Main routes — routes/MainRoutes.tsx

All authenticated pages use SimpleLayout with SimpleLayoutType.SIMPLE.

Route table

Role wrappers

UserFormElement allows admin or isUser={true} for profile self-edit.

Lazy loading

All page components are loaded with:
This code-splits route bundles and shows a loading fallback via Loadable.

Route guards

AuthGuard and GuestGuard (utils/route-guard/) are available but applied at layout level in some MUI template variants. Current MainRoutes relies on role checks inside route elements rather than wrapping every route with AuthGuard. See Route guards.
  • Post-login redirect: /dashboard (APP_DEFAULT_PATH)
  • 401 API response: axios interceptor redirects to /login
  • Logout: window.location.pathname = '/login'