Thanks! Yeah, my use case allows me to do exactly what I need, aligning where the files are manually and simply rsync’ing them to where they need to be on my VPS.
User interaction requirements are going to change things dramatically from the way Odyssey functions.
The first thing I’d look at, is how you’re going to get images from the user. In that sense elm-file and perhaps elm-bytes are the fist place I’d look, although I’ve never personally worked with either package.
Those images, like you suggest—I’d put into a database resource server side. Either a base64 string or binary blob or a flat file with a unique identifier and an address stored in the database for it. Which solution I’d chose would be dependent on the backend properties though.
Depending on the size of your userbase, just passing a chunk of all user data as a flag into the
init function is going to be the wrong way to go here.
My assumption is that you’ll have individual profile pages that need only one set of profile pictures/backgrounds, and then another view/page that will need a list of users, or at least assets from a subset of users. For example this forum thread needs both of our logos but not background images (if we had them set up).
This, to me means you’ll need a backend serving you these details when you need them, and not all at once. A
Http.Request on page-load/route change rather than on init. Something with a simple REST API serving a JSON list of locations/other info, which can then be decoded would work fine. A more modern approach would be looking into elm-graphql.
This wasn’t one of your suggested methods though, so maybe you have other requirements I’m not aware of. I don’t think any of these ways are ‘the best’, since setting up my current suggestion is going to be more cumbersome than the other solutions we’ve discussed, although I think it’ll scale more as you change what you want to do with the data, on the other hand some of the simpler solutions are going to have performance issues once you get out of testing.
Happy to discuss designing things further. Perhaps a few people could comment on their interactions with
elm-file so far?