--- title: "Vue Kit Frontend Architecture" description: "How resources/js is organised in the Vue kit: folder map, page and layout resolution, shared props, permission checks and translations with Inertia." --- # Architecture All the Vue-specific code sits in `resources/js`. For the Laravel side (modules, tenancy, auth), see [Core architecture](/docs/core/architecture). ## Overview Each request passes through a controller in a Laravel module and comes out as a Vue page wrapped in a layout: ```text Route → Controller → Service → Inertia::render('users/Index', props) → pages/users/Index.vue (+ shared props) → default layout picked in app.ts (or the page's own) ``` The client starts in `resources/js/app.ts`. There's no `resolve` callback in it, because the `@inertiajs/vite` plugin in `vite.config.ts` loads pages from `resources/js/pages` for you. `app.ts` also picks a default layout from the page name: `auth/*` → `AuthLayout`, `settings/*` → `AppLayout` + `settings/Layout.vue`, and everything else → `AppLayout`. [Layouts](/docs/vue/layouts#layout-selection-flow) has the details. The browser title comes out as `" - "`. On boot, `initializeTheme()` from `composables/useAppearance.ts` applies light, dark or system mode, and `initializeFlashToast()` from `lib/flashToast.ts` starts turning server flash data into toasts. ::: details View app.ts ```ts createInertiaApp({ title: (title) => (title ? `${title} - ${appName}` : appName), layout: (name) => { switch (true) { case name.startsWith('auth/'): return AuthLayout; case name.startsWith('settings/'): return [AppLayout, SettingsLayout]; default: return AppLayout; } }, progress: { color: '#4B5563' }, }); initializeTheme(); initializeFlashToast(); ``` ::: ## Folder map | Folder | Purpose | | --- | --- | | `pages/` | Inertia pages (PascalCase `.vue`): `auth/`, `errors/`, `roles/`, `settings/`, `setup/`, `tenants/`, `users/`, plus `Dashboard.vue` and `Home.vue` | | `layouts/` | `AppLayout.vue`, `AuthLayout.vue`, their variants in `app/` and `auth/`, and `settings/Layout.vue` | | `components/common/` | The kit's form kit: `CommonInput`, `CommonSelect`, `ConfirmDialog`, … | | `components/ui/` | shadcn-vue primitives (reka-ui) | | `components/` | App shell and feature components: `AppSidebar`, `AppHeader`, `NavMain`, `UserMenuContent`, … | | `composables/` | Shared logic as `useX.ts` | | `lib/` | `utils.ts` (`cn`, `toUrl`) and `flashToast.ts` | | `types/` | Hand-written and generated TypeScript types | | `lang/` | Generated translation JSON | | `routes/`, `actions/`, `wayfinder/` | Generated by Wayfinder, git-ignored | Every component uses ` ``` `vueLang()` also gives you `trans`, `transChoice` and `trans_choice`. There's more in [Localization](/docs/core/localization). ::: warning Always import from the `/vue` subpath. The package root exports the React and Svelte helpers as well, and importing it breaks the build. ::: ## Related files - `resources/js/app.ts`: entry point, default layouts, theme and flash toasts - `vite.config.ts`: the Inertia, Wayfinder (`formVariants: true`), Tailwind and Vue DevTools plugins - `app/Http/Middleware/HandleInertiaRequests.php`: where the shared props come from - `resources/js/types/global.d.ts`: `SharedData` and `PageProps` - `resources/js/composables/usePermission.ts`, `useLanguage.ts` - `resources/js/lib/flashToast.ts`, `lib/utils.ts` - `components.json`: the shadcn-vue config