Skip to content

This is laravel10 + nuxt3 boilterplate with user authorization

Notifications You must be signed in to change notification settings

AdrianKuriata/laravel-nuxt-boilerplate

Repository files navigation

Laravel Nuxt Boilerplate Documentation

The documentation for the "Laravel Nuxt Boilerplate" application allows you to quickly start a new project using Nuxt 3 as the frontend layer and Laravel as the backend layer.

Table of Contents

  1. System Requirements
  2. Installation
  3. Configuration
  4. Running the Application
  5. Using the Application
  6. API Documentation
  7. Validation Handling
  8. Style Management
  9. ESLint and Vee-Validate
  10. Auth
  11. Locales
  12. License

System Requirements

To run the "Laravel Nuxt Boilerplate" application, you will need:

  • Node.js (recommended LTS version)
  • PHP (recommended version 8.x)
  • Composer (recommended 2.x)
  • Docker (for using Laravel Sail)
  • Laravel Sail (for easily running the Laravel application)

Installation

To install the application, follow these steps:

# Clone the repository
git clone https://github.com/AdrianKuriata/laravel-nuxt-boilerplate.git

# Navigate to the application directory
cd laravel-nuxt-boilerplate

# Copy the .env.example file to .env and customize the configuration
cp .env.example .env

# Install Sail

./vendor/bin/sail install

# Composer

./vendor/bin/sail composer install

# Migrations

./vendor/bin/sail art migrate:install && ./vendor/bin/sail art migrate

# Start Docker containers (using Laravel Sail)
./vendor/bin/sail up -d

# Install dependencies
npm i

# Start Nuxt
npm run dev

Configuration

Application configuration is located in the .env file. Customize settings such as the database, environment, etc., according to your needs.

Running the Application

To run the application, use the following command:

./vendor/bin/sail up -d

And next run Nuxt 3

npm run dev

The application will be accessible at http://localhost:3000.

Using the Application

With this boilerplate you can ease create new modern applications. There is latest version of Nuxt 3, Laravel 10. To manage store pinia is used.

API Documentation

There is Laravel for API. You can easy use a ziggy route with useZiggy (auto import) to use routes from the API in the client layer.

Validation Handling

Form validation is handled on the backend (in Laravel). Detailed information about validation can be found in the Laravel documentation. For the client vee-validate is used.

Style Management

The application uses Tailwind CSS for style management. You can customize styles in the Tailwind CSS configuration files. There is a simple components created with tailwind, but if you want, you can use other UI libraries for your project.

ESLint

ESLint is used to enforce coding style for JavaScript. Check a configuration for more information

Auth

There is used Laravel Breeze for backend authentication and @nuxt-alt/auth for client authorization. In fact to this day, there is no update for @nuxt/auth for Nuxt 3, so we are using alternative package. If there will be update for original package, we update this boilerplate. You can login, register or reset password.

Locales

i18n is used for manage locales in the application. Every locale should be updated in the client/locales files. The next locales you can add nuxt.config.ts.

License

The application is released under the MIT License.