> For the complete documentation index, see [llms.txt](https://codedthemes.gitbook.io/datta/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://codedthemes.gitbook.io/datta/how-to/dashboard-as-first-page.md).

# Dashboard as First Page

{% tabs %}
{% tab title="VITE ( TS )" %}
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`**

{% code title="src/routes/index.tsx
" %}

```typescript
// import { lazy } from 'react';
import { createBrowserRouter } from 'react-router-dom';

// project-imports
import AdminPanelRoutes from './AdminPanelRoutes';
import ApplicationRoutes from './ApplicationRoutes';
import ChartMapRoutes from './ChartMapRoutes';
import ComponentsRoutes from './ComponentsRoutes';
import FormsRoutes from './FormsRoutes';
import OtherRoutes from './OtherRoutes';
import PagesRoutes from './PagesRoutes';
import NavigationRoutes from './NavigationRoutes';
import TablesRoutes from './TablesRoutes';

// import Loadable from 'components/Loadable';
// import SimpleLayout from 'layout/Simple';

// const PagesLanding = Loadable(lazy(() => import('../views/Landing')));

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

const router = createBrowserRouter(
  [
    // {
    //   path: '/',
    //   element: <SimpleLayout />,
    //   children: [
    //     {
    //       index: true,
    //       element: <PagesLanding />
    //     },
    //     {
    //       path: '/landing',
    //       element: <PagesLanding />
    //     }
    //   ]
    // },
    NavigationRoutes,
    ApplicationRoutes,
    AdminPanelRoutes,
    ComponentsRoutes,
    FormsRoutes,
    TablesRoutes,
    PagesRoutes,
    OtherRoutes,
    ChartMapRoutes
  ],
  {
    basename: import.meta.env.VITE_APP_BASE_NAME
  }
);

export default router;

```

{% endcode %}

2. Add default dashboard route: **`src\routes\NavigationRoutes.tsx`**

{% code title="src/routes/NavigationRoutes.tsx" %}

```typescript
....

const NavigationRoutes = {
  path: '/',
  children: [
    {
      path: '/',
      element: <DashboardLayout />,
      children: [
        {
          path: '/',
          element: <DefaultPages/>
        },
        {
          path: 'dashboard',
          children: [
            {
              path: 'default',
              element: <DefaultPages/>
            },
            ....
          ]
        }
        ...
      ]
  };
```

{% endcode %}
{% endtab %}

{% tab title="VITE ( JS )" %}
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.jsx`**

{% code title="src/routes/index.jsx" %}

```javascript
// import { lazy } from 'react';
import { createBrowserRouter } from 'react-router-dom';

// project-imports
import AdminPanelRoutes from './AdminPanelRoutes';
import ApplicationRoutes from './ApplicationRoutes';
import ChartMapRoutes from './ChartMapRoutes';
import ComponentsRoutes from './ComponentsRoutes';
import FormsRoutes from './FormsRoutes';
import OtherRoutes from './OtherRoutes';
import PagesRoutes from './PagesRoutes';
import NavigationRoutes from './NavigationRoutes';
import TablesRoutes from './TablesRoutes';

// import Loadable from 'components/Loadable';
// import SimpleLayout from 'layout/Simple';

// const PagesLanding = Loadable(lazy(() => import('../views/Landing')));

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

const router = createBrowserRouter(
  [
    // {
    //   path: '/',
    //   element: <SimpleLayout />,
    //   children: [
    //     {
    //       index: true,
    //       element: <PagesLanding />
    //     },
    //     {
    //       path: '/landing',
    //       element: <PagesLanding />
    //     }
    //   ]
    // },
    NavigationRoutes,
    ApplicationRoutes,
    AdminPanelRoutes,
    ComponentsRoutes,
    FormsRoutes,
    TablesRoutes,
    PagesRoutes,
    OtherRoutes,
    ChartMapRoutes
  ],
  {
    basename: import.meta.env.VITE_APP_BASE_NAME
  }
);

export default router;

```

{% endcode %}

2. Add default dashboard route: `src/routes/NavigationRoutes.jsx`

{% code title="src/routes/NavigationRoutes.jsx" %}

```javascript

...
const NavigationRoutes = {
  path: '/',
  children: [
    {
      path: '/',
      element: <DashboardLayout />,
      children: [
        {
          path: '/',
          element: <DefaultPages />
        },
        {
          path: 'dashboard',
          children: [
            {
              path: 'default',
              element: <DefaultPages />
            },
            ....
          ]
        }
        ...
      ]
  };
```

{% endcode %}
{% endtab %}
{% endtabs %}
