Skip to content

Files

Latest commit

 

History

History
117 lines (94 loc) · 2.13 KB

DEVELOPER.md

File metadata and controls

117 lines (94 loc) · 2.13 KB

Developer guide

Requirements

  • NodeJs: 8+

Install dependencies

Run npm i to install project dependencies

Development server

Run npm run dev for a dev server.

Coding style

Quotes

Good

const hello = "world";

Bad

const hello = 'world';

Semicolon

Good

console.log("world");

Bad

console.log("world")

Tabs or spaces?

We use spaces. 4 spaces to be more specific.

Decorators

Good

export class HelloWorld {
    @Input()
    public value: string;
}

Bad

export class HelloWorld {
    @Input() public value: string;
}

Max line

Max line length is 140 caracters.

Good

export class HelloWorld {
    constructor(private serviceA: ServiceA,
                private serviceB: ServiceB,
                private serviceC: ServiceC,
                private serviceD: ServiceD) {}
}

Bad

export class HelloWorld {
     constructor(private serviceA: ServiceA, private serviceB: ServiceB, private serviceC: ServiceC, private serviceD: ServiceD) {}
}

Project structure

src
   guards
   interceptors
   modules
   pipes
   utils

Guards

This section contains all the global guards of the NestJs server.

Interceptors

This section contains all the global interceptors of the NestJs server.

Modules

This section contains all the modules of the NestJs server.

Each module can have a controller, a service and a model. All modules must define a NestJs module.

Pipes

This section contains all the global pipes of the NestJs server.

Utils

This section contains all the utils of the NestJs server.