For the complete documentation index, see llms.txt. This page is also available as Markdown.

Dashboard as First Page

How to set Dashboardas First page instead landing

This section explains how to set the Dashboard page as the default starting page, skipping the landing page, for cases where it is not needed.

  1. Update route at: src/routes/index.tsx

src\routes\index.tsx
// import { lazy } from 'react';
import { useRoutes } from 'react-router-dom';

// project-imports
// import CommonLayout from 'layout/CommonLayout';
// import Loadable from 'components/Loadable';
import ComponentsRoutes from './ComponentsRoutes';
// import LoginRoutes from './LoginRoutes';
import MainRoutes from './MainRoutes';

// render - landing page
// const PagesLanding = Loadable(lazy(() => import('pages/landing')));

// ==============================|| ROUTING RENDER ||============================== //

const router = createBrowserRouter(
  [
    // {
    //   path: '/',
    //   element: <SimpleLayout layout={SimpleLayoutType.LANDING} />,
    //   children: [
    //     {
    //       index: true,
    //       element: <PagesLanding />
    //     }
    //   ]
    // },
    // LoginRoutes,
    MainRoutes,
    ComponentsRoutes
  ],
  { basename: import.meta.env.VITE_APP_BASE_NAME }
);

export default router;
  1. Add default dashboard route: src/routes/MainRoutes.tsx

  1. Comment out the AuthGuard wrapper for the routes within the Dashboard element:

  1. Update route at: src/routes/index.jsx

  1. Add default dashboard route: src/routes/MainRoutes.jsx

  1. Comment out the AuthGuard wrapper for the routes within the Dashboard element:

Last updated