# Architecture

- [Architecture](#architecture)
  - [`.vscode`](#vscode)
  - [`docs`](#docs)
  - [`.vuepress`](#vuepress)
  - [`src`](#src)
    - [`common`](#common)
    - [`decorators`](#decorators)
    - [`interceptors`](#interceptors)
    - [`exception-filters`](#exception-filters)
    - [`guards`](#guards)
    - [`interfaces`](#interfaces)
    - [`migrations`](#migrations)
    - [`providers`](#providers)
    - [`shared`](#shared)
    - [`modules`](#modules)
    - [`app.module.ts`](#appmodulets)
    - [`boilerplate.polyfill.ts`](#boilerplatepolyfillts)
    - [`snake-naming.strategy.ts`](#snake-namingstrategyts)
  - [`.*.env`](#env)
  - [`.eslintrc.json`](#eslintrcjson)
  - [`tslint.json`](#tslintjson)

## `.vscode`

Settings and extensions specific to this project, for Visual Studio Code. See [the editors doc](editors.md#visual-studio-code) for more.

## `docs`

You found me! :wink:

## `.vuepress`

Documentation config and destination folder See [VuePress doc](https://vuepress.vuejs.org) for more

## `src`

Where we keep all our source files.

### `common`

Where we keep common typescript files, e.g. constants and DTOs.

### `decorators`

This folder contains all global [decorators](https://www.typescriptlang.org/docs/handbook/decorators.html).

### `interceptors`

Where we are keep [interceptors](https://docs.nestjs.com/interceptors)

### `exception-filters`

In this folder you can find app level [exception-filters](https://docs.nestjs.com/exception-filters).

### `guards`

You can store all guards here

### `interfaces`

This folder contains typescript [interfaces](https://www.typescriptlang.org/docs/handbook/interfaces.html)

### `migrations`

Folder to store application migrations which will be generated by typeorm.

### `providers`

These are utility functions you may want to share between many files in your application. They will always be pure and never have side effects, meaning if you provide a function the same arguments, it will always return the same result.

### `shared`

Shared module with global singleton services.

### `modules`

Where all our NestJS modules lives. See [NestJS modules documentation](https://docs.nestjs.com/modules) for more.

### `app.module.ts`

The root application module.

### `boilerplate.polyfill.ts`

We extend built in classes so you can use helper function anywhere.

```typescript
const users: UserEntity[] = ...;

const userDtos = users.toDtos();
```

### `snake-naming.strategy.ts`

We are using snake naming strategy for typeorm, so when you will generate migration it automatically will set snake_case column name from entity fields.

## `.*.env`

Environment variables which will load before app start and will be stored in `process.env`, (*) is a env name (development, staging, production, ...)

## `.eslintrc.json`

Eslint configuration file, See [the eslint doc](https://eslint.org/) for more.

## `tslint.json`

Tslint configuration file, See [the tslint doc](https://palantir.github.io/tslint/) for more.
