Skip to content

Commit b66e5fd

Browse files
Merge pull request #244 from andrechristikan/development
Development
2 parents a05b4c8 + 2611734 commit b66e5fd

File tree

10 files changed

+901
-820
lines changed

10 files changed

+901
-820
lines changed

.github/workflows/stale.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
pull-requests: write
1212

1313
steps:
14-
- uses: actions/stale@v5
14+
- uses: actions/stale@v6
1515
with:
1616
days-before-issue-stale: 7
1717
days-before-issue-close: 7

README.md

Lines changed: 123 additions & 95 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,33 @@
1515

1616
# ACK NestJs Boilerplate Mongoose 🔥 🚀
1717

18-
ack-nestjs-mongoose-kafka is Hybrid NestJs Application. [NestJs Http][ref-nestjs] and [NestJs Microservice](ref-nestjsmicroservice).
18+
ack-nestjs-mongoose-kafka is Hybrid NestJs Application. [NestJs Http][ref-nestjs] and [NestJs Microservice][ref-nestjsmicroservice].
1919

2020
*You can [Request Feature][ack-issues] or [Report Bug][ack-issues] with following this link*
2121

22+
## Table of contents
23+
24+
* [Important](#important)
25+
* [Next Todo](#next-todo)
26+
* [Build With](#build-with)
27+
* [Objective](#objective)
28+
* [Features](#features)
29+
* [Prerequisites](#prerequisites)
30+
* [Getting Started](#getting-started)
31+
* [Clone Repo](#clone-repo)
32+
* [Install Dependencies](#install-dependencies)
33+
* [Create environment](#create-environment)
34+
* [Database Migration](#database-migration)
35+
* [Test](#test)
36+
* [Run Project](#run-project)
37+
* [Run Project with Docker](#run-project-with-docker)
38+
* [API Reference](#api-reference)
39+
* [Environment](#environment)
40+
* [Api Key Encryption](#api-key-encryption)
41+
* [Adjust Mongoose Setting](#adjust-mongoose-setting)
42+
* [License](#license)
43+
* [Contact](#contact)
44+
2245
## Important
2346

2447
> ack-nestjs-mongoose-kafka still on trial and error phase and the test will base on real projects or cases. So there will be (always) have new update and new features.
@@ -32,20 +55,20 @@ If you change env value of `APP_ENV` to `production` that will trigger
3255

3356
Next development
3457

35-
- [x] Implement Repository Design Pattern / Data Access Object Design Pattern
36-
- [x] Swagger for API Documentation
37-
- [x] Support Serverless
38-
- [x] Mongo Repository soft delete
39-
- [x] Make it simple
40-
- [ ] Optimize Swagger
41-
- [ ] Add Relational Database Repository, ex: mysql, postgres
42-
- [ ] Update Documentation, include an diagram for easier comprehension
43-
- [ ] Export to excel and Import from excel add options to background process
44-
- [ ] AuthApi Controller
45-
- [ ] OAuth2 Client Credentials
46-
- [ ] Kafka Module Security
47-
- [ ] Optimize Kafka Module
48-
- [ ] Maybe will adopt [CQRS](https://docs.nestjs.com/recipes/cqrs)
58+
* [x] Implement Repository Design Pattern / Data Access Object Design Pattern
59+
* [x] Swagger for API Documentation
60+
* [x] Support Serverless
61+
* [x] Mongo Repository soft delete
62+
* [x] Make it simple
63+
* [ ] Optimize Swagger
64+
* [ ] Add Relational Database Repository, ex: mysql, postgres
65+
* [ ] Update Documentation, include an diagram for easier comprehension
66+
* [ ] Export to excel and Import from excel add options to background process
67+
* [ ] AuthApi Controller
68+
* [ ] OAuth2 Client Credentials
69+
* [ ] Kafka Module Security
70+
* [ ] Optimize Kafka Module
71+
* [ ] Maybe will adopt [CQRS][ref-nestjs-cqrs]
4972

5073
## Build with
5174

@@ -69,110 +92,110 @@ Describes which version .
6992

7093
## Objective
7194

72-
- Easy to maintenance
73-
- NestJs Habit
74-
- Component based folder structure
75-
- Repository Design Pattern or Data Access Layer Design Pattern
76-
- Support Microservice Architecture, Clean Architecture, and/or Hexagonal Architecture
77-
- Follow The Twelve-Factor App
78-
- Adopt SOLID and KISS principle
95+
* Easy to maintenance
96+
* NestJs Habit
97+
* Component based folder structure
98+
* Repository Design Pattern or Data Access Layer Design Pattern
99+
* Support Microservice Architecture, Clean Architecture, and/or Hexagonal Architecture
100+
* Follow The Twelve-Factor App
101+
* Adopt SOLID and KISS principle
79102

80103
## Features
81104

82-
- NestJs v9.x 🥳
83-
- Typescript 🚀
84-
- Production ready 🔥
85-
- Support serverless
86-
- Swagger included
87-
- Authentication and authorization (`JWT`, `API Key`) 💪
88-
- Role management system
89-
- MongoDB integrate by using `mongoose` 🎉
90-
- Support MongoDB Transaction
91-
- Support MongoDB Soft Delete
92-
- Database Migration with `NestJs-Command`
93-
- Storage integration with `AwsS3`
94-
- Upload file `single` and `multipart` to AwsS3
95-
- Support multi-language `i18n` 🗣
96-
- Request validation with `class-validation`
97-
- Serialization with `class-transformer`
98-
- Url Versioning
99-
- Server Side Pagination, there have 3 of types
100-
- Import and export data with excel by using `decorator`
105+
* NestJs v9.x 🥳
106+
* Typescript 🚀
107+
* Production ready 🔥
108+
* Support serverless
109+
* Swagger included
110+
* Authentication and authorization (`JWT`, `API Key`) 💪
111+
* Role management system
112+
* MongoDB integrate by using `mongoose` 🎉
113+
* Support MongoDB Transaction
114+
* Support MongoDB Soft Delete
115+
* Database Migration with `NestJs-Command`
116+
* Storage integration with `AwsS3`
117+
* Upload file `single` and `multipart` to AwsS3
118+
* Support multi-language `i18n` 🗣
119+
* Request validation with `class-validation`
120+
* Serialization with `class-transformer`
121+
* Url Versioning
122+
* Server Side Pagination, there have 3 of types
123+
* Import and export data with excel by using `decorator`
101124

102125
### Logger and Debugger
103126

104-
- Logger `Morgan` and Debugger `Winston` 📝
127+
* Logger `Morgan` and Debugger `Winston` 📝
105128

106129
### Security
107130

108-
- Apply `helmet`, `cors`, and `rate-limit`
109-
- Timeout awareness and can override ⌛️
110-
- User agent awareness, and can whitelist user agent
131+
* Apply `helmet`, `cors`, and `rate-limit`
132+
* Timeout awareness and can override ⌛️
133+
* User agent awareness, and can whitelist user agent
111134

112135
### Setting
113136

114-
- Support environment file
115-
- Centralize configuration 🤖
116-
- Centralize response
117-
- Centralize exception filter
118-
- Setting from database 🗿
119-
- Maintenance mode on / off from database 🐤
137+
* Support environment file
138+
* Centralize configuration 🤖
139+
* Centralize response
140+
* Centralize exception filter
141+
* Setting from database 🗿
142+
* Maintenance mode on / off from database 🐤
120143

121144
### Others
122145

123-
- Support Docker Installation
124-
- Support CI/CD with Github Action or Jenkins
125-
- Husky GitHook For Check Source Code, and Run Test Before Commit 🐶
126-
- Linter with EsLint for Typescript
146+
* Support Docker Installation
147+
* Support CI/CD with Github Action or Jenkins
148+
* Husky GitHook For Check Source Code, and Run Test Before Commit 🐶
149+
* Linter with EsLint for Typescript
127150

128151
## Prerequisites
129152

130153
We assume that everyone who comes here is **`programmer with intermediate knowledge`** and we also need to understand more before we begin in order to reduce the knowledge gap.
131154

132-
1. Understand [NestJs Fundamental](http://nestjs.com), Main Framework. NodeJs Framework with support fully TypeScript.
133-
2. Understand[Typescript Fundamental](ref-typescript), Programming Language. It will help us to write and read the code.
134-
3. Understand [ExpressJs Fundamental](ref-nodejs), NodeJs Base Framework. It will help us in understanding how the NestJs Framework works.
135-
4. Understand what NoSql is and how it works as a database, especially [MongoDB.](ref-mongodb)
155+
1. Understand [NestJs Fundamental][ref-nestjs], Main Framework. NodeJs Framework with support fully TypeScript.
156+
2. Understand[Typescript Fundamental][ref-typescript], Programming Language. It will help us to write and read the code.
157+
3. Understand [ExpressJs Fundamental][ref-nodejs], NodeJs Base Framework. It will help us in understanding how the NestJs Framework works.
158+
4. Understand what NoSql is and how it works as a database, especially [MongoDB.][ref-mongodb]
136159
5. Understand Repository Design Pattern or Data Access Object Design Pattern. It will help us to read the source code
137160
6. Understand The SOLID Principle and KISS Principle for better write the code.
138161
7. Understand Apache Kafka. It will help us to build the application.
139162
8. Optional. Understand Microservice Architecture Clean Architecture, and/or Hexagonal Architecture.
140-
9. Optional. Understand [The Twelve Factor Apps](ref-12factor)
141-
10. Optional. Understand [Docker](ref-docker) that can help you to run the project
163+
9. Optional. Understand [The Twelve Factor Apps][ref-12factor]
164+
10. Optional. Understand [Docker][ref-docker] that can help you to run the project
142165

143-
### Getting Started
166+
## Getting Started
144167

145168
Before we start, we need to install some packages and tools.
146169
Recommend version is LTS Version for every tool and package
147170

148171
> Make sure check that tools has been installed successfully.
149172
150-
1. [NodeJs](ref-nodejs)
151-
2. [MongoDB as Replication](ref-mongodb)
152-
3. [Yarn](ref-yarn)
153-
4. [Git](ref-git)
154-
5. [Docker](ref-docker)
155-
6. [Docker-Compose](ref-dockercompose)
156-
7. [Serverless](ref-serverless)
157-
8. [Kafka](ref-kafka)
173+
1. [NodeJs][ref-nodejs]
174+
2. [MongoDB as Replication][ref-mongodb]
175+
3. [Yarn][ref-yarn]
176+
4. [Git][ref-git]
177+
5. [Docker][ref-docker]
178+
6. [Docker-Compose][ref-dockercompose]
179+
7. [Serverless][ref-serverless]
180+
8. [Kafka][ref-kafka]
158181

159-
#### Clone Repo
182+
### Clone Repo
160183

161184
Clone ack-nestjs-mongoose with git.
162185

163186
```bash
164187
git clone https://github.com/andrechristikan/ack-nestjs-mongoose.git
165188
```
166189

167-
#### Install Dependencies
190+
### Install Dependencies
168191

169192
This project need some dependencies. Let's go install it.
170193

171194
```bash
172195
yarn install
173196
```
174197

175-
#### Create environment
198+
### Create environment
176199

177200
Make your own environment with copy from `.env.example` and edit some value.
178201

@@ -182,11 +205,11 @@ cp .env.example .env
182205

183206
[Jump to details](#environment)
184207

185-
#### Database Migration
208+
### Database Migration
186209

187210
> If you want to to implement `transaction`, you must to install `Mongodb Replication Set`.
188211
189-
Database migration ack-nestjs-mongoose used [NestJs-Command](ref-nestjscommand)
212+
Database migration ack-nestjs-mongoose used [NestJs-Command][ref-nestjscommand]
190213

191214
For migrate
192215

@@ -200,7 +223,7 @@ For rollback
200223
yarn rollback
201224
```
202225

203-
#### Kafka topics
226+
### Kafka topics
204227

205228
Create kafka topics
206229

@@ -224,27 +247,27 @@ ack-nestjs-mongoose provide 3 automation testing `unit testing`, `integration te
224247
yarn test
225248
```
226249

227-
#### Specific test
250+
For specific test use this
228251

229-
For unit testing
252+
* Unit testing
230253

231-
```bash
232-
yarn test:unit
233-
```
254+
```bash
255+
yarn test:unit
256+
```
234257

235-
For integration testing
258+
* Integration testing
236259

237-
```bash
238-
yarn test:integration
239-
```
260+
```bash
261+
yarn test:integration
262+
```
240263

241-
For E2E testing
264+
* E2E testing
242265

243-
```bash
244-
yarn test:e2e
245-
```
266+
```bash
267+
yarn test:e2e
268+
```
246269

247-
#### Run Project
270+
### Run Project
248271

249272
> If mongodb version < 5, [Read this section for adjust mongoose setting.](#adjust-mongoose-setting)
250273

@@ -256,12 +279,16 @@ Now we can run ack-nestjs-mongoose and use all of features.
256279
yarn start:dev
257280
```
258281

259-
#### Run Project with Docker
282+
### Run Project with Docker
260283

261284
```bash
262285
docker-compose up -d
263286
```
264287

288+
## API Reference
289+
290+
We have already provided the API reference. To visit, [click here][api-reference-docs].
291+
265292
## Environment
266293

267294
Detail information about the environment
@@ -482,21 +509,18 @@ Distributed under [MIT licensed][license].
482509
[author-github]: https://github.com/andrechristikan
483510

484511
<!-- Repo LINKS -->
485-
[ack-repo]: https://github.com/andrechristikan/ack-nestjs-mongoose-kafka
486-
[ack-e2e]: /test/e2e/
487512
[ack-issues]: https://github.com/andrechristikan/ack-nestjs-mongoose-kafka/issues
488513
[ack-stars]: https://github.com/andrechristikan/ack-nestjs-mongoose-kafka/stargazers
489514
[ack-forks]: https://github.com/andrechristikan/ack-nestjs-mongoose-kafka/network/members
490515
[ack-contributors]: https://github.com/andrechristikan/ack-nestjs-mongoose-kafka/graphs/contributors
491-
[ack-history]: https://github.com/andrechristikan/ack-nestjs-mongoose-kafka/commits/main
492516

493517
<!-- license -->
494518
[license]: LICENSE.md
495519

496520
<!-- Reference -->
497521
[ref-nestjs]: http://nestjs.com
498522
[ref-nestjsmicroservice]: https://docs.nestjs.com/microservices/basics
499-
[ref-mongoose]: https://mongoosejs.com/
523+
[ref-nestjs-cqrs]: https://docs.nestjs.com/recipes/cqrs
500524
[ref-mongodb]: https://docs.mongodb.com/
501525
[ref-nodejs]: https://nodejs.org/
502526
[ref-typescript]: https://www.typescriptlang.org/
@@ -509,3 +533,7 @@ Distributed under [MIT licensed][license].
509533
[ref-kafka]: https://kafka.apache.org/documentation
510534
[ref-jwt]: https://jwt.io
511535
[ref-jest]: https://jestjs.io/docs/getting-started
536+
[ref-git]: https://git-scm.com
537+
538+
<!-- API Reference -->
539+
[api-reference-docs]: https://lgtw8uvhvd.execute-api.ap-southeast-3.amazonaws.com/development/docs

0 commit comments

Comments
 (0)