Skip to content

asyrul21/udemy-complete-nest

Repository files navigation

NestJS Complete Developer's Guide

This respository stores all the code exercises for Udemy Course NestJS the Complete Developer's Guide

Covers all NestJS Lectures, except that I did not deploy to Heroku.

Some notes

Global Install of Nest CLI

npm install -g @nestjs/cli

Dependency Installation

Core dependencies:

npm install @nestjs/common@7.6.17 @nestjs/core@7.6.17 @nestjs/platform-express@7.6.17 reflect-metadata@0.1.13 typescript@4.3.2

Additional Validation Libraries:

npm install class-validator class-transformer

Type ORM and Sqlite:

npm install @nestjs/typeorm typeorm sqlite3

Cookie Sessions:

npm install cookie-session @types/cookie-session

NestJS Config

npm install @nestjs/config

Cross Env

npm install cross-env

Running Skeleton App

# navigate to project dir
cd ./01-scratch

# run
npx ts-node-dev src/main.ts

PostGres Driver for Production

npm install pg

Running Nest Projects

Please see project's package.json

npm run start:dev

Nest CLI Notes

# Global install
npm install -g @nestjs/cli

# create project
nest new [name]
# nest new messages

# create module file
nest generate module [name]
# or
# nest g module computer
# nest generate module messages

nest generate service [name]
# nest g service [name]

# create controller file
nest generate controller messages/messages --flat

Request Flow

Request -> Middlewares -> Guards -> Interceptor -> Request Handler (Controller) -> Interceptor -> Response

Typescript

Setup and Installation

Global install

npm install -g typescript ts-node

Check

tsc --help

Commands

Compile TS file to JS

tsc index.ts # compiled to index.js

Running the File

node index.js

Combining tsc and node in one command:

ts-node index.ts # but will not create any js files

Parcel

npx parcel index.html

Project Dependency

Faker

npm install @faker-js/faker

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published