nestjs-archi-cli 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/License.yaml +0 -0
- package/README.md +140 -0
- package/dist/index.js +29 -0
- package/package.json +47 -0
- package/template/.dockerignore +6 -0
- package/template/.env.example +12 -0
- package/template/.prettierrc +4 -0
- package/template/Dockerfile +48 -0
- package/template/README.md +99 -0
- package/template/aborescence.txt +238 -0
- package/template/docker-compose-dev.yml +22 -0
- package/template/docker-compose-prod.yml +20 -0
- package/template/dockerfile.dev +25 -0
- package/template/eslint.config.mjs +35 -0
- package/template/nest-cli.json +8 -0
- package/template/package.json +98 -0
- package/template/pnpm-lock.yaml +7665 -0
- package/template/prisma/schema.prisma +48 -0
- package/template/src/app.controller.spec.ts +22 -0
- package/template/src/app.controller.ts +20 -0
- package/template/src/app.module.ts +49 -0
- package/template/src/app.service.ts +8 -0
- package/template/src/common/auth/auth.controller.ts +51 -0
- package/template/src/common/auth/auth.module.ts +24 -0
- package/template/src/common/auth/auth.service.ts +72 -0
- package/template/src/common/auth/dto/create-auth.dto.ts +12 -0
- package/template/src/common/auth/dto/update-auth.dto.ts +11 -0
- package/template/src/common/auth/jwt/auth.guard.ts +45 -0
- package/template/src/common/auth/jwt/constant.ts +3 -0
- package/template/src/common/auth/jwt/jwt.guard.ts +6 -0
- package/template/src/common/auth/jwt/jwt.strategy.ts +46 -0
- package/template/src/common/auth/role/role.decorators.ts +3 -0
- package/template/src/common/auth/role/role.enum.ts +7 -0
- package/template/src/common/auth/role/role.guard.ts +34 -0
- package/template/src/common/http/http-client.module.ts +23 -0
- package/template/src/common/http/http-client.service.ts +127 -0
- package/template/src/common/logger/error.logging.ts +29 -0
- package/template/src/common/logger/logging.interceptor.ts +22 -0
- package/template/src/common/notification/notification.module.ts +12 -0
- package/template/src/common/notification/notification.service.ts +74 -0
- package/template/src/config/db.module.ts +15 -0
- package/template/src/config/db.ts +22 -0
- package/template/src/config/env.validation.ts +35 -0
- package/template/src/features/kafka/kafka.consumer.controller.ts +66 -0
- package/template/src/features/kafka/kafka.consumer.service.ts +89 -0
- package/template/src/features/kafka/kafka.module.ts +20 -0
- package/template/src/features/kafka/kafka.producer.service.ts +29 -0
- package/template/src/features/user/core/dto/create-user.dto.ts +28 -0
- package/template/src/features/user/core/dto/update-user.dto.ts +66 -0
- package/template/src/features/user/core/interface/user.repository.interface.ts +20 -0
- package/template/src/features/user/core/use-case/user.service.ts +101 -0
- package/template/src/features/user/inBound/user.controller.ts +117 -0
- package/template/src/features/user/outBound/user.repository.ts +332 -0
- package/template/src/features/user/user.module.ts +14 -0
- package/template/src/main.ts +59 -0
- package/template/src/utils/crypt.ts +36 -0
- package/template/src/utils/generate.ts +90 -0
- package/template/src/utils/logging.prisma.ts +17 -0
- package/template/src/utils/validation-fields.ts +15 -0
- package/template/src/utils/validation-option.ts +94 -0
- package/template/src/utils/validators/phoneNumber.validate.ts +22 -0
- package/template/test/app.e2e-spec.js +19 -0
- package/template/test/app.e2e-spec.ts +25 -0
- package/template/test/jest-e2e.json +9 -0
- package/template/tsconfig.build.json +27 -0
- package/template/tsconfig.build.tsbuildinfo +1 -0
- package/template/tsconfig.json +29 -0
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# ==========================
|
|
2
|
+
# NestJS DEV Dockerfile
|
|
3
|
+
# ==========================
|
|
4
|
+
FROM node:20-alpine AS development
|
|
5
|
+
|
|
6
|
+
# Dépendances nécessaires
|
|
7
|
+
RUN apk add --no-cache openssl libc6-compat
|
|
8
|
+
|
|
9
|
+
# Dossier de travail
|
|
10
|
+
WORKDIR /usr/src/app
|
|
11
|
+
|
|
12
|
+
# Copie uniquement les fichiers de config pour installer les deps
|
|
13
|
+
COPY package.json pnpm-lock.yaml ./
|
|
14
|
+
|
|
15
|
+
# Installation des dépendances
|
|
16
|
+
RUN npm install -g pnpm && pnpm install
|
|
17
|
+
|
|
18
|
+
# Copie du code source
|
|
19
|
+
COPY . .
|
|
20
|
+
|
|
21
|
+
# Génération Prisma
|
|
22
|
+
RUN npx prisma generate
|
|
23
|
+
|
|
24
|
+
# Commande de dev (watch + poll pour Docker Desktop)
|
|
25
|
+
CMD ["pnpm", "run", "start:dev", "--", "--poll=1000"]
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
// @ts-check
|
|
2
|
+
import eslint from '@eslint/js';
|
|
3
|
+
import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended';
|
|
4
|
+
import globals from 'globals';
|
|
5
|
+
import tseslint from 'typescript-eslint';
|
|
6
|
+
|
|
7
|
+
export default tseslint.config(
|
|
8
|
+
{
|
|
9
|
+
ignores: ['eslint.config.mjs'],
|
|
10
|
+
},
|
|
11
|
+
eslint.configs.recommended,
|
|
12
|
+
...tseslint.configs.recommendedTypeChecked,
|
|
13
|
+
eslintPluginPrettierRecommended,
|
|
14
|
+
{
|
|
15
|
+
languageOptions: {
|
|
16
|
+
globals: {
|
|
17
|
+
...globals.node,
|
|
18
|
+
...globals.jest,
|
|
19
|
+
},
|
|
20
|
+
ecmaVersion: 5,
|
|
21
|
+
sourceType: 'module',
|
|
22
|
+
parserOptions: {
|
|
23
|
+
projectService: true,
|
|
24
|
+
tsconfigRootDir: import.meta.dirname,
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
rules: {
|
|
30
|
+
'@typescript-eslint/no-explicit-any': 'off',
|
|
31
|
+
'@typescript-eslint/no-floating-promises': 'warn',
|
|
32
|
+
'@typescript-eslint/no-unsafe-argument': 'warn'
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
);
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "nestjs-archi-cli",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"description": "",
|
|
5
|
+
"author": "",
|
|
6
|
+
"private": true,
|
|
7
|
+
"license": "UNLICENSED",
|
|
8
|
+
"scripts": {
|
|
9
|
+
"build": "nest build",
|
|
10
|
+
"format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\"",
|
|
11
|
+
"start": "nest start",
|
|
12
|
+
"start:dev": "nest start --watch",
|
|
13
|
+
"start:debug": "nest start --debug --watch",
|
|
14
|
+
"start:prod": "node dist/main",
|
|
15
|
+
"lint": "eslint \"{src,apps,libs,test}/**/*.ts\" --fix",
|
|
16
|
+
"test": "jest",
|
|
17
|
+
"test:watch": "jest --watch",
|
|
18
|
+
"test:cov": "jest --coverage",
|
|
19
|
+
"test:debug": "node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --runInBand",
|
|
20
|
+
"test:e2e": "jest --config ./test/jest-e2e.json"
|
|
21
|
+
},
|
|
22
|
+
"dependencies": {
|
|
23
|
+
"@nestjs/axios": "^4.0.1",
|
|
24
|
+
"@nestjs/common": "^11.0.1",
|
|
25
|
+
"@nestjs/config": "^4.0.2",
|
|
26
|
+
"@nestjs/core": "^11.0.1",
|
|
27
|
+
"@nestjs/jwt": "^11.0.0",
|
|
28
|
+
"@nestjs/mapped-types": "^2.1.0",
|
|
29
|
+
"@nestjs/microservices": "^11.1.5",
|
|
30
|
+
"@nestjs/passport": "^11.0.5",
|
|
31
|
+
"@nestjs/platform-express": "^11.0.1",
|
|
32
|
+
"@prisma/client": "^6.12.0",
|
|
33
|
+
"axios": "^1.11.0",
|
|
34
|
+
"bcryptjs": "^3.0.2",
|
|
35
|
+
"class-transformer": "^0.5.1",
|
|
36
|
+
"class-validator": "^0.14.2",
|
|
37
|
+
"crypto-js": "^4.2.0",
|
|
38
|
+
"dotenv": "^17.2.1",
|
|
39
|
+
"jsonwebtoken": "^9.0.2",
|
|
40
|
+
"kafkajs": "^2.2.4",
|
|
41
|
+
"libphonenumber-js": "^1.12.10",
|
|
42
|
+
"nestjs-logging-interceptor": "^0.1.2",
|
|
43
|
+
"nestjs-prisma": "^0.25.0",
|
|
44
|
+
"passport": "^0.7.0",
|
|
45
|
+
"passport-jwt": "^4.0.1",
|
|
46
|
+
"reflect-metadata": "^0.2.2",
|
|
47
|
+
"rxjs": "^7.8.1",
|
|
48
|
+
"zod": "^4.0.10"
|
|
49
|
+
},
|
|
50
|
+
"devDependencies": {
|
|
51
|
+
"@eslint/eslintrc": "^3.2.0",
|
|
52
|
+
"@eslint/js": "^9.18.0",
|
|
53
|
+
"@nestjs/cli": "^11.0.0",
|
|
54
|
+
"@nestjs/schematics": "^11.0.0",
|
|
55
|
+
"@nestjs/testing": "^11.0.1",
|
|
56
|
+
"@swc/cli": "^0.6.0",
|
|
57
|
+
"@swc/core": "^1.10.7",
|
|
58
|
+
"@types/bcrypt": "^6.0.0",
|
|
59
|
+
"@types/dotenv": "^8.2.3",
|
|
60
|
+
"@types/express": "^5.0.0",
|
|
61
|
+
"@types/jest": "^29.5.14",
|
|
62
|
+
"@types/node": "^22.10.7",
|
|
63
|
+
"@types/passport-jwt": "^4.0.1",
|
|
64
|
+
"@types/supertest": "^6.0.2",
|
|
65
|
+
"eslint": "^9.18.0",
|
|
66
|
+
"eslint-config-prettier": "^10.0.1",
|
|
67
|
+
"eslint-plugin-prettier": "^5.2.2",
|
|
68
|
+
"globals": "^15.14.0",
|
|
69
|
+
"jest": "^29.7.0",
|
|
70
|
+
"prettier": "^3.4.2",
|
|
71
|
+
"prisma": "^6.12.0",
|
|
72
|
+
"source-map-support": "^0.5.21",
|
|
73
|
+
"supertest": "^7.0.0",
|
|
74
|
+
"ts-jest": "^29.2.5",
|
|
75
|
+
"ts-loader": "^9.5.2",
|
|
76
|
+
"ts-node": "^10.9.2",
|
|
77
|
+
"tsconfig-paths": "^4.2.0",
|
|
78
|
+
"typescript": "^5.7.3",
|
|
79
|
+
"typescript-eslint": "^8.20.0"
|
|
80
|
+
},
|
|
81
|
+
"jest": {
|
|
82
|
+
"moduleFileExtensions": [
|
|
83
|
+
"js",
|
|
84
|
+
"json",
|
|
85
|
+
"ts"
|
|
86
|
+
],
|
|
87
|
+
"rootDir": "src",
|
|
88
|
+
"testRegex": ".*\\.spec\\.ts$",
|
|
89
|
+
"transform": {
|
|
90
|
+
"^.+\\.(t|j)s$": "ts-jest"
|
|
91
|
+
},
|
|
92
|
+
"collectCoverageFrom": [
|
|
93
|
+
"**/*.(t|j)s"
|
|
94
|
+
],
|
|
95
|
+
"coverageDirectory": "../coverage",
|
|
96
|
+
"testEnvironment": "node"
|
|
97
|
+
}
|
|
98
|
+
}
|