Installation Guide
Quick Start
Option 1: Start a new project with the template (recommended)
sh
$ npx deegit https://git.weconstudio.it/we/nuxt-template.git <project-name>
Option 2: Add to an existing project
sh
$ yarn add https://git.weconstudio.it/we/nuxt.git
# or
$ npm install https://git.weconstudio.it/we/nuxt.git
Configuration
Add @we/nuxt
to the modules section in your nuxt.config.ts
:
js
// nuxt.config.ts
export default defineNuxtConfig({
modules: [
'@we/nuxt'
],
// Nuxt configuration
ssr: false,
devtools: { enabled: true },
compatibilityDate: '2024-08-09',
// i18n module configuration
i18n: {
lazy: true,
defaultLocale: 'it',
strategy: 'no_prefix',
vueI18n: './i18n.config.ts',
locales: [
{
code: 'it',
name: 'Italiano',
},
],
},
// Notivue module configuration
notivue: {
position: 'top-right',
enqueue: true,
limit: Number.POSITIVE_INFINITY,
},
// Sanctum authentication configuration
sanctum: {
globalMiddleware: {
enabled: true,
allow404WithoutAuth: true,
},
},
// @we/nuxt module configuration
we: {
// Notification system configuration
notify: {
enabled: true, // Enable the notification system
css: true, // Include default CSS styles
legacy: true, // Support legacy notification format
},
// API configuration
api: {
baseUrl: process.env.NUXT_BASE_URL, // Base URL for API requests
apiSuffix: 'api/backoffice/', // API endpoint suffix
endpoints: [
'https://api.test.com', // Production API
'https://staging.api.test.com' // Staging API
],
},
},
})
Included Third-Party Modules
Our package integrates several popular Nuxt modules to provide a complete development experience:
Authentication & Security
- nuxt-auth-sanctum - Laravel Sanctum integration for authentication
UI & User Experience
- notivue/nuxt - Simple and flexible notifications system
- @nuxt/icon - Icon management for your Nuxt applications
Utilities
- @vueuse/nuxt - Collection of Vue composition utilities
- @nuxtjs/i18n - Internationalization for your Nuxt application
- vue-lux/nuxt - Luxon date utilities for Vue