GithubHelp home page GithubHelp logo

Comments (9)

acidjazz avatar acidjazz commented on May 23, 2024 1

@connecteev i wish i could but both are private :(

thanks! I'lll go ahead and remove those as well.

from laranuxt.

acidjazz avatar acidjazz commented on May 23, 2024

Thanks @connecteev I'll consider it,

BTW this folder is specified as NUXT_ROOT in your .env file, so it should be easy to change if you template off of this boilerplate.

client/ isn't a bad idea, but I thought it was ok design to share config/ since they are both sharing .env ?

from laranuxt.

connecteev avatar connecteev commented on May 23, 2024

@acidjazz interesting, I didn't know this was configurable. However, unless there's an obvious advantage I am missing, I do believe that a separation of front-end and back-end (versus a tight coupling) is a better design...just my 2c!

So, I think having the default nuxt directory not clash with the laravel resources folder is a good architecture, so it's not as tightly coupled. You can then deploy to these codebases separately, even. I would suggest moving the nuxt files to either a "client" or "nuxt" folder, and it can live at the top-level.

As far as the config is concerned, the front-end should all live in one place, and that includes the nuxt.config.js and tailwind.config.js files, since they fall under the purview of "front end". So they shouldn't be in the laravel config/ folder. Better if all front-end (nuxt) assets are in the same (proposed name: "client") directory.

As far as the .env file is concerned, it is owned by Laravel, and it should be focused on back-end only.

Summarizing: If you're open to it, can I suggest the following:

  1. Move the nuxt.config.js and tailwind.config.js out of the laravel config/ folder and into the nuxt "client" folder.
  2. Get rid of the NUXT_ROOT=resources setting (Laravel doesn't need to know where the nuxt / client folder is, and the default routes and view files put in resources/views should still work if the laravel routes are defined above / override the catch-all nuxt route.
  3. Unclear, do we need APP_API? Doesnt the front-end already know where it's running / located (port 3000 in this case)?
APP_API=http://localhost:3000/api
config/nuxt.config.js:    baseURL: process.env.APP_API,
  1. Also do we need to define APP_PROXY=http://localhost:8000/ Why can it not use APP_URL instead, or do we expect the 2 settings to be different? If possible, I would get rid of APP_PROXY and use APP_URL like so:
config/nuxt.config.js:    '/api': { target: process.env.APP_URL, ws: true },
config/nuxt.config.js:    '/_debugbar': process.env.APP_URL + '_debugbar',

These are just suggestions, of course...and I've only been playing with nuxt for a few days...but these suggestions come from a design standpoint for better more maintainable code, so I'll let you make the final call!

from laranuxt.

acidjazz avatar acidjazz commented on May 23, 2024

@connecteev this is all pretty new and still kind of experimented on.. although i do have two huge projects under this now it seems to be pretty solid so far, i don't have any solid answers for the config setup just yet.

go ahead and try out what I just checked in, a lot leaner.

from laranuxt.

connecteev avatar connecteev commented on May 23, 2024

@acidjazz New code looks clean...if you got rid of bulma, might make sense to delete the bulma.css and bulma.sass files as well.

And I'll let you consider the suggestions above for the config setup..just my 2c. Btw what projects do you have running, mind sharing some links? Inspiration is always great.

from laranuxt.

acidjazz avatar acidjazz commented on May 23, 2024

@connecteev BTW i have a whole new version up now that does not limit nuxtjs to a single directory, LMK what you think

from laranuxt.

acidjazz avatar acidjazz commented on May 23, 2024

BTW @connecteev I also went w/ your recommendation of client/ and going w/ the srcDir: parameter this time

from laranuxt.

connecteev avatar connecteev commented on May 23, 2024

@acidjazz thats great. I'm using vanilla nuxt and laravel at the moment in separate folders, I will come back and give your repo a try shortly.

from laranuxt.

acidjazz avatar acidjazz commented on May 23, 2024

@connecteev i did that for a while, nbd. I do like sharing the .env though

from laranuxt.

Related Issues (20)

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.