Federico Mengozzi

Bootstrap your nodejs backend

NodeJs Architecture

A clean, scalable and easy to expand architecture for a Node.js backend

Icon of NodeJs Architecture
Download Sources




After working with Nodejs for different projects (full fledged apps, hackathons and more) I realized I was implementing the same functionalities in different ways almost every time.

I decided to research some of recommended Nodejs architecture in order to create a template that I could use to bootstrap a nodejs application


I wanted the template to be clear and extensible. After taking input from different resources online (all links are on the github repo here) this is a result, that I plan to keep improving.


I will add here the reason why I made certain decision and why I think they make sense (TBC)


Most of the time I can do everything I need with this architecture, others time it happens that I had to modify the folder structure to isolate some components.

For example, in some cases, I had to change this structure

  • controllers
    • user
  • services
    • user

To a structure with more focus on the service itself, like this

  • user
    • controllers
    • services


Please, leave any comments, feedback and thoughts you have about this. How could I improve it? What are the weakest points?

Go to top