Skip to content

Commit 880be0d

Browse files
authored
Merge branch 'Onix-Systems:master' into feature/many-roles
2 parents 526f0b1 + 4a5065d commit 880be0d

File tree

3 files changed

+49
-17
lines changed

3 files changed

+49
-17
lines changed

README.md

Lines changed: 47 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,32 @@ This generator will help you to build your own Nest.JS Mongodb/MySQL API using T
3939
- jwt authentication
4040
- passport google 2.0 strategy
4141

42+
### Roles
43+
For now, we are implement only few roles: `user` and `admin`
44+
45+
Usage example:
46+
47+
```typescript
48+
@Auth('admin', 'user')
49+
```
50+
or
51+
```typescript
52+
@Auth(RolesEnum.ADMIN)
53+
```
54+
55+
### Serialization
56+
Implementing `@Serialize` decorator will start process before objects are returned in a network response
57+
Example:
58+
59+
```typescript
60+
@Serialize(UserResponseDto)
61+
```
62+
use Exclude decorator to exclude properties from serialization
63+
```typescript
64+
@Exclude()
65+
password: string = '';
66+
```
67+
4268
### Session Storage
4369

4470
- MongoDB
@@ -49,17 +75,13 @@ This generator will help you to build your own Nest.JS Mongodb/MySQL API using T
4975

5076
- Nodemailer
5177

52-
### Integration testing
53-
54-
- mocha
55-
- chai
56-
- supertest
57-
5878
## Requirements
5979

6080
- node >= 14
6181
- npm >= 7
6282
- mongodb >= 4.0
83+
- redis >= 4.0
84+
- mysql >= 2.0
6385
- typescript >= 4.0.3
6486

6587
## Installation
@@ -77,25 +99,29 @@ Then generate your new project:
7799
yo nest-js-boilerplate
78100
```
79101

80-
Example App Skeleton (for Mongo + JWT + WS)
102+
Example App Skeleton (for Mongo + JWT)
81103

82104
```bash
83-
├── README.md
84-
├── docker-compose.yml
85-
├── index.js
86-
├── nest-cli.json
87-
├── package.json
105+
├── docker
106+
│ └── App.Dockerfile
88107
├── src
89108
│ ├── constants
90109
│ │ └── common.constants.ts
91110
│ ├── decorators
92111
│ │ ├── auth-bearer.decorator.ts
112+
│ │ ├── auth.decorator.ts
93113
│ │ ├── roles.decorator.ts
94114
│ │ └── serialization.decorator.ts
95115
│ ├── exceptions
96116
│ │ └── validation.exceptions.ts
97117
│ ├── filters
98118
│ │ ├── all-exceptions.filter.ts
119+
│ │ ├── bad-request-exception.filter.ts
120+
│ │ ├── forbidden-exception.filter.ts
121+
│ │ ├── index.ts
122+
│ │ ├── not-found-exception.filter.ts
123+
│ │ ├── unauthorized-exception.filter.ts
124+
│ │ ├── validation-exceptions.filter.ts
99125
│ │ └── ws-exceptions.filter.ts
100126
│ ├── guards
101127
│ │ ├── jwt-access.guard.ts
@@ -111,8 +137,6 @@ Example App Skeleton (for Mongo + JWT + WS)
111137
│ │ ├── paginatedEntity.interface.ts
112138
│ │ └── pagination-params.interface.ts
113139
│ ├── main.ts
114-
│ ├── pipes
115-
│ │ └── parse-object-id.pipe.ts
116140
│ ├── modules
117141
│ │ ├── app
118142
│ │ │ ├── app.controller.ts
@@ -162,11 +186,19 @@ Example App Skeleton (for Mongo + JWT + WS)
162186
│ │ │ ├── users.service.spec.ts
163187
│ │ │ └── users.service.ts
164188
│ │ └── v1.module.ts
189+
│ ├── pipes
190+
│ │ └── parse-object-id.pipe.ts
165191
│ └── templates
166192
│ └── verify-password.hbs
167193
├── tsconfig.build.json
168194
├── tsconfig.json
169-
└── typedoc.json
195+
├── typedoc.json
196+
├── index.js
197+
├── nest-cli.json
198+
├── package-lock.json
199+
├── package.json
200+
├── docker-compose.yml
201+
└──README.md
170202

171203
```
172204

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "generator-nest-js-boilerplate",
3-
"version": "2.14.0",
3+
"version": "2.20.0",
44
"description": "This generator will help you to build your own Nest.js Mongodb API using TypeScript 4",
55
"author": "onix-systems",
66
"license": "MIT",

0 commit comments

Comments
 (0)