Introduction to Nest.js — A Progressive node.js framework for backend.
As I mentioned before Node.js (for the server-side) has plenty of great libraries, But none of them solves the main problem of architecture. Nest provides an out-of-the-box application architecture that allows developers and teams to create highly testable, scalable, loosely coupled, and easily maintainable applications. The architecture is heavily inspired by Angular.
What so special about this framework?
01. Nest JS is an open-source framework for building efficient, scalable Node.js server-side applications.
03. Combines elements of Object-Oriented Programming, Functional Programming, and Reactive Programming.
04. Nest.js provides a similar kind of architecture to other server-side applications like .NET Core, Java Spring Boot, etc.
05. Under the hood, Nest makes use of robust HTTP Server frameworks like Express (the default) and optionally can be configured to use Fastify as well.
Let’s create a “Hello World” app with Nest JS.
01. First of all you need to install Node.js. Click here to download Node.js for your operating system.
02. Then You need Nest-CLI. This helps you to initialize and develop your applications. Open the command line and execute this command.
npm install -g @nestjs/cli
03. Now you can generate a new project using this command. Replace “my-nest-project” with your project name.
nest new my-nest-project
04. Go to the project directory and execute below command to start the application.
npm run start:dev
That's it, Now In your browser, open http://localhost:3000 to see a new application running. The app will automatically recompile and reload when you change any of the source files.
You can easily learn lots of things by referring to Nest JS documentation. The Nest JS documentation is well-maintained and contains a lot of information with real examples. https://docs.nestjs.com/
Happy Coding :)