Best practices for organizing an app with multiple interfaces

I have a web app that has a /client and a /server folder. I also have an Electron app with only the /client side stuff required and it just uses DDP.connect to talk to the web app server. The Electron app needs some slight modifications to the /client code to make it work, but most of the other UI stuff is exactly the same as the webapp (since Electron is just a Chromium wrapper).

I’m wondering what the best practice is for code sharing between the webapp’s /client folder and the Electron app /client folder. Right now I’m just developing in a separate git branch, and it’s quite annoying to have to port changes over from the main webapp branch.

1 Like

I would put the Electron app in it’s own project and repository. You’ll still need to copy over UI but it’ll be easier to maintain in the long run.

If you can, try to create a private npm package of your UI components for multiple interface use.