Skip to content

Commit 1b6417c

Browse files
author
Joey Goksu
authored
add documentation
- update readme - start documenting the repo
1 parent 337a469 commit 1b6417c

File tree

5 files changed

+92
-7
lines changed

5 files changed

+92
-7
lines changed

README.md

+25-7
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,33 @@
1+
# NestJS Boilerplate
2+
3+
[![All Contributors](https://img.shields.io/badge/all_contributors-1-orange.svg?style=flat-square)](#contributors)
4+
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
5+
![GitHub issues](https://img.shields.io/github/issues/joeygoksu/prime-nestjs.svg)
6+
[![Known Vulnerabilities](https://snyk.io/test/github/joeygoksu/prime-nestjs/badge.svg)](https://snyk.io/test/github/joeygoksu/prime-nestjs)
7+
![GitHub stars](https://img.shields.io/github/stars/joeygoksu/prime-nestjs.svg?style=social&label=Star&maxAge=2592000)
8+
19
<p align="left">
2-
<img src="./showcase/prime-nestjs.jpg" width="600" alt="prime-nestjs">
10+
<img src="documentation/prime-nestjs.jpg" width="600" alt="prime-nestjs">
311
</p>
412

5-
Introducing the NestJS boilerplate, a comprehensive and modular starting point for your next Node.js project! Built with the latest version of NestJS, a powerful and flexible framework for building efficient and scalable server-side applications, this boilerplate includes support for TypeScript, PostgreSQL, and JWT authentication out of the box. Other features include configuration support with Dotenv, RBAC and CBAC for authorization, TypeORM for database interactions, Swagger for API documentation, and Docker Compose for container orchestration. Additionally, the boilerplate comes with pre-configured linting tools and secure HTTP headers with Helmet. Simply clone the repository, install the dependencies, and start building your next great idea!
13+
## 📖 Description
14+
15+
![Open Source Love](https://badges.frapsoft.com/os/v1/open-source.svg?v=103)
16+
![Maintenance](https://img.shields.io/maintenance/yes/2021.svg)
17+
![GitHub last commit](https://img.shields.io/github/last-commit/joeygoksu/prime-nestjs.svg)
18+
![GitHub repo size](https://img.shields.io/github/repo-size/joeygoksu/prime-nestjs.svg)
19+
![GitHub code size in bytes](https://img.shields.io/github/languages/code-size/joeygoksu/prime-nestjs.svg)
20+
![GitHub top language](https://img.shields.io/github/languages/top/joeygoksu/prime-nestjs.svg)
21+
![GitHub language count](https://img.shields.io/github/languages/count/joeygoksu/prime-nestjs.svg)
22+
![GitHub contributors](https://img.shields.io/github/contributors/joeygoksu/prime-nestjs.svg)
23+
![GitHub commit activity the past week, 4 weeks, year](https://img.shields.io/github/commit-activity/y/joeygoksu/prime-nestjs.svg)
24+
![GitHub commit activity the past week, 4 weeks, year](https://img.shields.io/github/commit-activity/m/joeygoksu/prime-nestjs.svg)
25+
![GitHub commit activity the past week, 4 weeks, year](https://img.shields.io/github/commit-activity/w/joeygoksu/prime-nestjs.svg)
26+
![GitHub package.json version](https://img.shields.io/github/package-json/v/joeygoksu/prime-nestjs.svg)
627

7-
## Out-of-box Solutions
28+
Introducing the NestJS boilerplate, a comprehensive and modular starting point for your next Node.js project! Built with the latest version of NestJS, a powerful and flexible framework for building efficient and scalable server-side applications, this boilerplate includes support for TypeScript, PostgreSQL, and JWT authentication out of the box. Other features include configuration support with Dotenv, RBAC and CBAC for authorization, TypeORM for database interactions, Swagger for API documentation, and Docker Compose for container orchestration. Additionally, the boilerplate comes with pre-configured linting tools and secure HTTP headers with Helmet. Simply clone the repository, install the dependencies, and start building your next great idea!
829

9-
**Built-in Features**
30+
## 🚀 Features
1031

1132
- 📱 **NestJS** — latest version
1233
- 🎉 **TypeScript** - Type checking
@@ -23,9 +44,6 @@ Introducing the NestJS boilerplate, a comprehensive and modular starting point f
2344
- 📏 **ESLint** — Pluggable JavaScript linter
2445
- 💖 **Prettier** - Opinionated Code Formatter
2546
-**Commitlint** - Lint your conventional commits
26-
27-
**GitHub actions**
28-
2947
- 🕵️‍♂️ **Code Scanning** - Code scanning with CodeQL
3048

3149
## Quick Setup (Production)

documentation/Readme.md

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Documentation
2+
3+
This is the documentation for the project. It is written in Markdown and can be viewed in the browser.
4+
5+
## Table of Contents
6+
7+
- [Auth](./auth.md)
8+
- [Config](./config.md)

documentation/auth.md

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Auth
2+
3+
## Sequence Diagram
4+
5+
```mermaid
6+
7+
sequenceDiagram
8+
autonumber
9+
participant C as Client #1
10+
participant AC as AuthController #2
11+
participant AS as AuthService #3
12+
participant US as UsersService #4
13+
14+
#1: Client - The user/client who sends the request to the server for login or register.
15+
#2: AuthController - The controller that handles the incoming requests from the client, performs necessary validations and calls the AuthService to perform the login or register operation.
16+
#3: AuthService - The service layer that processes the login or register request and performs necessary business logic such as authentication, generating JWT token, and validating user information using the UsersService.
17+
#4: UsersService - The service layer that communicates with the database and fetches or modifies user information.
18+
19+
#1: C->>+AC: Sends login or register request to AuthController.
20+
#2: AC->>+AS: Calls login or register function of AuthService.
21+
#3: AS->>+US: Calls UsersService function to fetch or modify user information.
22+
Note over US: UsersService communicates<br>with the database to fetch or<br>modify user information.
23+
24+
alt Valid user
25+
#4: US-->>-AS: Returns user information.
26+
#3: AS-->>-AC: Returns success message and JWT token.
27+
#2: AC-->>-C: Returns success message and JWT token.
28+
Note over C: Receives success message and JWT token.
29+
else Invalid user
30+
#4: US-->>-AS: Returns null.
31+
#3: AS-->>-AC: Returns error message.
32+
#2: AC-->>-C: Returns error message.
33+
Note over C: Receives error message.
34+
end
35+
36+
```

documentation/config.md

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Config
2+
3+
## Sequence Diagram
4+
5+
```mermaid
6+
sequenceDiagram
7+
autonumber
8+
participant ConfigLoader as Config Loader #1
9+
participant Database as Database #2
10+
participant App as App #3
11+
12+
#1: ConfigLoader - Loads the configuration file and initializes the application settings.
13+
#2: Database - Connects to the database using the database configuration settings.
14+
#3: App - Runs the application and listens for incoming requests.
15+
16+
#1: ConfigLoader->>+Database: Loads database configuration settings.
17+
Note over Database: Connects to the database using<br>the configuration settings.
18+
#2: Database-->>-ConfigLoader: Returns database connection status.
19+
Note over ConfigLoader: Initializes the application settings using<br>the loaded configuration file.
20+
#1: ConfigLoader->>+App: Loads application settings.
21+
Note over App: Runs the application using the<br>initialized configuration settings.
22+
#3: App-->>-ConfigLoader: Returns application status.
23+
```
File renamed without changes.

0 commit comments

Comments
 (0)