Giter Site home page Giter Site logo

fumeapp / laranuxt Goto Github PK

View Code? Open in Web Editor NEW
618.0 12.0 138.0 12.59 MB

Laravel and Nuxt.js boilerplate

PHP 66.05% Vue 19.04% CSS 0.70% Shell 0.93% TypeScript 11.20% Blade 0.38% Dockerfile 1.71%
laravel nuxt metapi vuejs tailwindcss stylus purgecss nuxt-boilerplate mdi

laranuxt's People

Contributors

acidjazz avatar arunsathiya avatar cod3gen avatar dammy001 avatar dany-eudes avatar dependabot[bot] avatar msaladna avatar shoemoney avatar tcampbppu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

laranuxt's Issues

Contribution guide

Is there any contribution guide for this project or I should just go ahead to create a PR stating what I worked on?.

nuxt v3 - auth module/plugin middleware

move loggedIn to a cookie check and stop there - properly respond to an access denied endpoint with removing the session and redirecting properly - keep the FE simple!

updates to pull from qv

  • controller.php add metapi initiation
  • config/app.php add other envs
  • routes add cleaner route list for local only and add assets
  • "@vue/composition-api": "^1.0.3" in deps

docker support

I suggest to support docker compose in this awesome boilerplate

Viewing Debugbar

Hi!

I'm curious if you are able to view the debugbar within your Nuxt application in this setup?

Thanks!

Login with E-Mail doesnt work

Hey, I tried to login with Mail but this doesnt work.

I got the Mail but nothing happens after clicking this.

No Errors, I'am still not logged in.

Any Idea?

Thanks for your work!

Problems with composer install

Followed these steps:

  1. git clone ....
  2. yarn
  3. composer install

I get the following error message:

Generating optimized autoload files
> Illuminate\Foundation\ComposerScripts::postAutoloadDump
> @php artisan package:discover --ansi

   InvalidArgumentException  : Please provide a valid cache path.

  at /home/anthony/Projects/LaraNuxt/vendor/laravel/framework/src/Illuminate/View/Compilers/Compiler.php:36
    32|      */
    33|     public function __construct(Filesystem $files, $cachePath)
    34|     {
    35|         if (! $cachePath) {
  > 36|             throw new InvalidArgumentException('Please provide a valid cache path.');
    37|         }
    38| 
    39|         $this->files = $files;
    40|         $this->cachePath = $cachePath;

  Exception trace:

  1   Illuminate\View\Compilers\Compiler::__construct()
      /home/anthony/Projects/LaraNuxt/vendor/laravel/framework/src/Illuminate/View/ViewServiceProvider.php:141

  2   Illuminate\View\ViewServiceProvider::Illuminate\View\{closure}()
      /home/anthony/Projects/LaraNuxt/vendor/laravel/framework/src/Illuminate/Container/Container.php:799

  Please use the argument -v to see more details.
Script @php artisan package:discover --ansi handling the post-autoload-dump event returned with error code 1

I tried after composer install: php artisan generate:key same error and also composer dump-autoload

Screenshot below:
image

Nuxt.js + Laravel on same server nginx

Hello, Kevin!
I using your laravel-nuxt starter project and the my question is How I run laravel api server and nuxt client in the same server. I found this example in https://nuxtjs.org/faq/nginx-proxy/, but it use forge. I`m using DigitalOcean to host my website with ubuntu18.04. I would like run laravel and nuxt on it. Unfortunately my domain name service plan does not allow create subdomain.

# FORGE CONFIG (DOT NOT REMOVE!)
include forge-conf/YOUR_WEBSITE_FOLDER/before/*;

map $sent_http_content_type $expires {
    "text/html"                 epoch;
    "text/html; charset=utf-8"  epoch;
    default                     off;
}

server {
    listen 443 ssl http2;
    listen [::]:443 ssl http2;
    server_name YOUR_WEBSITE_DOMAIN;

    # FORGE SSL (DO NOT REMOVE!)
    ssl_certificate /etc/nginx/ssl/YOUR_WEBSITE_FOLDER/258880/server.crt;
    ssl_certificate_key /etc/nginx/ssl/YOUR_WEBSITE_FOLDER/258880/server.key;

    ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
    ssl_ciphers 'ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256:kEDH+AESGCM:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA256:DHE-RSA-AES256-SHA256:DHE-DSS-AES256-SHA:DHE-RSA-AES256-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:AES:CAMELLIA:DES-CBC3-SHA:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!MD5:!PSK:!aECDH:!EDH-DSS-DES-CBC3-SHA:!EDH-RSA-DES-CBC3-SHA:!KRB5-DES-CBC3-SHA:!3DES';
    ssl_prefer_server_ciphers on;
    ssl_dhparam /etc/nginx/dhparams.pem;

    add_header X-Frame-Options "SAMEORIGIN";
    add_header X-XSS-Protection "1; mode=block";
    add_header X-Content-Type-Options "nosniff";

    charset utf-8;

    gzip            on;
    gzip_types      text/plain application/xml text/css application/javascript;
    gzip_min_length 1000;

    # FORGE CONFIG (DOT NOT REMOVE!)
    include forge-conf/YOUR_WEBSITE_FOLDER/server/*;

    location / {
        expires $expires;

        proxy_set_header Host               $host;
        proxy_set_header X-Real-IP          $remote_addr;
        proxy_set_header X-Forwarded-For    $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto  $scheme;
        proxy_redirect              off;
        proxy_read_timeout          1m;
        proxy_connect_timeout       1m;
        proxy_pass                          http://127.0.0.1:3000; # set the adress of the Node.js
    }

    access_log off;
    error_log  /var/log/nginx/YOUR_WEBSITE_FOLDER-error.log error;

    location ~ /\.(?!well-known).* {
        deny all;
    }
}

 # FORGE CONFIG (DOT NOT REMOVE!)
include forge-conf/YOUR_WEBSITE_FOLDER/after/*;```

Every Route returns 302

Hi
Trying to create a couple of pages but unfortunately every time I try to access a page like /login it redirects me to index
for example I made a auth folder and inside of that there is a login.vue page
http://192.168.2.66:3000/auth/login returns me back to http://192.168.2.66:3000
Im Using Wamp for apache and latest node and npm
how can I disable this ? and why is this happening
thanks

Is it necessary to use PHP 7.4

Could you consider to set require PHP version to the same require version of Laravel. I think this package is not necessary to require 7.4

form helper

i think this template must have a form helper to submiting form and catch validation errors, something like inertia form helper ( useForm )

Error when running yarn dev

I've followed the steps to install and run "yarn dev", but shows this error below. Please help:

ERROR ERROR in client/components/header/HeaderUser.vue:9:7 20:31:13
TS2451: Cannot redeclare block-scoped variable 'ctx'.
7 |
8 | <script lang="ts" setup>

9 | const ctx = useContext()
| ^^^
10 | const user = computed(() => ctx.$auth.user)
11 | console.log(ctx.$auth)
12 | </script>

ERROR in client/components/header/ModalLogin.vue:75:7
TS2451: Cannot redeclare block-scoped variable 'ctx'.
73 | const emit = defineEmits(['off'])
74 |

75 | const ctx = useContext()
| ^^^
76 | const email = ref('')
77 | const loading = reactive({
78 | attempt: false,

Suggestion: Dont integrate nuxt code into resources directory

@acidjazz One suggestion here: Dont integrate nuxt code into resources directory
Keeping the laravel resources directory kosher allows one to run as separate processes and involve different tech in separate directories - just to make it easier for anybody looking into this code to see where the boundaries are (it also makes managing deployments easier for example).

Proposed folder structure:

  • laranuxt/ --> root folder, this has all the laravel code (folders like app, bootstrap, config, resources, etc).
  • laranuxt/client --> this has all the nuxt.js code (typically the 'client' folder doesnt exist in a laravel app)
    See how github.com/cretueusebiu/laravel-nuxt does this (though I dont like that they are using this module: https://github.com/nuxt-community/router-module)

By extension, the nuxt.config.js and tailwind.config.js shouldn't be in the laravel config/ folder. Better if all front-end (nuxt) assets are in the same (proposed name: "client") directory.

"Request failed with status code 404" in console

Thank you for this repo @acidjazz
This one isn't a blocker in any way, the code still runs, but this is what I see when I run npm run dev (notice "Request failed with status code 404")
Thought I would report it!

$ npm run dev

> [email protected] dev /Users/kunalpunjabi/Code/LARAVEL_WORKING_CODE/NUXT/laranuxt
> nuxt config/

ℹ postcss-preset-env stage is set to 1 for supporting advanced css features                                                                                                      nuxt:tailwindcss 21:46:07
start Loading module                                                                                                                                                                nuxt-purgecss 21:46:07
ℹ PurgeCSS is not enabled because you are in dev mode                                                                                                                               nuxt-purgecss 21:46:07

 WARN  Address localhost:3000 is already in use.                                                                                                                                                  21:46:08

ℹ Trying a random port...                                                                                                                                                                         21:46:08

   ╭─────────────────────────────────────────────╮
   │                                             │
   │   Nuxt.js v2.8.1                            │
   │   Running in development mode (universal)   │
   │                                             │
   │   Listening on: http://localhost:49373/     │
   │                                             │
   ╰─────────────────────────────────────────────╯

ℹ Preparing project for development                                                                                                                                                               21:46:12
ℹ Initial build may take a while                                                                                                                                                                  21:46:12
✔ Builder initialized                                                                                                                                                                             21:46:12
✔ Nuxt files generated                                                                                                                                                                            21:46:12

✔ Client
  Compiled successfully in 14.42s

✔ Server
  Compiled successfully in 13.70s

ℹ Waiting for file changes                                                                                                                                                                        21:46:31
ℹ Memory usage: 241 MB (RSS: 323 MB)                                                                                                                                                              21:46:31

 ERROR  Request failed with status code 404                                                                                                                                                       21:46:38

  at createError (node_modules/axios/lib/core/createError.js:16:15)
  at settle (node_modules/axios/lib/core/settle.js:17:12)
  at IncomingMessage.handleStreamEnd (node_modules/axios/lib/adapters/http.js:237:11)
  at IncomingMessage.emit (events.js:187:15)
  at IncomingMessage.EventEmitter.emit (domain.js:442:20)
  at endReadableNT (_stream_readable.js:1094:12)
  at process._tickCallback (internal/process/next_tick.js:63:19)

guest page not working

i have added this but when visti the guest page redirect me to home page

{ name: 'Test', icon: 'star', to: '/test', gated: false, names: ['test'], },

Error target class [web] doesn not exist

First of all, thank you for this amazing repository. However, it seems I have an issue with the web middleware. Whenever I add the middleware, it causes this error: Target class [web] does not exist. as seen in the figure below. I've tried running php artisan optimize:clear and config:cache but the error still persists.

image

Before submitting this issue, I tried to register Laravel routes for better understanding. Below is the configuration I have:

  1. My RouteServiceProvider Class
public function boot()
  {
          $this->configureRateLimiting();
  
          $this->routes(function () {
              Route::middleware('api')
                  ->prefix('api')
                  ->group(base_path('routes/api.php'));
  
              Route::middleware('web')
                  ->group(base_path('routes/web.php'));
          });
 }
  1. My Http Kernel Class
protected $middlewareGroups = [
        'web' => [
            \App\Http\Middleware\EncryptCookies::class,
            \Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class,
            \Illuminate\Session\Middleware\StartSession::class,
            \Illuminate\View\Middleware\ShareErrorsFromSession::class,
            \App\Http\Middleware\VerifyCsrfToken::class,
            \Illuminate\Routing\Middleware\SubstituteBindings::class,
        ],

        'api' => [
            \Illuminate\Routing\Middleware\ThrottleRequests::class . ':api',
            \Illuminate\Routing\Middleware\SubstituteBindings::class,
        ],
};
  1. My Routes Files

image

These are the configurations I've set up so far. I might be overlooking something. Could you please assist in resolving the issue? Any help would be greatly appreciated.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.