Carson
Reactive Headless Data Models in Nuxt
Hey all! Amateur programmer here. I've got an issue that I run into all the time, and I haven't found a solution yet. The issue is this: do people use composables to represent reactive class structures for their complex data models on the client? If not, what should I be doing?
Background: I don't know where to keep my client-side data models. I know useState and Pinia are recommended but they seem to be more for app state, like app-wide UI elements, and I think they only work well for primitive data types. My data types are often heavily graph-based (as in graph theory), and so they tend to have complex dependency structures (across edge relations, which - similar question - how do I store those in my app?)
I could just have my UI components handle all the dynamic data computation, but that leads to a lot of repeated code and processing. It would be better to have some kind of stateful headless instancing of these dynamic data models - which is maybe where composables come into play? So, is it bad to use composables as reactive JS Class structures, to decouple data from the UI, but also persist it on the client in a more computed way than primitive data in Pinia stores?
6 replies
Docker Compose Container Setup - Module not found error
I'm trying to get Nuxt 3 set up in a docker environment. Ultimately, I'd like to get live-reload working for development. For now, I can't even access any webpages without getting a
500: Cannot read properties of undefined (reading 'modules')
error. I'll post code below. The Nuxt build is basically a fresh install. The docker setup is a little unique, but I believe there aren't any routing problems. I'll post code below:6 replies