Express, or NestJS (Typescript)
Express JS is the de-facto for the NodeJS, a web application framework built by TJ Holowaychuk. NestJS is the wrapper on top of the express js which has multiple other plugins that come handy when doing an enterprise-level project. And not to forget that NestJS come out of the box with typescript support and Dependency injections.
The framework structure is very similar to that of angular 2+, so in case you know either of one, the other one would be really fast to grab.
A big difference is that though Nest js use express under the hood, express is a callback-based framework, whereas nest mostly use promises and async-await, so codes are pretty neat.
So, if you are going to do an MVP and need to move really fast and stick to just plain es6 or es7, I would recommend sticking to Express. But if you can give more time and compatibility with typescript, I would strongly recommend using nestjs, as it comes with ‘out-of-the-box’ multiple supported integrations.
Here is a quick demo on how you can use nestjs with typeorm ( ORM for SQL Database connections). And you can clone the same codebase and remove the parts which you are not going to use.
The database is a very crucial part of almost any web or backend development. Writing queries and managing connections become really a nightmare as the project scales, and if there is any need for changing database servers, it means you have to go through all the queries and connection handling. To avoid such things and keep the code really clean, we use the ORM layer.
TypeORM support typescript out of the box and comes with both Datamapper and ActiveRecord support out of the box.
Though typeORM is very new, has an active development and still, in alpha production, it is yet quite stable and can be used for enterprise-level projects.
NestJS come out pretty handy when integrating TypeORM as if they are meant to go side by side. I won’t be surprised if NestJS start using TypeORM as its default ORM Layer.
Here is a quick tutorial on how you can use TypeORM with One-to-one, one-to-many, many-to-many relationships with any SQL server using NestJS.
GraphQL, Apollo Server
GraphQL was developed at Facebook and is being used intensively for data-driven web apps. Though many backend languages and framework support graphql, to date only NodeJS has the best integration with the apollo server.
So, if you are going to do GraphQL web development, Nodejs is generally the first preference for development for the backend.
NestJS provides a pretty clean GrapQL plugin, that can be integrated and can use to start development.
Though GraphQL is generally preferred to be used over the No-SQL database, it’s not that it is meant to be done by No-SQL only. But it can do pretty well with SQL servers and TypeORM on top of it.
Though in some cases you might need to integrate the DataLoader for optimization of queries and take that extra relational feature of the SQL server.
If you know the above three frameworks, you can do almost any kind of web or backend development
React Native for Web
There is no denying the fact that React & React-native have been in major use, but with flutter pushing flutter web and to write single code for the native as well as web apps, there is a definitive need for a similar framework which does the same.
Thanks to Necolas for starting this project, which has around 15.5k stars on Github. Though this framework is not widely used it’s going to be a breakthrough in 2020, where you can just maintain a single codebase for all your mobile and web apps.
If you already know React or React-Native, then React Native web is just a morning coffee for you, and you can directly start building apps by using its documentation.
Here you can read a brief introduction of the react-native web.
You might have to struggle a bit with some libraries, but it’s not a deal-breaker. You can read more about a happy struggle with react native web
If you know Expo and have been doing react native development on top of Expo, you can follow the guide here, Does expo support react native web
Here is a quick comparison guide on react native web vs react
React, React-native ( NextJs for server-side rendering)
React & React native still rule the web and app development. You can read the related topics here
If you want to build an enterprise-level project, I would recommend going for Angular. And, the main reason angular still is the first preference for enterprise or a huge project is that it comes with a lot of juices out of the box.
The first and foremost is the support for typescript out of the box. It also supports dependency injection and the framework is very well-enabled with guards, services, interceptors, middleware that can be directly plugged in and can be taken advantage of.
You can read in details about the difference between angular and react here
If you noticed above, we have recommended NestJs as a backend framework. If you know NestJS, then the good news is NestJS is actually inspired by Angular, so if you know one of these, learning the other would be really fast and nice.
If you are looking to get started with angular, here is a quick guide on Guide To Your First Angular 5 App
Frequently Asked Questions
How to integrate TypeORM with NestJS?
NestJS comes with a fairly simple and out of box configuration for typeorm. You can use typeorm as a default ORM layer in your NestJS project, it supports all the CLI functionality as well. Here is a quick tutorial that you can follow to set up your typerom-nestjs project.
How to use the one-to-many and many-to-many relationship with TypeORM?
There are three types of relationships in SQL and supported by Typeorm. One-to-One (@OneToOne()), One-to-Many / Many-to-One (@OneToMany()), Many-to-Many (@ManyToMany()). In this tutorial in which we have talked about creating three entities, User, Book, Genres and linking using typeorm.
Can GraphQL be used over SQL instead of No-SQL
Though GraphQL is generally preferred to be used over the No-SQL database, it’s not that it is meant to be done by No-SQL only, but it can do pretty well with SQL servers and TypeORM on top of it. Though it is preferred to use Dataloader to take advantage of the query optimizations. Here is q quick tutorial on how you can use GraphQL with NestJS and Typeorm and Dataloader
Can we use Expo with React native web?
Yes, Expo SDK v33 is the first SDK that supports the web. It also comes with TypeScript which is based on React Native, which includes hooks. It is the combination of many new features: APIs, workflows, developers tools, and many more upgraded version in SDK v33. Now the developers also like to use these versions as it is new and up-to-date, and also it’s the trend to follow the new and latest versions of the technology. Read more here
Does Angular and NestJS follow the same design pattern?
Yes, NestJS follows a similar design pattern as Angular, be it dependency injection, Interceptors, guards, observables or any other things. So if you know one of them, learning the other would be like having a morning coffee.
How useful was this post?
Click on a star to rate it!