Skip to content

admiral9200/Kaspa-Trade-Service

Repository files navigation

Nest Logo

A progressive Node.js framework for building efficient and scalable server-side applications.

NPM Version Package License NPM Downloads CircleCI Coverage Discord Backers on Open Collective Sponsors on Open Collective Support us

Description

Template for any service, using NestJS (Express wrapper framework)

Installation

$ npm install

Configuration

See the development.env file

Convention

This template uses class-validator you can read more about it here https://docs.nestjs.com/techniques/validation

Data Transfer Object (DTO) is an object that represents a Request data or a Response data. We have request DTO and response DTO. Request DTO is validated with class-validator, response DTO is just the interface of the data you return to the client, it is not validated, but it can be.

When creating any POST/PATCH request that has data in any controller, make sure to wrap it with DTO interface, NestJS will automatically validate it. exmaple:

@Body() body: MyExampleDto

See the example controller in Backend module.

Controller uses providers to aggregate business logic from different services, helpers, etc. A service aggregates repository data responses, other business logic and returns the data to the provider.

The provider must transform the data accordingly to the expected interface by the controller.

A repository gathers the data from the databases, this can be mongo, sql, elastic, etc..

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

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published