2
2
3
3
[ ![ code style: prettier] ( https://img.shields.io/badge/code_style-prettier-ff69b4.svg )] ( http://prettier.io ) [ ![ Commitizen friendly] ( https://img.shields.io/badge/commitizen-friendly-brightgreen.svg )] ( http://commitizen.github.io/cz-cli/ ) [ ![ Conventional Commits] ( https://img.shields.io/badge/Conventional%20Commits-1.0.0-yellow.svg )] ( https://conventionalcommits.org )
4
4
5
+ ## Description
6
+
7
+ A sample NodeJs application, demonstrating how to use JWT Authentication, with access tokens and refresh tokens.
8
+
5
9
## Installation
6
10
7
11
Development environment requirements:
@@ -10,25 +14,51 @@ Development environment requirements:
10
14
11
15
## Project initialization
12
16
13
- ### 1. [ LOCAL] stage use DevContainer or docker-compose command
14
- ``` shell
15
- cp .env.dev .env
16
- docker compose -f ./.devcontainer/docker-compose.yml --env-file .env up -d --build
17
+ ### 1. Installation
18
+
19
+ ``` bash
20
+ $ cp .env.dev .env
21
+ $ docker compose up -d --build
22
+ $ npm install
23
+ ```
24
+
25
+ ### 2. Running the migration
26
+
27
+ ``` bash
28
+ $ npm run migrate:run
17
29
```
18
30
19
- ### 2. Migration
20
- ``` shell
21
- npm run migrate:create --name=< NAME>
22
- npm run migrate:run
31
+ ### 3. Running the app
32
+
33
+ ``` bash
34
+ # development mode
35
+ $ npm run start:dev
36
+
37
+ # production mode
38
+ $ npm run start:prod
23
39
```
24
40
25
- ## Next steps
41
+ ### 4. Running the test
42
+
43
+ ``` bash
44
+ # unit tests
45
+ $ npm run test
46
+
47
+ # integration tests
48
+ $ npm run test:integration
49
+
50
+ # e2e tests
51
+ $ npm run test:e2e
52
+ ```
53
+
54
+ ## Roadmap
26
55
- Auth
27
56
- [X] Authenticate user
28
57
- [X] Refresh token
29
58
- [X] Logout a user
30
59
- [X] Forgot password
31
60
- [X] Reset password
61
+ - [ ] Add Redis cache
32
62
- User
33
63
- [X] Create a new user
34
64
- [X] Update user
@@ -38,7 +68,6 @@ Development environment requirements:
38
68
- [X] Facebook
39
69
- [X] Apple
40
70
- [X] Google
41
- - [ ] Twitter
42
71
- [ ] Linkedin
43
72
- [X] Github
44
73
- Test
@@ -51,33 +80,33 @@ Development environment requirements:
51
80
52
81
### 1. Enable Git hooks
53
82
54
- ```
55
- npx husky install
56
- npx husky add .husky/commit-msg 'npm run commit-msg'
57
- npx husky add .husky/pre-commit 'npm run pre-commit'
83
+ ``` bash
84
+ $ npx husky install
85
+ $ npx husky add .husky/commit-msg ' npm run commit-msg'
86
+ $ npx husky add .husky/pre-commit ' npm run pre-commit'
58
87
```
59
88
60
89
### 2. Why is my git pre-commit hook not executable by default?
61
90
62
91
- Because files are not executable by default; they must be set to be executable.
63
92
64
- ```
65
- chmod ug+x .husky/*
66
- chmod ug+x .git/hooks/*
93
+ ``` bash
94
+ $ chmod ug+x .husky/*
95
+ $ chmod ug+x .git/hooks/*
67
96
```
68
97
69
98
### 3. Git commit
70
99
71
- ``` shell
72
- npm run commit
100
+ ``` bash
101
+ $ npm run commit
73
102
```
74
103
75
104
### 4. Project release
76
105
77
- ``` shell
78
- npm run release:patch // Patch release 0.1.0 -> 0.1.1
79
- npm run release:minor // Minor release 0.1.1 -> 0.2.0
80
- npm run release:major // Major release 0.2.0 -> 1.0.0
106
+ ``` bash
107
+ $ npm run release:patch // Patch release 0.1.0 -> 0.1.1
108
+ $ npm run release:minor // Minor release 0.1.1 -> 0.2.0
109
+ $ npm run release:major // Major release 0.2.0 -> 1.0.0
81
110
```
82
111
83
112
### 5. Project Structure
0 commit comments