Motivation
Make it easy to switch back and forth between frontend and backend.
Ideas
* Provide a very basic custom elements that triggers loading it + have dedicated endpoints which allow re-using Drupal markup and JS.
* We should not get into the business of rewriting links, with existing redirects and possible some additional client-side redirects we should be able to simply redirect to the right admin-backend transparently.
Comments
Comment #2
glynster commentedIn our example, we used the Drupal Tabs already integrated within Nuxt. For most cases with our development, this setup meets the client’s needs, with the exception of providing a way to return to the backend and log out.
Here is the code we generated for the Drupal Tabs:
There are a few key points to note:
I believe incorporating this link into the default Lupus setup will be a game-changer for developers.
Simple Lupus renderer added for the user info check:
We also added a composable for the Lupus API:
To log in we push them via Nuxt to the Drupal backend:
Let me know if I can help any further.
Comment #3
fagoThanks for sharing, this seems awesome!
I wonder how we can facilitate creating, sharing and re-using solutions like this.
If we could manage to work-in necessary backend solutions to be available by default or configurable, we could also package the frontend parts up as sort of theme/component you add. So we could have a couple of add-ons like this available for people to install and use depending on preference. Like a collection of themes you use for starting.
What about providing this as a nuxt-layer? What do you think? Would you be interested in re-shaping it to make it re-usable for multiple sites?
I don't think we should depend on nuxt-ui and tailwind by default, they are great, but we should enable people to make their choices. So things like that should better be optional add-ons, which we then can opt to use for new sites, demos etc.
Comment #4
glynster commentedI really like this idea! Starting with a basic Nuxt version sounds great, and allowing features to be configurable within nuxt.config adds flexibility for those who want to enable them. Nuxt UI/Tailwind is a solid choice—it stays within the Nuxt ecosystem and provides a strong foundation for development. But as you mentioned, it’s important for devs to pick the tools that best suit their project.
What are your thoughts on collaboration? I assume we could handle most of this on GitHub?
Comment #5
fago> What are your thoughts on collaboration? I assume we could handle most of this on GitHub?
Yes, agreed. Since Drupal Gitlab makes all code gplv2+ it's not a good choice for frontend stuff atm, anyway Github seems natural for that, so I think it's fine to go with it atm! We could make some github topic like lupus-decoupled-nuxt-layer and link them from the project page / website?
Comment #6
glynster commented@fago, here is what I have generated for a Nuxt layer:
https://github.com/StirStudios/stir_nuxt_base
At the moment, it is suited to our project needs, though it may include more than necessary. Here’s what it does currently:
This is my first time working with layers, and it made sense to start with Nuxt 4 compatibility. The webform is quite flexible, allowing for many options, and basic validation is handled via Nuxt UI and Yup. I’ve also implemented basic theming for user login forms, though there’s less flexibility since we don’t have the same control over theming as we do with webforms.