Reputation: 658
I'm faced with the following situation:
I have a Vue3 application that is currently being deployed via Dokku. It could also be deployed using plain Docker in the future, but the point is that it is deployed in an immutable environment that exploits git.
I find myself in a situation in which multiple different customers may want to use the application, and make a few basic customizations. There fall into three categories:
Keeping in mind that I'm the one who controls the deployment (i.e. the software will be distributed as a SaaS), the third category seems to be easily solved by using env vars and reading those variables in specific places of the application code and not rendering pieces of the application that are switched off for that build. This is not 100% efficient as those pieces of code will still be included in the build, though.
The biggest problem comes from the first two categories. I can imagine there could be a JSON config file which has a key for each of those customizable assets, but the problem is that some files will also need to be included inside of the codebase for that to work. For example, if I want to load a specific logo, I can specify the resource URI in the config file, but I will also need to have that file inside of the repository for the app. Likewise, if I want to enable certain UI strings to be customised by my clients, I may enable a directory which contains translations files to be merged with the built-in i18n files, but I would somehow need to include those files in the build.
Of course, I can't just add them to the git repository of the project, as that is unique and shared among all clients.
How would you tackle this issue?
Upvotes: 2
Views: 150