Home > Net >  How to organise Backend with node js
How to organise Backend with node js

Time:11-30

I used to write bad backend code with PHP (mixing frontend and backend code in the same files). But now I just have started to learn node js. My goal is to write a clean and scalable code for my online app AND to become a professional backend programmer as well.

Should I start with a framework like express OR learning node itself? Should I apply MVC design pattern to my app with a framework or just native node js? Any other Ideas?

CodePudding user response:

Use a framework

This will make your life so much easier! When I was starting with Node it is very hard to even get Hello World working so frameworks like Express can help you reduce the amount of time you spend working on routing if you want to scale up from a one page application. Furthermore, express gives you the option to install addons like express-validator via NPM that can be super useful in keeping your site secure and scalable.

Here is a great tutorial for starting out with Node JS and using Express JS : FileStructure.png

Finally if you are looking for something for a larger application check out this article here : https://blog.logrocket.com/the-perfect-architecture-flow-for-your-next-node-js-project/.

  • Related