1515
1616# ACK NestJs Boilerplate 🔥 🚀
1717
18- > Amazon web service will be the cloud provider. This is why this project is focused on AWS features.
18+ > This repo will representative of authentication service and authorization service
1919
2020[ ACK NestJs] [ ack ] is a [ Http NestJs v9.x] [ ref-nestjs ] boilerplate. Best uses for backend service.
2121
2222* You can [ request feature] [ ack-issues ] or [ report bug] [ ack-issues ] with following this link*
2323
2424## Other Repo
2525
26- * [ Mongoose Mini Version] [ ack-mongoose ] : Mini version
27- * [ Typeorm Integration] [ ack-typeorm ] : Typeorm integration
28- * [ Kafka Integration] [ ack-kafka ] : Apache Kafka integration
26+ * [ Mini Version] [ ack-mongoose ] : Mini version
27+ * [ Typeorm Integration] [ ack-typeorm ] : Typeorm integration ` (Outdated) `
28+ * [ Kafka Integration] [ ack-kafka ] : Hybrid Between HTTP and Microservice ( Apache Kafka Integration)
2929
3030## Table of contents
3131
5656
5757## Important
5858
59- > If you want to implement ` database transactions ` , you must run MongoDB as a ` replication set ` .
60-
61- If you change the environment value of ` APP_ENV ` to ` production ` , that will trigger.
62-
63- 1 . CorsMiddleware will implement ` src/configs/middleware.config.ts ` .Otherwise is ` * ` .
64- 2 . Documentation will ` disable ` .
59+ * The features will replated with AWS Features
60+ * If you want to implement ` database transactions ` , you must run MongoDB as a ` replication set ` .
61+ * If you change the environment value of ` APP_ENV ` to ` production ` , that will trigger.
62+ 1 . CorsMiddleware will implement ` src/configs/middleware.config.ts ` .
63+ 2 . Documentation will ` disable ` .
6564
6665## Next Todo
6766
6867Next development
6968
70- * [x] Implement Repository Design Pattern / Data Access Object Design Pattern
71- * [x] Swagger for API Documentation
72- * [x] Mongo Repository soft delete
73- * [x] Make it simple
74- * [x] Encrypt jwt payload
75- * [x] Optimize Unit Testing
76- * [x] Make serverless separate repo
77- * [x] Optimize Swagger
78- * [x] Remove enum endpoint
79- * [x] Permission group fixed
80- * [x] Reduce the payload of access token
81- * [x] Update authorization mechanism, permission token on ` x-permission-token `
82- * [x] Update package, cors setting, check all interfaces, husky trigger switch to on and check test
83- * [x] AuthApiKey mechanism
84- * [x] AuthApi Controller
85- * [x] AuthApi Get, Active, Inactive Endpoint
86- * [x] AuthApi Create (Random Key), and Reset Secret Endpoint
87- * [x] AuthApi Controller Test E2E
88- * [x] Fix automation testing
89- * [x] Pagination move from decorator to service pagination -> make pipe transformer -> wrap into group decorator ResponsePaging
90- * [x] Check Swagger for pagination
91- * [x] ApiKey add startDate and endDate
92- * [x] Make docker port expose be difference with port app
69+ * Validation guard change to pipe
9370* [ ] SSO
9471 * [ ] Google
9572 * [ ] Apple
@@ -122,28 +99,29 @@ Describes which version.
12299* Component based folder structure
123100* Repository Design Pattern or Data Access Layer Design Pattern
124101* Support Microservice Architecture, Serverless Architecture, Clean Architecture, and/or Hexagonal Architecture
102+ * Follow Community Guide Line
125103* Follow The Twelve-Factor App
126104* Adopt SOLID and KISS principle
127105
128106## Features
129107
108+ ### Main Features
109+
130110* NestJs v9.x 🥳
131111* Typescript 🚀
132112* Production ready 🔥
133113* Repository Design Pattern
134114* Swagger included
135- * Authentication and authorization (` JWT ` , ` API Key ` ) 💪
136- * Role management system
137- * Storage integration with ` AwsS3 `
138- * Upload file ` single ` and ` multipart ` to AwsS3
115+ * Authentication (` Access Token ` , ` Refresh Token ` , ` API Key ` )
116+ * Authorization, Role and Permission Management (` PermissionToken ` )
139117* Support multi-language ` i18n ` 🗣
140118* Request validation with ` class-validation `
141119* Serialization with ` class-transformer `
142120* Url Versioning
143121* Server Side Pagination, there have 3 of types
144122* Import and export data with excel by using ` decorator `
145123
146- ## Database
124+ ### Database
147125
148126* MongoDB integrate by using [ mongoose] [ ref-mongoose ] 🎉
149127* Multi Database
@@ -171,6 +149,11 @@ Describes which version.
171149* Setting from database 🗿
172150* Maintenance mode on / off from database 🐤
173151
152+ ### Third Party Integration
153+
154+ * Storage integration with ` AwsS3 `
155+ * Upload file ` single ` and ` multipart ` to AwsS3
156+
174157### Others
175158
176159* Support Docker Installation
@@ -215,7 +198,8 @@ Full structure of module
215198 ├── pipes
216199 ├── repository
217200 ├── entities // database entities
218- └── repositories // database repositories
201+ ├── repositories // database repositories
202+ └── module1.repository.module.ts
219203 ├── serializations // response serialization
220204 ├── services
221205 ├── tasks // task for cron job
@@ -252,9 +236,11 @@ export interface IResponseMetadata {
252236Default response for the response
253237
254238``` ts
255- export interface IResponse {
239+ export class ResponseDefaultSerialization {
240+ statusCode: number ;
241+ message: string ;
256242 metadata? : IResponseMetadata ;
257- [ key : string ] : any ;
243+ data ? : Record < string , any > ;
258244}
259245```
260246
@@ -263,7 +249,9 @@ export interface IResponse {
263249Default response for pagination.
264250
265251``` ts
266- export interface IResponsePaging {
252+ export class ResponsePagingSerialization {
253+ statusCode: number ;
254+ message: string ;
267255 totalData: number ;
268256 totalPage? : number ;
269257 currentPage? : number ;
@@ -301,8 +289,6 @@ The recommended version is the LTS version for every tool and package.
3012892 . [ MongoDB] [ ref-mongodb ]
3022903 . [ Yarn] [ ref-yarn ]
3032914 . [ Git] [ ref-git ]
304- 5 . [ Docker] [ ref-docker ]
305- 6 . [ Docker-Compose] [ ref-dockercompose ]
306292
307293### Clone Repo
308294
@@ -390,6 +376,13 @@ yarn start:dev
390376
391377# ## Run Project with Docker
392378
379+ For docker installation, we need more tools to be installed in our instance.
380+
381+ 1. [Docker][ref-docker]
382+ 2. [Docker-Compose][ref-dockercompose]
383+
384+ Then run
385+
393386` ` ` bash
394387docker-compose up -d
395388` ` `
0 commit comments