Nest.js

[Nest.js] 0 - Nest.js ?

ESTJames 2021. 9. 7. 15:41

Contents
1 - Introduction
2 - Philosophy
3 - Installation


1. Introduction

Nest(Nest.js) is a framework for building efficient, scalable Node.js server-side applications.

Nest is built with and fully supports TypeScript

Nest combines elements of OOP(Object Oriented Programming), FP(Functional Programming), and FRP(Functional Reactive Programming).

Nest makes use of robust HTTP Server framework like Express(the defualt), and can be configured to use Fastify.
, exposes their APIs directly to the developer, and gives the freedom to use myriad of third-party modules.


2. Philosophy

Recent trend in service-side applications, there are two steams, which are Spring Framework and Node.js.
Those have their own advantages.

I want to focus on Node.js and Nest.js at this time.

Before Nest.js came out to the world, Node.js was already known for below pros
1.  Lightweight, fast
2. Single-threaded -> low memory utilization


3. Great for I/O tasks

However, it  also has cons below
1. Lack of strict type checking can lead to runtime problems
2. too free architectures for teams and cooperation project.

THAT IS WHY NEST.JS COMES OUT TO THE WORLD
1. Solve the Main problem of Architecture
2. Allow Highly testable, scalable, loosely coupled, and easily maintainable application.


3. Installation

- Node.js installation

https://nodejs.org/en/

$ node -v // v14.17.6

$ npm -v // 7.20.3

- Nest.js installation using npm

$ npm i -g @nestjs/cli // install nest using Node Package Management

$ nest -version // 8.1.1

$ nest new sample-nest-project // create a project named "sample-nest-project"

- terminal log

version checks and create a project

- project navigator

initial files

- run nest.js project

$ npm run start:dev

- check browser

Hello World!