Laravel-Nuxt application seperated from main open-source project created by cretueusebiu Checkout main repository
A Laravel-Nuxt starter project template.
- Nuxt 2
- Laravel 8
- SPA or SSR
- Socialite integration
- VueI18n + ESlint + Bootstrap 4 + Font Awesome 5
- Login, register, email verification and password reset
npm install
# start Laravel
php artisan serve
# start Nuxt
npm run dev
Access your application at http://localhost:3000
.
npm run build
- Edit
client/nuxt.config.js
and setssr: true
- Edit
.env
to setAPP_URL=http://api.example.com
andCLIENT_URL=http://example.com
- Run
npm run build
andnpm run start
For Nginx you can add a proxy using the follwing location block:
In production you need a process manager to keep the Node server alive forever:
# install pm2 process manager
npm install -g pm2
# startup script
pm2 startup
# start process
pm2 start npm --name "laravel-nuxt" -- run start
# save process list
pm2 save
# list all processes
pm2 l
After each deploy you'll need to restart the process:
pm2 restart laravel-nuxt
Make sure to read the Nuxt docs.
- This project uses router-module, so you have to add the routes manually in
client/router.js
. - If you want to separate this in two projects (client and server api), move
package.json
intoclient/
and remove config path option from the scripts section. Also make sure to add the env variables inclient/.env
.
Please see CHANGELOG for more information what has changed recently.