I found that creating one project for all customers forced me to write the code better and more modular, but then it means I have a more complicated config file, and means in my router.js I have a few routes that reply on a config setting that specifies which customer it is.
What I would find useful is a bit way to kind of abstract the routes away. If Company A has a few child routes that Company B did not need. I dislike the Company A routes being in the router.js. It would be better if router.js stayed abstract in nature and didn’t assume anything. Can I put these this.route calls into a different file?
There seems nowhere to inject a service, which I would normally do by name, extracted from data, if I wanted to separate out functionality.
Does anyone have any opinion about whether I’d be better off just keeping separate build environments for each customer (it would give the freedom) or continuing to try and keep all customers inside the same project.
I worry that the file watcher will be more burdened, the more customers I have. I’m almost duplicating code now anyway, changing the templates at the top level. But this is still useful to do as it makes a better starting point for a new customer.
The other thing I find awkward is CSS between customers. I use div company-acme as a parent selector in all my styles so that the styles for one customer do not affect the styles for another - because they usually are quite different. It means when there is a new customer I have to go through the project changing these parent selectors to div.acme-2 to change the company name to kind of create a new space. But of course this means I’m injecting all CSS styles into the browser, even if the browser is not using a large subset of them. Again, it feels wrong and gives me cause to think I should keep a separate build environment for each customer who has customised the planner.
There must be a better way? Or is there not?