How to organize code in Electron App? Any best practice?


#1

Hi, I am new to Electron.
Before this, I have used Express to work on Node Web application. I also have some experience on Android app development and PHP Zend framework. All these have a quite clear code guide so I don’t need to worry about where should I put my code files.

Now I am having some problems organizing code in the Electron Project.
I hope you guys can help me.

Here is what I thought:
It should be neat to code with MVC model in mind.
As far as I understand, the main.js should be the entering Controller. It is like the Controller deal with homepage request.
As for M, I can encapsulate the business logic inside a Node Module and regard it as the Module part of MVC.
As for V, a normal HTML file would do the job very well. I am thinking about using certain render engine such as Handlebars, but I don’t know how.

I don’t know whether this approcah will work.
Maybe you guys have better way to do it, please share your thoughts.
I am open to any kind of framework that can make coding easier.
Thanks in advance.