Disclaimer – this is a guest article, from a friend of mine, Maciej. The original post can be found on his Medium profile, make sure to hit that clap button when you read it there 🙂 Enjoy!
React with Express and Angular with Nest
The most popular framework for Node.js is still Express.js. At the front-end there are three kings: Angular, React and Vue. After adding the most popular NoSQL database – MongoDB – we get a combination of the most popular stacks for JS developers: MEAN, MERN and MEVN.
- module-based dependency injection system (with imports, exports and providers)
- set of officially supported 3rd party libraries
- feature-rich framework’s core, with lots of out-of-the-box functionality
Each of these approaches has its pros and cons. The biggest drawback is mixing different coding philosophies within one stack. Although the elements of MERN stack fit together very well, the same cannot be said about MEAN stack. That’s why I want to propose a much better alternative to it — a NAN stack.
The NAN stack composes of three technologies: NestJS, Angular and Nx. The natural combination of NestJS and Angular has been described above. Nx is a set of tools to help you work with monorepo, which is also an indispensable help even when developing large, single applications.
For a full-stack developer, the ability to share code, tools and a repository between the back-end and front-end cannot be overestimated. Guys from nrwl also noticed that and started to support the possibility to create projects using Angular + Nest or React + Express.
Relational databases have not disappeared
The last important difference between NAN and MERN, is the omission of the database. Including it in your new stack would be an unnecessary restriction. A good back-end or full-stack developer should be familiar with both NoSQL databases and classic, relational databases.
Even more importantly, he should be able to consciously choose the right database for the project requirements and the technology stack should not be a determinant in this case. What I mean here is that every Node.js developer is surely aware that this technology does not work in some types of applications (e.g. with the heavy calculation).
A good developer should be able to convince the stakeholders to consider a different technology. Even if NoSQL is the only technology you know, it’s choice should be clearly justified.
The MEAN stack gained incredible popularity and paved a certain direction which many companies and developers follow. Those technologies gained appraise among already wide JS community.
If you want to see the use of a NAN stack in a real project, here’s the link https://github.com/valueadd-poland/pimp-my-pr
Stay up-to-date with the latest information.