Skip to content

Commit 5349c85

Browse files
committed
New: NestJS Server Demo.
1 parent c9b7586 commit 5349c85

21 files changed

+8939
-10
lines changed

.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,5 @@ next-env.d.ts
3939
.docusaurus/
4040

4141
#
42-
/backend/node_modules
42+
/backend/node_modules/
43+
/backend@nest/node_modules/

CHANGELOG.md

+8
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# Changelog
22

3+
4+
#### = 1.4.3 (March 25, 2025) =
5+
6+
* New: NestJS Server Demo.
7+
* New: Add new hook `useHistoryTracker()`
8+
* Upgraded: Update browser tools.
9+
10+
311
#### = 1.4.2 (January 2, 2025) =
412

513
* Upgraded: nextjs to 15.1.3.

README.md

+28-4
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ List my progress here:
7474
| Request Cache Demo ||
7575
| Authentication of Microservices ||
7676
| Markdown Render Demo ||
77-
| NestJS Support | 🕒 |
77+
| NestJS Server Demo | ✅ 👉🏼 Go to the folder [backend@nest](backend@nest) |
7878
| 🍗 End-to-end typesafe API (gRPC) | ⚠️ *unbundled* 👉🏼 [gRPC Getting Started](https://github.com/xizon/grpc-getting-started) |
7979
| 🍗 React UI Components Libraries | ⚠️ *unbundled* 👉🏼 [Funda UI](https://github.com/xizon/funda-ui) |
8080
| 🍗 Nextjs Doc Template | ⚠️ *unbundled* 👉🏼 [Nextjs Doc Template](https://github.com/xizon/nextjs-doc-template) |
@@ -177,14 +177,38 @@ $ npm run start
177177
```
178178

179179

180-
### Start the PHP server independently:
181180

182-
Please install php on your computer first.
181+
### Run PHP server independently (Separate start port 4000 service)**
183182

183+
Please install php on your computer first. Once enabled, you can test the background management features.
184+
185+
**a) for `Express`**
184186
```sh
185187
$ npm run action:phpserver
186188
```
187-
Please use a PHP server environment with a local port of 4000, check the file at `./backend/server-php.js`
189+
190+
191+
**b) for `NestJS` in "./backend@nest" **
192+
```sh
193+
$ cd backend@nest
194+
195+
# generate an executable file (you can run "npm run action:phpserver:nest")
196+
$ npm run build
197+
198+
# development
199+
$ npm run start
200+
201+
# watch mode
202+
$ npm run start:dev
203+
204+
# production mode
205+
$ npm run start:prod
206+
```
207+
208+
209+
Please use a PHP server environment with a local port of 4000, check the file at `./backend/server-php.js` (for Express) or `./backend@nest/dist/main.js` (for NestJS)
210+
211+
With is command file will be compiled and it will be loaded on local server [http://localhost:4000](http://localhost:4000).
188212

189213

190214

backend@nest/.eslintrc.js

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
module.exports = {
2+
parser: '@typescript-eslint/parser',
3+
parserOptions: {
4+
project: 'tsconfig.json',
5+
tsconfigRootDir: __dirname,
6+
sourceType: 'module',
7+
},
8+
plugins: ['@typescript-eslint/eslint-plugin'],
9+
extends: [
10+
'plugin:@typescript-eslint/recommended',
11+
'plugin:prettier/recommended',
12+
],
13+
root: true,
14+
env: {
15+
node: true,
16+
jest: true,
17+
},
18+
ignorePatterns: ['.eslintrc.js'],
19+
rules: {
20+
'@typescript-eslint/interface-name-prefix': 'off',
21+
'@typescript-eslint/explicit-function-return-type': 'off',
22+
'@typescript-eslint/explicit-module-boundary-types': 'off',
23+
'@typescript-eslint/no-explicit-any': 'off',
24+
},
25+
};

backend@nest/.gitignore

+56
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# compiled output
2+
/dist
3+
/node_modules
4+
/build
5+
6+
# Logs
7+
logs
8+
*.log
9+
npm-debug.log*
10+
pnpm-debug.log*
11+
yarn-debug.log*
12+
yarn-error.log*
13+
lerna-debug.log*
14+
15+
# OS
16+
.DS_Store
17+
18+
# Tests
19+
/coverage
20+
/.nyc_output
21+
22+
# IDEs and editors
23+
/.idea
24+
.project
25+
.classpath
26+
.c9/
27+
*.launch
28+
.settings/
29+
*.sublime-workspace
30+
31+
# IDE - VSCode
32+
.vscode/*
33+
!.vscode/settings.json
34+
!.vscode/tasks.json
35+
!.vscode/launch.json
36+
!.vscode/extensions.json
37+
38+
# dotenv environment variable files
39+
.env
40+
.env.development.local
41+
.env.test.local
42+
.env.production.local
43+
.env.local
44+
45+
# temp directory
46+
.temp
47+
.tmp
48+
49+
# Runtime data
50+
pids
51+
*.pid
52+
*.seed
53+
*.pid.lock
54+
55+
# Diagnostic reports (https://nodejs.org/api/report.html)
56+
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

backend@nest/.prettierrc

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"singleQuote": true,
3+
"trailingComma": "all"
4+
}

backend@nest/nest-cli.json

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"$schema": "https://json.schemastore.org/nest-cli",
3+
"collection": "@nestjs/schematics",
4+
"sourceRoot": "src",
5+
"compilerOptions": {
6+
"deleteOutDir": true
7+
}
8+
}

0 commit comments

Comments
 (0)