-
Notifications
You must be signed in to change notification settings - Fork 444
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(doc): added architecture documentation, This connected to #9 issue
- Loading branch information
1 parent
53c4111
commit 35a8d9d
Showing
15 changed files
with
171 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,20 @@ | ||
/* tslint:disable */ | ||
module.exports = { | ||
title: 'Awesome nest boilerplate 🎉', | ||
description: `An ultimate and awesome nodejs boilerplate wrote in typescript`, | ||
base: process.env.DEPLOY_ENV === 'gh-pages' ? '/awesome-nest-boilerplate/': '/', | ||
themeConfig: { | ||
sidebar: [ | ||
['/', 'Introduction'], | ||
'/docs/development', | ||
// '/docs/architecture', | ||
// '/docs/tech', | ||
// '/docs/routing', | ||
// '/docs/state', | ||
// '/docs/linting', | ||
// '/docs/editors', | ||
// '/docs/production', | ||
// '/docs/troubleshooting', | ||
], | ||
}, | ||
title: 'Awesome nest boilerplate 🎉', | ||
description: `An ultimate and awesome nodejs boilerplate wrote in typescript`, | ||
base: process.env.DEPLOY_ENV === 'gh-pages' ? '/awesome-nest-boilerplate/' : '/', | ||
themeConfig: { | ||
sidebar: [ | ||
['/', 'Introduction'], | ||
'/docs/development', | ||
'/docs/architecture', | ||
// '/docs/tech', | ||
// '/docs/routing', | ||
// '/docs/state', | ||
// '/docs/linting', | ||
// '/docs/editors', | ||
// '/docs/production', | ||
// '/docs/troubleshooting', | ||
], | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
# 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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
import { SetMetadata } from '@nestjs/common'; | ||
import { RoleType } from '../constants/role-type'; | ||
|
||
import { RoleType } from '../common/constants/role-type'; | ||
|
||
export const Roles = (...roles: RoleType[]) => SetMetadata('roles', roles); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters