Every NestJS Concept Explained

video

video-main

code

crud

10 concept

  1. application

    1. http server → NestFactory.create()

    2. microservice application → NestFactory.createMicroservice()

    3. standalone application → NestFactory.createApplicationContext()

  2. modules → @Module({})

    1. root module

      1. order (cart,payment)

      2. product

        1. config
  3. Decorator → fn → Class,Method

  4. Controllers → receive req and return response

    1. @ Controller(““) → root path

    2. @ GET(““) → http verb(get,post,put,delete) → sub root

    3. methods → hello(){} → can add methods to handle incoming req and return res

  5. Provider → class that can be injected in other classes as dependency

    1. all logic is written here and is used in controllers
  6. req → middlewares → guards → Interceptors → pipes → controller’s route handler → Interceptors → exception filters→ res

  7. flow

    1. app.module.ts → feature.module.ts → feature.service.ts(provider→actual logic) → feature.controller.ts(return res→endpoint,http req type(get,post,put,delete))