Skip to content

Commit 0e5f153

Browse files
chore: merge pull request #118 from vndevteam/develop
chore: merge develop into main
2 parents 0a50ba0 + 0fa757b commit 0e5f153

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+620
-168
lines changed

.env.docker

+26-3
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,18 @@
1+
##== Environment
12
NODE_ENV=development
2-
MODULES_SET=monolith
3-
APP_NAME="NestJS API"
3+
4+
##== Application
5+
APP_NAME="NestJS Boilerplate API"
46
APP_URL=http://localhost:3000
57
APP_PORT=3000
6-
APP_DEBUG=false
8+
APP_DEBUG=true
79
API_PREFIX=api
810
APP_FALLBACK_LANGUAGE=en
911
APP_LOG_LEVEL=debug
1012
APP_LOG_SERVICE=console
13+
APP_CORS_ORIGIN=http://localhost:3000,https://ngockhuong.com
1114

15+
##== Database
1216
DATABASE_TYPE=postgres
1317
DATABASE_HOST=db
1418
DATABASE_PORT=5432
@@ -23,3 +27,22 @@ DATABASE_REJECT_UNAUTHORIZED=false
2327
DATABASE_CA=
2428
DATABASE_KEY=
2529
DATABASE_CERT=
30+
31+
MAIL_HOST=maildev
32+
MAIL_PORT=1025
33+
MAIL_USER=
34+
MAIL_PASSWORD=
35+
MAIL_IGNORE_TLS=true
36+
MAIL_SECURE=false
37+
38+
MAIL_DEFAULT_NAME=Example
39+
40+
##== Authentication
41+
AUTH_JWT_SECRET=secret
42+
AUTH_JWT_TOKEN_EXPIRES_IN=1d
43+
AUTH_REFRESH_SECRET=secret_for_refresh
44+
AUTH_REFRESH_TOKEN_EXPIRES_IN=365d
45+
AUTH_FORGOT_SECRET=secret_for_forgot
46+
AUTH_FORGOT_TOKEN_EXPIRES_IN=30m
47+
AUTH_CONFIRM_EMAIL_SECRET=secret_for_confirm_email
48+
AUTH_CONFIRM_EMAIL_TOKEN_EXPIRES_IN=1d

.gitignore

+7-2
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,15 @@ lerna-debug.log*
3838

3939
# dotenv environment variable files
4040
.env
41-
.env.development.local
41+
.env.local
42+
.env.test
4243
.env.test.local
44+
.env.development
45+
.env.development.local
46+
.env.staging
47+
.env.staging.local
48+
.env.production
4349
.env.production.local
44-
.env.local
4550

4651
# temp directory
4752
.temp

docs/.vuepress/config/theme/en.config.mjs

+13-5
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,18 @@ const en = {
1212
text: 'Setup & Development',
1313
link: '/development.md',
1414
},
15+
{
16+
text: 'Technologies',
17+
link: '/technologies.md',
18+
},
1519
{
1620
text: 'Architecture',
1721
link: '/architecture.md',
1822
},
23+
{
24+
text: 'API',
25+
link: '/api.md',
26+
},
1927
{
2028
text: 'Database',
2129
link: '/database.md',
@@ -32,14 +40,14 @@ const en = {
3240
text: 'Deployment',
3341
link: '/deployment.md',
3442
},
35-
{
36-
text: 'Techniques',
37-
link: '/techniques.md',
38-
},
3943
{
4044
text: 'Troubleshooting',
4145
link: '/troubleshooting.md',
4246
},
47+
{
48+
text: 'FAQ',
49+
link: '/faq.md',
50+
},
4351
{
4452
text: 'Convention',
4553
children: [
@@ -48,7 +56,7 @@ const en = {
4856
'/conventions/clean-code-typescript.md',
4957
'/conventions/branch-conventions.md',
5058
'/conventions/commit-conventions.md',
51-
'/conventions/linting.md',
59+
'/conventions/linting-and-formatting.md',
5260
],
5361
},
5462
],

docs/README.md

+11-1
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,15 @@
22

33
This is a boilerplate for NestJS projects. It is a starting point for building a RESTful API with NestJS.
44

5+
## Detail Documentation
6+
57
- [Setup & Development](development.md)
68
- [Architecture](architecture.md)
79
- [Database](database.md)
810
- [Security](security.md)
911
- [Testing](testing.md)
1012
- [Deployment](deployment.md)
11-
- [Techniques](techniques.md)
13+
- [Technologies](technologies.md)
1214
- [Troubleshooting](troubleshooting.md)
1315
- Convention
1416
- [Naming cheatsheet](conventions/naming-cheatsheet.md)
@@ -17,3 +19,11 @@ This is a boilerplate for NestJS projects. It is a starting point for building a
1719
- [Branch conventions](conventions/branch-conventions.md)
1820
- [Commit conventions](conventions/commit-conventions.md)
1921
- [Linting & formatting](conventions/linting.md)
22+
23+
## Features
24+
25+
// TODO: Add features
26+
27+
## References
28+
29+
// TODO: Add references

docs/api.md

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# API Documentation
2+
3+
This section provides an overview of the API documentation for the project.
4+
5+
---
6+
7+
[[toc]]
8+
9+
## Endpoints
10+
11+
We use swagger to document the API endpoints. You can access the API documentation by visiting the `/api-docs` route in your browser.
12+
13+
For example, if your application is running on `http://localhost:3000`, you can access the API documentation at <http://localhost:3000/api-docs>.
14+
15+
## Authentication
16+
17+
## Error Handling

docs/conventions/branch-conventions.md

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Branch conventions
22

3+
---
4+
35
[[toc]]
46

57
## Code Flow Branches

docs/conventions/linting.md docs/conventions/linting-and-formatting.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Linting & formatting
1+
# Linting & Formatting
22

33
This project uses [Typescript Eslint](https://typescript-eslint.io/), and [Prettier](https://prettier.io/) to catch errors and avoid bike-shedding by enforcing a common code style.
44

docs/deployment.md

+4
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,10 @@ This document outlines the steps required to deploy the application to a product
4141
7. **Monitor the Application**:
4242
- Set up monitoring and alerting tools to keep track of the application's health and performance.
4343

44+
## CI/CD Pipeline
45+
46+
// TODO: Add details on setting up a CI/CD pipeline for automated deployments.
47+
4448
## Rollback Plan
4549

4650
In case of any issues, have a rollback plan ready:

docs/development.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ AUTH_CONFIRM_EMAIL_TOKEN_EXPIRES_IN=1d
120120
- `AUTH_CONFIRM_EMAIL_SECRET`: The email confirmation token secret key.
121121
- `AUTH_CONFIRM_EMAIL_TOKEN_EXPIRES_IN`: Email confirmation token expiration time. Should be short for security.
122122

123-
### Dev server
123+
### Running the project
124124

125125
```bash
126126
# Start the development server

docs/faq.md

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# FAQ
2+
3+
// TODO: Add FAQ

docs/techniques.md

-45
This file was deleted.

docs/technologies.md

+139
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,139 @@
1+
# Technologies
2+
3+
List of technologies (framework, dependencies and tools) used in the project.
4+
5+
---
6+
7+
[[toc]]
8+
9+
## Core Technologies
10+
11+
We utilize the following frameworks for our backend development to create scalable and maintainable server-side applications.
12+
13+
### Node.js
14+
15+
A JavaScript runtime built on Chrome's V8 JavaScript engine, enabling the building of fast and scalable server-side applications.
16+
17+
### NestJS
18+
19+
A progressive Node.js framework for building efficient and scalable server-side applications with a modular architecture.
20+
21+
## Frameworks and Libraries
22+
23+
### Express
24+
25+
A minimal and flexible Node.js web application framework that provides a robust set of features for web and mobile applications.
26+
27+
### TypeScript
28+
29+
A superset of JavaScript that adds static types, enhancing code reliability and maintainability.
30+
31+
## Database
32+
33+
### TypeORM
34+
35+
An Object-Relational Mapping (ORM) library for TypeScript and JavaScript that simplifies database interactions and provides a powerful query builder.
36+
37+
### PostgreSQL
38+
39+
A powerful, open-source object-relational database system known for its reliability, robustness, and performance.
40+
41+
## Authentication and Authorization
42+
43+
### JWT (jsonwebtoken)
44+
45+
A library for working with JSON Web Tokens, aiding in user authentication and authorization.
46+
47+
## Validation and Parsing
48+
49+
### class-validator
50+
51+
A library for input validation and sanitization based on decorators and metadata reflection.
52+
53+
### class-transformer
54+
55+
A library for object transformation and serialization using decorators and reflection.
56+
57+
## Logging and Monitoring
58+
59+
### Pino
60+
61+
A fast and feature-rich logging library for Node.js applications, providing high performance and low overhead.
62+
63+
## Testing
64+
65+
### Jest
66+
67+
A comprehensive testing framework for JavaScript, supporting unit, integration, and end-to-end testing.
68+
69+
### Supertest
70+
71+
A library for testing HTTP servers, allowing you to make requests and assert responses in your tests.
72+
73+
## Package Management
74+
75+
### PNPM
76+
77+
A fast, disk space-efficient package manager for JavaScript, improving the installation process and dependency management.
78+
79+
## Linting and Formatting
80+
81+
### ESLint
82+
83+
A pluggable linting utility for JavaScript and TypeScript, helping to identify and fix code quality issues.
84+
85+
### Prettier
86+
87+
An opinionated code formatter that enforces consistent style by parsing code and reprinting it with its own rules.
88+
89+
## Git Hooks and Commit Management
90+
91+
### Husky
92+
93+
A tool for managing Git hooks, allowing you to run scripts during various Git stages.
94+
95+
### Commitlint
96+
97+
A tool for linting commit messages, ensuring they adhere to a conventional format.
98+
99+
### Commitizen
100+
101+
A command-line tool for formatting commit messages according to the conventional commit standard.
102+
103+
### Lint-staged
104+
105+
A tool for running linters on staged files, ensuring that only clean code is committed.
106+
107+
## DevOps and CI/CD
108+
109+
### GitHub Actions
110+
111+
A CI/CD service that automates workflows, allowing you to build, test, and deploy your code directly from GitHub.
112+
113+
### Docker
114+
115+
A platform for developing, shipping, and running applications in containers, providing an efficient and consistent environment for deployment.
116+
117+
### Renovate
118+
119+
A tool for automating dependency updates, keeping your project up-to-date with the latest versions.
120+
121+
## Documentation
122+
123+
### Markdown
124+
125+
A lightweight markup language with plain-text formatting syntax, used for writing documentation and README files.
126+
127+
### VuePress
128+
129+
A static site generator that simplifies the creation of documentation sites, providing a clean and responsive design.
130+
131+
## Miscellaneous
132+
133+
### env-cmd
134+
135+
A utility for executing commands using environment variables from a file, simplifying the management of environment configurations.
136+
137+
## Conclusion
138+
139+
These tools and frameworks are integral to our development process, ensuring that we can build high-quality, scalable, and maintainable software efficiently.

0 commit comments

Comments
 (0)