Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

A Laravel-Nuxt starter kit.

License

NotificationsYou must be signed in to change notification settings

cretueusebiu/laravel-nuxt

Repository files navigation

Build StatusTotal DownloadsLatest Stable Version

A Laravel-Nuxt starter project template.

Features

  • Nuxt 2
  • Laravel 8
  • SPA or SSR
  • Socialite integration
  • VueI18n + ESlint + Bootstrap 4 + Font Awesome 5
  • Login, register, email verification and password reset

Installation

  • composer create-project --prefer-dist cretueusebiu/laravel-nuxt
  • Edit.env and set your database connection details
  • (When installed via git clone or download, runphp artisan key:generate andphp artisan jwt:secret)
  • php artisan migrate
  • npm install

Usage

Development

# start Laravelphp artisan serve# start Nuxtnpm run dev

Access your application athttp://localhost:3000.

Production

npm run build

Enable SSR

  • Editclient/nuxt.config.js and setssr: true
  • Edit.env to setAPP_URL=http://api.example.com andCLIENT_URL=http://example.com
  • Runnpm run build andnpm run start

Nginx Proxy

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;    }}

Process Manager

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.

Socialite

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.

Email Verification

To enable email verification make sure that yourApp\User model implements theIlluminate\Contracts\Auth\MustVerifyEmail contract.

Notes

  • This project usesrouter-module, so you have to add the routes manually inclient/router.js.
  • If you want to separate this in two projects (client and server api), movepackage.json intoclient/ and remove config path option from the scripts section. Also make sure to add the env variables inclient/.env.

Changelog

Please seeCHANGELOG for more information what has changed recently.

Packages

No packages published

Languages


[8]ページ先頭

©2009-2025 Movatter.jp