This is a boilerplate template for a common and slightly opinionated setup of your Laravel, Nuxt & Tailwind CSS project that includes Sanctum authentication.
Please clone this repository and then follow these install steps:
git clone https://github.com/ci-on/laravel-nuxt-tailwind-boilerplate.git project-name
cd project-name
composer install
cp .env.example .env
php artisan key:generate
php artisan install
php artisan migrate
cd frontend
cp .env.example .env
yarn install
Please note, you may need to adjust your .env
-variables.
It's fairly easy to set up a local server with this project. It is important to note, that due to Sanctum's httpOnly
cookie authentication, we need to use Laravel's & Nuxt's built-in webserver, so that we can serve the API and the frontend on the same domain.
php artisan serve #localhost:8000
cd frontend
yarn && yarn build
yarn dev #localhost:3000
You can now visit your frontend by visiting localhost:3000 and the API by pinging localhost:8000.
It is very easy to deploy this project to Netlify. We include the netlify.toml which allows you to simply connect your project to Netlify.
For those who are interested in the production build script:
# this will generate your static assets & pages and it should be your command to compile this project on services like Netlify or Vercel
yarn build && yarn export
Part of the reason this is a somewhat opinionated package is because we added some tooling we use for most of our projects to help us kickstart the initial development process. Below are the key details outlined:
- Laravel 7.*
- Laravel Sanctum Authentication
- Nuxt 2.13.*
- Tailwind 1.5.*
- Eslint & Prettier setup
- Laravel Telescope
- Laravel's IDE Helper
- VS Code suggested plugins
- Netlify integration
- StyleCI integration
- Dependabot integration
Please see CONTRIBUTING for details.
If you discover any security related issues, please email chris@cion.agency instead of using the issue tracker.
The MIT License (MIT). Please see License File for more information.
Made with ❤️ by CION Agency