- Notifications
You must be signed in to change notification settings - Fork259
A Laravel-Nuxt starter kit.
License
cretueusebiu/laravel-nuxt
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
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
composer create-project --prefer-dist cretueusebiu/laravel-nuxt
- Edit
.env
and set your database connection details - (When installed via git clone or download, run
php artisan key:generate
andphp artisan jwt:secret
) php artisan migrate
npm install
# start Laravelphp artisan serve# start Nuxtnpm run dev
Access your application athttp://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:
server { location / { proxy_pass http://http://127.0.0.1:3000; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection 'upgrade'; proxy_set_header Host $host; proxy_cache_bypass $http_upgrade; }}
In production you need a process manager to keep the Node server alive forever:
# install pm2 process managernpm install -g pm2# startup scriptpm2 startup# start processpm2 start npm --name"laravel-nuxt" -- run start# save process listpm2 save# list all processespm2 l
After each deploy you'll need to restart the process:
pm2 restart laravel-nuxt
Make sure to read theNuxt docs.
This project comes with GitHub as an example forLaravel Socialite.
To enable the provider create a new GitHub application and usehttps://example.com/api/oauth/github/callback
as the Authorization callback URL.
Edit.env
and setGITHUB_CLIENT_ID
andGITHUB_CLIENT_SECRET
with the keys form your GitHub application.
For other providers you may need to set the appropriate keys inconfig/services.php
and redirect url inOAuthController.php
.
To enable email verification make sure that yourApp\User
model implements theIlluminate\Contracts\Auth\MustVerifyEmail
contract.
- This project usesrouter-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 seeCHANGELOG for more information what has changed recently.
About
A Laravel-Nuxt starter kit.
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
Uh oh!
There was an error while loading.Please reload this page.