/Nest-Starter

:tiger: A boilerplate for API Server with Node.js, NestJS, and Mongoose on Webpack.

Primary LanguageTypeScriptMIT LicenseMIT

Nest Starter

Getting Started

Follow steps to execute this boilerplate.

  1. Clone this boilerplate
$ git clone --depth 1 https://github.com/Shyam-Chen/Nest-Starter.git <PROJECT_NAME>
$ cd <PROJECT_NAME>
  1. Install dependencies
$ npm install
  1. Start a development server
$ yarn serve
  1. Produce a production-ready bundle
$ yarn build
  1. Lint and fix files
$ yarn lint
  1. Run unit tests
$ yarn unit
  1. Run end-to-end tests
$ yarn e2e

Examples

Directory Structure

.
├── src
   ├── core
      └── ...
   ├── <FEATURE> -> feature module
      ├── __tests__
         ├── <FEATURE>.controller.spec.ts
         ├── <FEATURE>.resolver.spec.ts
         ├── <FEATURE>.collection.spec.ts
         ├── <FEATURE>.table.spec.ts
         ├── <FEATURE>.service.spec.ts
         ├── <FEATURE>.rest.e2e-spec.ts
         └── <FEATURE>.graphql.e2e-spec.ts
      ├── <FEATURE>.controller.ts -> rest controller
      ├── <FEATURE>.resolver.ts -> graphql resolver
      ├── <FEATURE>.collection.ts -> mongodb odm
      ├── <FEATURE>.table.ts -> postgresql orm
      ├── <FEATURE>.service.ts -> provider
      └── <FEATURE>.module.ts
   ├── <GROUP> -> module group
      └── <FEATURE> -> feature module
          ├── __tests__
             ├── <FEATURE>.controller.spec.ts
             ├── <FEATURE>.resolver.spec.ts
             ├── <FEATURE>.collection.spec.ts
             ├── <FEATURE>.table.spec.ts
             ├── <FEATURE>.service.spec.ts
             ├── <FEATURE>.rest.e2e-spec.ts
             └── <FEATURE>.graphql.e2e-spec.ts
          ├── <FEATURE>.controller.ts -> rest controller
          ├── <FEATURE>.resolver.ts -> graphql resolver
          ├── <FEATURE>.collection.ts -> mongodb odm
          ├── <FEATURE>.table.ts -> postgresql orm
          ├── <FEATURE>.service.ts -> provider
          └── <FEATURE>.module.ts
   ├── shared
      └── ...
   ├── app.module.ts
   └── main.ts
├── .editorconfig
├── .eslintrc
├── .gitignore
├── .prettierrc
├── circle.yml
├── docker-compose.yml
├── Dockerfile
├── env.js
├── jest.config.js
├── LICENSE
├── package-lock.json
├── package.json
├── README.md
├── tsconfig.json
└── webpack.config.js

Microservices

Microservice architecture – a variant of the service-oriented architecture structural style – arranges an application as a collection of loosely coupled services. In a microservices architecture, services are fine-grained and the protocols are lightweight.

See Server-side Micro-Fullstack for instructions on how to create microservices from source code.