Comments (9)
@connecteev i wish i could but both are private :(
thanks! I'lll go ahead and remove those as well.
from laranuxt.
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.
@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:
- Move the nuxt.config.js and tailwind.config.js out of the laravel config/ folder and into the nuxt "client" folder.
- 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.
- 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,
- 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.
@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.
@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.
@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.
BTW @connecteev I also went w/ your recommendation of client/
and going w/ the srcDir:
parameter this time
from laranuxt.
@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.
@connecteev i did that for a while, nbd. I do like sharing the .env
though
from laranuxt.
Related Issues (20)
- Login with E-Mail doesnt work HOT 9
- form helper HOT 1
- php artisan serve does not work HOT 2
- Every Route returns 302 HOT 1
- redirect to home when reload the page
- guest page not working HOT 1
- i18n not working HOT 1
- Error target class [web] doesn not exist HOT 2
- css does not load if using production build HOT 3
- How to change nuxt address?
- updates to pull from qv
- Error when running yarn dev HOT 5
- How to login with email and password ? HOT 2
- nuxt v3 - auth module/plugin middleware HOT 4
- Contribution guide HOT 2
- Static Analyser HOT 4
- Vuetify lazy image loading HOT 2
- docker support HOT 4
- Permission denied when trying to clone git repo HOT 4
- icon and html validation modules HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from laranuxt.