Giter VIP home page Giter VIP logo

product-catalog-nestjs's Introduction

product-catalog-nestjs

Nest Logo

A progressive Node.js framework for building efficient and scalable server-side applications, heavily inspired by Angular.

NPM Version Package License Travis Coverage

Description

Nest framework TypeScript starter repository.

Installation

$ npm install

Running the app

# development
$ npm run start

# watch mode
$ npm run start:dev

# production mode
$ npm run start:prod

Test

# unit tests
$ npm run test

# e2e tests
$ npm run test:e2e

# test coverage
$ npm run test:cov

Language: TypeScript and pure JavaScript

Prerequisites: Please make sure that Node.js (>= 10.13.0) is installed on your operating system.

Setup:

  # To scaffold the project with the Nest CLI, run the following commands
  $ npm i -g @nestjs/cli
  
  # Creating a product-catalog project with the Nest CLI
  $ nest new product-catalog

The project directory will be created, node modules and a few other boilerplate files will be installed, and a src/ directory will be created and populated with several core files.

  src
    > products
    -app.controller.ts
    -app.module.ts
    -app.service.ts
    -main.ts

Core files

app.controller.ts: Basic controller sample with a single route. Controllers are responsible for handling incoming requests and returning responses to the client

app.module.ts: A module is a class annotated with a @Module() decorator. The @Module() decorator provides metadata that Nest makes use of to organize the application structure.

Services: This service will be responsible for data storage and retrieval, and is designed to be used by the ProductController, so it's a good candidate to be defined as a provider. Thus, we decorate the class with @Injectable().

main.ts: The entry file of the application which uses the core function NestFactory to create a Nest application instance. To create a Nest application instance, we use the core NestFactory class. NestFactory exposes a few static methods that allow creating an application instance. The create() method returns an application object, which fulfills the INestApplication interface

Provider: Providers are a fundamental concept in Nest. Many of the basic Nest classes may be treated as a provider โ€“ services, repositories, factories, helpers, and so on The main idea of a provider is that it can inject dependencies; this means objects can create various relationships with each other

app module

Don't forget to add Product module to the app module's import array

CRUD Operation using [Mongo DB]

install mongoose by running below command in your terminal in your project dir

npm install --save mongoose @nestjs/mongoose
npm install --save-dev @types/mongoose

product-catalog-nestjs's People

Contributors

dependabot[bot] avatar ishaileshmishra avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Forkers

dappcentertech

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.