GithubHelp home page GithubHelp logo

nest-template's Introduction

Nest Logo

Description

Nest.js custom template with some default features.

Installation

$ pnpm install

Running the app

# development watch mode
$ pnpm run dev

# production mode
$ pnpm run start:prod

Test

# unit tests
$ pnpm run test

# e2e tests
$ pnpm run test:e2e

# test coverage
$ pnpm run test:cov

Commands

# create API
$ pnpm run g <API-NAME>

Features

  • Server dev tự động theo dõi sự thay đổi của code và restart (sử dụng swc để x20 lần tốc độ build).

  • Lệnh rút gọn để tạo mới API có sẵn input validate.

  • API nhận tất cả các method (sử dụng build-in decorator @all).

  • Global prefix cho toàn bộ controller (host/v1/path).

  • Các giá trị của env sẽ động tuỳ theo NODE_ENV.

  • Các giá trị constant dùng chung cho toàn bộ env.

  • unit test case cho service.

  • color log

  • Serve static at /public/*

  • Automatic logging request

  • Set cors allow all origin

  • khi sv sập thì trả về 500 thay vì đứt ngang

  • api 404

  • Service hash salt password

  • khai báo midleware

  • tinh giản khai báo controller api

  • khai báo nested controller api

  • tách riêng module test ra

  • import @/ thay cho src/

  • Tạo sẵn res.ok và res.err.

  • i18n: https://nestjs-i18n.com

  • upload file: https://docs.nestjs.com/techniques/file-upload

  • rate limit: https://docs.nestjs.com/security/rate-limiting

  • req allParams và nhận dto validator

  • req err nhận i18n tự động

  • mã gốc của i18n trong res

  • dto validate i18n

  • xử lý cat lỗi dto

  • xử lý các lỗi i18n

  • xoá lỗi ERROR [I18nService] Translation "VALIDATOR.IS_EMAIL" in "vn" does not exist.

  • cronjob: https://docs.nestjs.com/techniques/task-scheduling

Incomming features

  • queue
  • mongo, postgre
  • munti db connect
  • ghi log vào ES
  • e2e test + case cho api, core, ...
  • pm2

Stay in touch

License

MIT licensed.

nest-template's People

Contributors

nguyenleminhdev avatar

Watchers

 avatar

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.