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
package/License.yaml
ADDED
|
File without changes
|
package/README.md
ADDED
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
# NestJS Archi CLI
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
[](https://www.npmjs.com/package/nestjs-archi-cli)
|
|
5
|
+
[](LICENSE)
|
|
6
|
+
[](https://github.com/Konanycode1/nestjs-archi-cli/actions)
|
|
7
|
+
|
|
8
|
+
π **NestJS Archi CLI** est un outil en ligne de commande pour gΓ©nΓ©rer rapidement un projet NestJS avec une **architecture prΓ©dΓ©finie et prΓͺte Γ lβemploi**.
|
|
9
|
+
|
|
10
|
+
Il permet de crΓ©er un boilerplate propre avec les dossiers, modules et services dΓ©jΓ organisΓ©s selon de bonnes pratiques.
|
|
11
|
+
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
## π Features
|
|
17
|
+
|
|
18
|
+
- Structure de dossier **prΓ©-dΓ©finie** (`src/modules`, `common`, `config`, `utils`, `features`, etc.)
|
|
19
|
+
- Modules NestJS prΓͺts Γ lβemploi : auth, user, kafka, notifications, utils, etc.
|
|
20
|
+
- Fichiers TypeScript et configuration TS/Prisma inclus
|
|
21
|
+
- Dockerfile et docker-compose pour dev et prod
|
|
22
|
+
- Compatible avec **pnpm, npm ou yarn**
|
|
23
|
+
- CLI simple : `npx nestjs-archi my-app`
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
## πΏ Installation
|
|
28
|
+
|
|
29
|
+
### Avec npx (recommandΓ©)
|
|
30
|
+
```bash
|
|
31
|
+
npx nestjs-archi-cli my-app
|
|
32
|
+
|
|
33
|
+
cd my-app
|
|
34
|
+
|
|
35
|
+
pnpm install # ou npm install / yarn install
|
|
36
|
+
|
|
37
|
+
pnpm run start:dev # ou npm run start:dev
|
|
38
|
+
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## π Structure gΓ©nΓ©rΓ©e (exemple)
|
|
42
|
+
|
|
43
|
+
Lorsque vous crΓ©ez un projet avec **NestJS Archi CLI**, la structure suivante sera gΓ©nΓ©rΓ©e :
|
|
44
|
+
|
|
45
|
+
```
|
|
46
|
+
nestjs-repos/
|
|
47
|
+
β ββ prisma/
|
|
48
|
+
β β ββ schema.prisma
|
|
49
|
+
β ββ src/
|
|
50
|
+
β ββ common/
|
|
51
|
+
β β ββ auth/
|
|
52
|
+
β β β ββ dto/
|
|
53
|
+
β β β β ββ create-auth.dto.ts
|
|
54
|
+
β β β β ββ update-auth.dto.ts
|
|
55
|
+
β β β ββ jwt/
|
|
56
|
+
β β β β ββ auth.guard.ts
|
|
57
|
+
β β β β ββ constant.ts
|
|
58
|
+
β β β β ββ jwt.guard.ts
|
|
59
|
+
β β β β ββ jwt.strategy.ts
|
|
60
|
+
β β β ββ role/
|
|
61
|
+
β β β β ββ role.decorators.ts
|
|
62
|
+
β β β β ββ role.enum.ts
|
|
63
|
+
β β β β ββ role.guard.ts
|
|
64
|
+
β β β ββ auth.controller.ts
|
|
65
|
+
β β β ββ auth.module.ts
|
|
66
|
+
β β β ββ auth.service.ts
|
|
67
|
+
β β ββ http/
|
|
68
|
+
β β β ββ http-client.module.ts
|
|
69
|
+
β β β ββ http-client.service.ts
|
|
70
|
+
β β ββ logger/
|
|
71
|
+
β β β ββ error.logging.ts
|
|
72
|
+
β β β ββ logging.interceptor.ts
|
|
73
|
+
β β ββ notification/
|
|
74
|
+
β β ββ notification.module.ts
|
|
75
|
+
β β ββ notification.service.ts
|
|
76
|
+
β ββ config/
|
|
77
|
+
β β ββ db.module.ts
|
|
78
|
+
β β ββ db.ts
|
|
79
|
+
β β ββ env.validation.ts
|
|
80
|
+
β ββ features/
|
|
81
|
+
β β ββ kafka/
|
|
82
|
+
β β β ββ kafka.consumer.controller.ts
|
|
83
|
+
β β β ββ kafka.consumer.service.ts
|
|
84
|
+
β β β ββ kafka.module.ts
|
|
85
|
+
β β β ββ kafka.producer.service.ts
|
|
86
|
+
β β ββ user/
|
|
87
|
+
β β ββ core/
|
|
88
|
+
β β β ββ dto/
|
|
89
|
+
β β β β ββ create-user.dto.ts
|
|
90
|
+
β β β β ββ update-user.dto.ts
|
|
91
|
+
β β β ββ interface/
|
|
92
|
+
β β β β ββ user.repository.interface.ts
|
|
93
|
+
β β β ββ use-case/
|
|
94
|
+
β β β ββ user.service.ts
|
|
95
|
+
β β ββ inBound/
|
|
96
|
+
β β β ββ user.controller.ts
|
|
97
|
+
β β ββ outBound/
|
|
98
|
+
β β β ββ user.repository.ts
|
|
99
|
+
β β ββ user.module.ts
|
|
100
|
+
β ββ utils/
|
|
101
|
+
β β ββ validators/
|
|
102
|
+
β β β ββ phoneNumber.validate.ts
|
|
103
|
+
β β ββ crypt.ts
|
|
104
|
+
β β ββ generate.ts
|
|
105
|
+
β β ββ logging.prisma.ts
|
|
106
|
+
β β ββ validation-fields.ts
|
|
107
|
+
β β ββ validation-option.ts
|
|
108
|
+
β ββ app.controller.spec.ts
|
|
109
|
+
β ββ app.controller.ts
|
|
110
|
+
β ββ app.module.ts
|
|
111
|
+
β ββ app.service.ts
|
|
112
|
+
β ββ main.ts
|
|
113
|
+
ββ test/
|
|
114
|
+
β ββ app.e2e-spec.js
|
|
115
|
+
β ββ app.e2e-spec.ts
|
|
116
|
+
β ββ jest-e2e.json
|
|
117
|
+
ββ .dockerignore
|
|
118
|
+
ββ .env
|
|
119
|
+
ββ .env.example
|
|
120
|
+
ββ .env.production
|
|
121
|
+
ββ .gitignore
|
|
122
|
+
ββ .prettierrc
|
|
123
|
+
ββ aborescence.txt
|
|
124
|
+
ββ docker-compose-dev.yml
|
|
125
|
+
ββ docker-compose-prod.yml
|
|
126
|
+
ββ Dockerfile
|
|
127
|
+
ββ dockerfile.dev
|
|
128
|
+
ββ eslint.config.mjs
|
|
129
|
+
ββ nest-cli.json
|
|
130
|
+
ββ package.json
|
|
131
|
+
ββ pnpm-lock.yaml
|
|
132
|
+
ββ README.md
|
|
133
|
+
ββ tsconfig.build.json
|
|
134
|
+
ββ tsconfig.build.tsbuildinfo
|
|
135
|
+
ββ tsconfig.json
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
> Cette structure assure que le code est **modulaire, lisible et maintenable**, mΓͺme pour des projets complexes avec plusieurs modules mΓ©tier.
|
|
139
|
+
|
|
140
|
+
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import fs from "fs-extra";
|
|
3
|
+
import path from "path";
|
|
4
|
+
import inquirer from "inquirer";
|
|
5
|
+
import chalk from "chalk";
|
|
6
|
+
import { fileURLToPath } from "url";
|
|
7
|
+
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
8
|
+
async function main() {
|
|
9
|
+
console.log(chalk.cyan("\nπ GΓ©nΓ©rateur de repo NestJS customisΓ©\n"));
|
|
10
|
+
const { projectName } = await inquirer.prompt([
|
|
11
|
+
{
|
|
12
|
+
name: "projectName",
|
|
13
|
+
message: "project name:",
|
|
14
|
+
default: "my-nest-app"
|
|
15
|
+
}
|
|
16
|
+
]);
|
|
17
|
+
const targetPath = path.join(process.cwd(), projectName);
|
|
18
|
+
const templatePath = path.join(__dirname, "../template");
|
|
19
|
+
if (fs.existsSync(targetPath)) {
|
|
20
|
+
console.log(chalk.red(`β your project ${projectName} already exists.`));
|
|
21
|
+
process.exit(1);
|
|
22
|
+
}
|
|
23
|
+
console.log(chalk.yellow("π copy your code ..."));
|
|
24
|
+
await fs.copy(templatePath, targetPath);
|
|
25
|
+
console.log(chalk.green(`\nβ
Project ${projectName} created !`));
|
|
26
|
+
console.log(chalk.blue(`π cd ${projectName} && pnpm install`));
|
|
27
|
+
console.log(chalk.blue(`π pnpm run start:dev`));
|
|
28
|
+
}
|
|
29
|
+
main();
|
package/package.json
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "nestjs-archi-cli",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "CLI tool to quickly scaffold a NestJS project with a predefined clean architecture",
|
|
5
|
+
"bin": {
|
|
6
|
+
"nestjs-archi": "dist/index.js"
|
|
7
|
+
},
|
|
8
|
+
"keywords": [
|
|
9
|
+
"nestjs",
|
|
10
|
+
"cli",
|
|
11
|
+
"architecture",
|
|
12
|
+
"boilerplate",
|
|
13
|
+
"generator",
|
|
14
|
+
"typescript"
|
|
15
|
+
],
|
|
16
|
+
"author": "Abraham konan abrahamkonany@gmail.com",
|
|
17
|
+
"license": "MIT",
|
|
18
|
+
"homepage": "https://github.com/Konanycode1/nestjs-archi-cli#readme",
|
|
19
|
+
"repository": {
|
|
20
|
+
"type": "git",
|
|
21
|
+
"url": "https://github.com/Konanycode1/nestjs-archi-cli.git"
|
|
22
|
+
},
|
|
23
|
+
"bugs": {
|
|
24
|
+
"url": "https://github.com/Konanycode1/nestjs-archi-cli/issues"
|
|
25
|
+
},
|
|
26
|
+
"files": [
|
|
27
|
+
"dist",
|
|
28
|
+
"template"
|
|
29
|
+
],
|
|
30
|
+
"type": "module",
|
|
31
|
+
"scripts": {
|
|
32
|
+
"build": "tsc",
|
|
33
|
+
"dev": "ts-node src/index.ts"
|
|
34
|
+
},
|
|
35
|
+
"dependencies": {
|
|
36
|
+
"chalk": "^5.3.0",
|
|
37
|
+
"fs-extra": "^11.2.0",
|
|
38
|
+
"inquirer": "^9.2.7"
|
|
39
|
+
},
|
|
40
|
+
"devDependencies": {
|
|
41
|
+
"@types/chalk": "^0.4.31",
|
|
42
|
+
"@types/fs-extra": "^11.0.4",
|
|
43
|
+
"@types/inquirer": "^9.0.9",
|
|
44
|
+
"ts-node": "^10.9.2",
|
|
45
|
+
"typescript": "^5.4.0"
|
|
46
|
+
}
|
|
47
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# Stage 1: Development
|
|
2
|
+
FROM node:20-alpine AS development
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
# Dépendances système pour canvas
|
|
6
|
+
#RUN apt-get update && apt-get install -y \ build-essential \libcairo2-dev \libpango1.0-dev \libjpeg-dev \libgif-dev \librsvg2-dev
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
RUN npm i -g pnpm
|
|
10
|
+
WORKDIR /usr/src/app
|
|
11
|
+
|
|
12
|
+
COPY --chown=node:node pnpm-lock.yaml ./
|
|
13
|
+
RUN pnpm fetch --prod
|
|
14
|
+
COPY --chown=node:node . .
|
|
15
|
+
RUN pnpm install
|
|
16
|
+
RUN pnpm prisma generate
|
|
17
|
+
USER node
|
|
18
|
+
|
|
19
|
+
# Stage 2: Build
|
|
20
|
+
FROM node:20-alpine AS build
|
|
21
|
+
RUN npm i -g pnpm
|
|
22
|
+
WORKDIR /usr/src/app
|
|
23
|
+
COPY --chown=node:node pnpm-lock.yaml ./
|
|
24
|
+
COPY --chown=node:node --from=development /usr/src/app/node_modules ./node_modules
|
|
25
|
+
COPY --chown=node:node . .
|
|
26
|
+
RUN pnpm build
|
|
27
|
+
ENV NODE_ENV=production
|
|
28
|
+
RUN npx prisma generate && npx prisma db push
|
|
29
|
+
|
|
30
|
+
RUN pnpm install --prod --ignore-scripts \
|
|
31
|
+
&& npm rebuild bcrypt --build-from-source
|
|
32
|
+
USER node
|
|
33
|
+
|
|
34
|
+
# Stage 3: Production
|
|
35
|
+
FROM node:20-alpine AS production
|
|
36
|
+
|
|
37
|
+
RUN apk add --no-cache ffmpeg
|
|
38
|
+
RUN apk add --no-cache curl
|
|
39
|
+
# DΓ©finir le rΓ©pertoire de travail de l'application
|
|
40
|
+
WORKDIR /usr/src/app
|
|
41
|
+
|
|
42
|
+
# Copier les dΓ©pendances et fichiers de build depuis le stage `build`
|
|
43
|
+
COPY --from=build /usr/src/app/node_modules ./node_modules
|
|
44
|
+
COPY --from=build /usr/src/app/dist ./dist
|
|
45
|
+
|
|
46
|
+
COPY --from=build /usr/src/app/.env.delivery .env
|
|
47
|
+
# DΓ©finir la commande de lancement de l'application en production
|
|
48
|
+
CMD ["node", "dist/src/main.js"]
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
<a href="http://nestjs.com/" target="blank"><img src="https://nestjs.com/img/logo-small.svg" width="120" alt="Nest Logo" /></a>
|
|
3
|
+
</p>
|
|
4
|
+
|
|
5
|
+
[circleci-image]: https://img.shields.io/circleci/build/github/nestjs/nest/master?token=abc123def456
|
|
6
|
+
[circleci-url]: https://circleci.com/gh/nestjs/nest
|
|
7
|
+
|
|
8
|
+
<p align="center">A progressive <a href="http://nodejs.org" target="_blank">Node.js</a> framework for building efficient and scalable server-side applications.</p>
|
|
9
|
+
<p align="center">
|
|
10
|
+
<a href="https://www.npmjs.com/~nestjscore" target="_blank"><img src="https://img.shields.io/npm/v/@nestjs/core.svg" alt="NPM Version" /></a>
|
|
11
|
+
<a href="https://www.npmjs.com/~nestjscore" target="_blank"><img src="https://img.shields.io/npm/l/@nestjs/core.svg" alt="Package License" /></a>
|
|
12
|
+
<a href="https://www.npmjs.com/~nestjscore" target="_blank"><img src="https://img.shields.io/npm/dm/@nestjs/common.svg" alt="NPM Downloads" /></a>
|
|
13
|
+
<a href="https://circleci.com/gh/nestjs/nest" target="_blank"><img src="https://img.shields.io/circleci/build/github/nestjs/nest/master" alt="CircleCI" /></a>
|
|
14
|
+
<a href="https://coveralls.io/github/nestjs/nest?branch=master" target="_blank"><img src="https://coveralls.io/repos/github/nestjs/nest/badge.svg?branch=master#9" alt="Coverage" /></a>
|
|
15
|
+
<a href="https://discord.gg/G7Qnnhy" target="_blank"><img src="https://img.shields.io/badge/discord-online-brightgreen.svg" alt="Discord"/></a>
|
|
16
|
+
<a href="https://opencollective.com/nest#backer" target="_blank"><img src="https://opencollective.com/nest/backers/badge.svg" alt="Backers on Open Collective" /></a>
|
|
17
|
+
<a href="https://opencollective.com/nest#sponsor" target="_blank"><img src="https://opencollective.com/nest/sponsors/badge.svg" alt="Sponsors on Open Collective" /></a>
|
|
18
|
+
<a href="https://paypal.me/kamilmysliwiec" target="_blank"><img src="https://img.shields.io/badge/Donate-PayPal-ff3f59.svg" alt="Donate us"/></a>
|
|
19
|
+
<a href="https://opencollective.com/nest#sponsor" target="_blank"><img src="https://img.shields.io/badge/Support%20us-Open%20Collective-41B883.svg" alt="Support us"></a>
|
|
20
|
+
<a href="https://twitter.com/nestframework" target="_blank"><img src="https://img.shields.io/twitter/follow/nestframework.svg?style=social&label=Follow" alt="Follow us on Twitter"></a>
|
|
21
|
+
</p>
|
|
22
|
+
<!--[](https://opencollective.com/nest#backer)
|
|
23
|
+
[](https://opencollective.com/nest#sponsor)-->
|
|
24
|
+
|
|
25
|
+
## Description
|
|
26
|
+
|
|
27
|
+
[Nest](https://github.com/nestjs/nest) framework TypeScript starter repository.
|
|
28
|
+
|
|
29
|
+
## Project setup
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
$ pnpm install
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## Compile and run the project
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
# development
|
|
39
|
+
$ pnpm run start
|
|
40
|
+
|
|
41
|
+
# watch mode
|
|
42
|
+
$ pnpm run start:dev
|
|
43
|
+
|
|
44
|
+
# production mode
|
|
45
|
+
$ pnpm run start:prod
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## Run tests
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
# unit tests
|
|
52
|
+
$ pnpm run test
|
|
53
|
+
|
|
54
|
+
# e2e tests
|
|
55
|
+
$ pnpm run test:e2e
|
|
56
|
+
|
|
57
|
+
# test coverage
|
|
58
|
+
$ pnpm run test:cov
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
## Deployment
|
|
62
|
+
|
|
63
|
+
When you're ready to deploy your NestJS application to production, there are some key steps you can take to ensure it runs as efficiently as possible. Check out the [deployment documentation](https://docs.nestjs.com/deployment) for more information.
|
|
64
|
+
|
|
65
|
+
If you are looking for a cloud-based platform to deploy your NestJS application, check out [Mau](https://mau.nestjs.com), our official platform for deploying NestJS applications on AWS. Mau makes deployment straightforward and fast, requiring just a few simple steps:
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
$ pnpm install -g mau
|
|
69
|
+
$ mau deploy
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
With Mau, you can deploy your application in just a few clicks, allowing you to focus on building features rather than managing infrastructure.
|
|
73
|
+
|
|
74
|
+
## Resources
|
|
75
|
+
|
|
76
|
+
Check out a few resources that may come in handy when working with NestJS:
|
|
77
|
+
|
|
78
|
+
- Visit the [NestJS Documentation](https://docs.nestjs.com) to learn more about the framework.
|
|
79
|
+
- For questions and support, please visit our [Discord channel](https://discord.gg/G7Qnnhy).
|
|
80
|
+
- To dive deeper and get more hands-on experience, check out our official video [courses](https://courses.nestjs.com/).
|
|
81
|
+
- Deploy your application to AWS with the help of [NestJS Mau](https://mau.nestjs.com) in just a few clicks.
|
|
82
|
+
- Visualize your application graph and interact with the NestJS application in real-time using [NestJS Devtools](https://devtools.nestjs.com).
|
|
83
|
+
- Need help with your project (part-time to full-time)? Check out our official [enterprise support](https://enterprise.nestjs.com).
|
|
84
|
+
- To stay in the loop and get updates, follow us on [X](https://x.com/nestframework) and [LinkedIn](https://linkedin.com/company/nestjs).
|
|
85
|
+
- Looking for a job, or have a job to offer? Check out our official [Jobs board](https://jobs.nestjs.com).
|
|
86
|
+
|
|
87
|
+
## Support
|
|
88
|
+
|
|
89
|
+
Nest is an MIT-licensed open source project. It can grow thanks to the sponsors and support by the amazing backers. If you'd like to join them, please [read more here](https://docs.nestjs.com/support).
|
|
90
|
+
|
|
91
|
+
## Stay in touch
|
|
92
|
+
|
|
93
|
+
- Author - [Kamil MyΕliwiec](https://twitter.com/kammysliwiec)
|
|
94
|
+
- Website - [https://nestjs.com](https://nestjs.com/)
|
|
95
|
+
- Twitter - [@nestframework](https://twitter.com/nestframework)
|
|
96
|
+
|
|
97
|
+
## License
|
|
98
|
+
|
|
99
|
+
Nest is [MIT licensed](https://github.com/nestjs/nest/blob/master/LICENSE).
|
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
nestjs-repo-architecture/
|
|
2
|
+
ββ dist/
|
|
3
|
+
β ββ src/
|
|
4
|
+
β β ββ common/
|
|
5
|
+
β β β ββ auth/
|
|
6
|
+
β β β β ββ dto/
|
|
7
|
+
β β β β β ββ create-auth.dto.d.ts
|
|
8
|
+
β β β β β ββ create-auth.dto.js
|
|
9
|
+
β β β β β ββ create-auth.dto.js.map
|
|
10
|
+
β β β β β ββ update-auth.dto.d.ts
|
|
11
|
+
β β β β β ββ update-auth.dto.js
|
|
12
|
+
β β β β β ββ update-auth.dto.js.map
|
|
13
|
+
β β β β ββ jwt/
|
|
14
|
+
β β β β β ββ auth.guard.d.ts
|
|
15
|
+
β β β β β ββ auth.guard.js
|
|
16
|
+
β β β β β ββ auth.guard.js.map
|
|
17
|
+
β β β β β ββ constant.d.ts
|
|
18
|
+
β β β β β ββ constant.js
|
|
19
|
+
β β β β β ββ constant.js.map
|
|
20
|
+
β β β β β ββ jwt.guard.d.ts
|
|
21
|
+
β β β β β ββ jwt.guard.js
|
|
22
|
+
β β β β β ββ jwt.guard.js.map
|
|
23
|
+
β β β β β ββ jwt.strategy.d.ts
|
|
24
|
+
β β β β β ββ jwt.strategy.js
|
|
25
|
+
β β β β β ββ jwt.strategy.js.map
|
|
26
|
+
β β β β ββ role/
|
|
27
|
+
β β β β β ββ role.decorators.d.ts
|
|
28
|
+
β β β β β ββ role.decorators.js
|
|
29
|
+
β β β β β ββ role.decorators.js.map
|
|
30
|
+
β β β β β ββ role.enum.d.ts
|
|
31
|
+
β β β β β ββ role.enum.js
|
|
32
|
+
β β β β β ββ role.enum.js.map
|
|
33
|
+
β β β β β ββ role.guard.d.ts
|
|
34
|
+
β β β β β ββ role.guard.js
|
|
35
|
+
β β β β β ββ role.guard.js.map
|
|
36
|
+
β β β β ββ auth.controller.d.ts
|
|
37
|
+
β β β β ββ auth.controller.js
|
|
38
|
+
β β β β ββ auth.controller.js.map
|
|
39
|
+
β β β β ββ auth.module.d.ts
|
|
40
|
+
β β β β ββ auth.module.js
|
|
41
|
+
β β β β ββ auth.module.js.map
|
|
42
|
+
β β β β ββ auth.service.d.ts
|
|
43
|
+
β β β β ββ auth.service.js
|
|
44
|
+
β β β β ββ auth.service.js.map
|
|
45
|
+
β β β ββ http/
|
|
46
|
+
β β β β ββ http-client.module.d.ts
|
|
47
|
+
β β β β ββ http-client.module.js
|
|
48
|
+
β β β β ββ http-client.module.js.map
|
|
49
|
+
β β β β ββ http-client.service.d.ts
|
|
50
|
+
β β β β ββ http-client.service.js
|
|
51
|
+
β β β β ββ http-client.service.js.map
|
|
52
|
+
β β β ββ logger/
|
|
53
|
+
β β β β ββ error.logging.d.ts
|
|
54
|
+
β β β β ββ error.logging.js
|
|
55
|
+
β β β β ββ error.logging.js.map
|
|
56
|
+
β β β β ββ logging.interceptor.d.ts
|
|
57
|
+
β β β β ββ logging.interceptor.js
|
|
58
|
+
β β β β ββ logging.interceptor.js.map
|
|
59
|
+
β β β ββ notification/
|
|
60
|
+
β β β ββ notification.module.d.ts
|
|
61
|
+
β β β ββ notification.module.js
|
|
62
|
+
β β β ββ notification.module.js.map
|
|
63
|
+
β β β ββ notification.service.d.ts
|
|
64
|
+
β β β ββ notification.service.js
|
|
65
|
+
β β β ββ notification.service.js.map
|
|
66
|
+
β β ββ config/
|
|
67
|
+
β β β ββ db.d.ts
|
|
68
|
+
β β β ββ db.js
|
|
69
|
+
β β β ββ db.js.map
|
|
70
|
+
β β β ββ db.module.d.ts
|
|
71
|
+
β β β ββ db.module.js
|
|
72
|
+
β β β ββ db.module.js.map
|
|
73
|
+
β β β ββ env.validation.d.ts
|
|
74
|
+
β β β ββ env.validation.js
|
|
75
|
+
β β β ββ env.validation.js.map
|
|
76
|
+
β β ββ features/
|
|
77
|
+
β β β ββ kafka/
|
|
78
|
+
β β β β ββ kafka.consumer.controller.d.ts
|
|
79
|
+
β β β β ββ kafka.consumer.controller.js
|
|
80
|
+
β β β β ββ kafka.consumer.controller.js.map
|
|
81
|
+
β β β β ββ kafka.consumer.service.d.ts
|
|
82
|
+
β β β β ββ kafka.consumer.service.js
|
|
83
|
+
β β β β ββ kafka.consumer.service.js.map
|
|
84
|
+
β β β β ββ kafka.module.d.ts
|
|
85
|
+
β β β β ββ kafka.module.js
|
|
86
|
+
β β β β ββ kafka.module.js.map
|
|
87
|
+
β β β β ββ kafka.producer.service.d.ts
|
|
88
|
+
β β β β ββ kafka.producer.service.js
|
|
89
|
+
β β β β ββ kafka.producer.service.js.map
|
|
90
|
+
β β β ββ user/
|
|
91
|
+
β β β ββ core/
|
|
92
|
+
β β β β ββ dto/
|
|
93
|
+
β β β β β ββ create-user.dto.d.ts
|
|
94
|
+
β β β β β ββ create-user.dto.js
|
|
95
|
+
β β β β β ββ create-user.dto.js.map
|
|
96
|
+
β β β β β ββ update-user.dto.d.ts
|
|
97
|
+
β β β β β ββ update-user.dto.js
|
|
98
|
+
β β β β β ββ update-user.dto.js.map
|
|
99
|
+
β β β β ββ interface/
|
|
100
|
+
β β β β β ββ user.repository.interface.d.ts
|
|
101
|
+
β β β β β ββ user.repository.interface.js
|
|
102
|
+
β β β β β ββ user.repository.interface.js.map
|
|
103
|
+
β β β β ββ use-case/
|
|
104
|
+
β β β β ββ user.service.d.ts
|
|
105
|
+
β β β β ββ user.service.js
|
|
106
|
+
β β β β ββ user.service.js.map
|
|
107
|
+
β β β ββ inBound/
|
|
108
|
+
β β β β ββ user.controller.d.ts
|
|
109
|
+
β β β β ββ user.controller.js
|
|
110
|
+
β β β β ββ user.controller.js.map
|
|
111
|
+
β β β ββ outBound/
|
|
112
|
+
β β β β ββ user.repository.d.ts
|
|
113
|
+
β β β β ββ user.repository.js
|
|
114
|
+
β β β β ββ user.repository.js.map
|
|
115
|
+
β β β ββ user.module.d.ts
|
|
116
|
+
β β β ββ user.module.js
|
|
117
|
+
β β β ββ user.module.js.map
|
|
118
|
+
β β ββ utils/
|
|
119
|
+
β β β ββ validators/
|
|
120
|
+
β β β β ββ phoneNumber.validate.d.ts
|
|
121
|
+
β β β β ββ phoneNumber.validate.js
|
|
122
|
+
β β β β ββ phoneNumber.validate.js.map
|
|
123
|
+
β β β ββ crypt.d.ts
|
|
124
|
+
β β β ββ crypt.js
|
|
125
|
+
β β β ββ crypt.js.map
|
|
126
|
+
β β β ββ generate.d.ts
|
|
127
|
+
β β β ββ generate.js
|
|
128
|
+
β β β ββ generate.js.map
|
|
129
|
+
β β β ββ logging.prisma.d.ts
|
|
130
|
+
β β β ββ logging.prisma.js
|
|
131
|
+
β β β ββ logging.prisma.js.map
|
|
132
|
+
β β β ββ validation-fields.d.ts
|
|
133
|
+
β β β ββ validation-fields.js
|
|
134
|
+
β β β ββ validation-fields.js.map
|
|
135
|
+
β β β ββ validation-option.d.ts
|
|
136
|
+
β β β ββ validation-option.js
|
|
137
|
+
β β β ββ validation-option.js.map
|
|
138
|
+
β β ββ app.controller.d.ts
|
|
139
|
+
β β ββ app.controller.js
|
|
140
|
+
β β ββ app.controller.js.map
|
|
141
|
+
β β ββ app.module.d.ts
|
|
142
|
+
β β ββ app.module.js
|
|
143
|
+
β β ββ app.module.js.map
|
|
144
|
+
β β ββ app.service.d.ts
|
|
145
|
+
β β ββ app.service.js
|
|
146
|
+
β β ββ app.service.js.map
|
|
147
|
+
β β ββ main.d.ts
|
|
148
|
+
β β ββ main.js
|
|
149
|
+
β β ββ main.js.map
|
|
150
|
+
β ββ tsconfig.build.tsbuildinfo
|
|
151
|
+
ββ prisma/
|
|
152
|
+
β ββ schema.prisma
|
|
153
|
+
ββ src/
|
|
154
|
+
β ββ common/
|
|
155
|
+
β β ββ auth/
|
|
156
|
+
β β β ββ dto/
|
|
157
|
+
β β β β ββ create-auth.dto.ts
|
|
158
|
+
β β β β ββ update-auth.dto.ts
|
|
159
|
+
β β β ββ jwt/
|
|
160
|
+
β β β β ββ auth.guard.ts
|
|
161
|
+
β β β β ββ constant.ts
|
|
162
|
+
β β β β ββ jwt.guard.ts
|
|
163
|
+
β β β β ββ jwt.strategy.ts
|
|
164
|
+
β β β ββ role/
|
|
165
|
+
β β β β ββ role.decorators.ts
|
|
166
|
+
β β β β ββ role.enum.ts
|
|
167
|
+
β β β β ββ role.guard.ts
|
|
168
|
+
β β β ββ auth.controller.ts
|
|
169
|
+
β β β ββ auth.module.ts
|
|
170
|
+
β β β ββ auth.service.ts
|
|
171
|
+
β β ββ http/
|
|
172
|
+
β β β ββ http-client.module.ts
|
|
173
|
+
β β β ββ http-client.service.ts
|
|
174
|
+
β β ββ logger/
|
|
175
|
+
β β β ββ error.logging.ts
|
|
176
|
+
β β β ββ logging.interceptor.ts
|
|
177
|
+
β β ββ notification/
|
|
178
|
+
β β ββ notification.module.ts
|
|
179
|
+
β β ββ notification.service.ts
|
|
180
|
+
β ββ config/
|
|
181
|
+
β β ββ db.module.ts
|
|
182
|
+
β β ββ db.ts
|
|
183
|
+
β β ββ env.validation.ts
|
|
184
|
+
β ββ features/
|
|
185
|
+
β β ββ kafka/
|
|
186
|
+
β β β ββ kafka.consumer.controller.ts
|
|
187
|
+
β β β ββ kafka.consumer.service.ts
|
|
188
|
+
β β β ββ kafka.module.ts
|
|
189
|
+
β β β ββ kafka.producer.service.ts
|
|
190
|
+
β β ββ user/
|
|
191
|
+
β β ββ core/
|
|
192
|
+
β β β ββ dto/
|
|
193
|
+
β β β β ββ create-user.dto.ts
|
|
194
|
+
β β β β ββ update-user.dto.ts
|
|
195
|
+
β β β ββ interface/
|
|
196
|
+
β β β β ββ user.repository.interface.ts
|
|
197
|
+
β β β ββ use-case/
|
|
198
|
+
β β β ββ user.service.ts
|
|
199
|
+
β β ββ inBound/
|
|
200
|
+
β β β ββ user.controller.ts
|
|
201
|
+
β β ββ outBound/
|
|
202
|
+
β β β ββ user.repository.ts
|
|
203
|
+
β β ββ user.module.ts
|
|
204
|
+
β ββ utils/
|
|
205
|
+
β β ββ validators/
|
|
206
|
+
β β β ββ phoneNumber.validate.ts
|
|
207
|
+
β β ββ crypt.ts
|
|
208
|
+
β β ββ generate.ts
|
|
209
|
+
β β ββ logging.prisma.ts
|
|
210
|
+
β β ββ validation-fields.ts
|
|
211
|
+
β β ββ validation-option.ts
|
|
212
|
+
β ββ app.controller.spec.ts
|
|
213
|
+
β ββ app.controller.ts
|
|
214
|
+
β ββ app.module.ts
|
|
215
|
+
β ββ app.service.ts
|
|
216
|
+
β ββ main.ts
|
|
217
|
+
ββ test/
|
|
218
|
+
β ββ app.e2e-spec.ts
|
|
219
|
+
β ββ jest-e2e.json
|
|
220
|
+
ββ .dockerignore
|
|
221
|
+
ββ .env
|
|
222
|
+
ββ .env.example
|
|
223
|
+
ββ .env.production
|
|
224
|
+
ββ .gitignore
|
|
225
|
+
ββ .prettierrc
|
|
226
|
+
ββ aborescence.txt
|
|
227
|
+
ββ docker-compose-dev.yml
|
|
228
|
+
ββ docker-compose-prod.yml
|
|
229
|
+
ββ Dockerfile
|
|
230
|
+
ββ dockerfile.dev
|
|
231
|
+
ββ eslint.config.mjs
|
|
232
|
+
ββ nest-cli.json
|
|
233
|
+
ββ package.json
|
|
234
|
+
ββ pnpm-lock.yaml
|
|
235
|
+
ββ README.md
|
|
236
|
+
ββ tsconfig.build.json
|
|
237
|
+
ββ tsconfig.build.tsbuildinfo
|
|
238
|
+
ββ tsconfig.json
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
services:
|
|
2
|
+
|
|
3
|
+
delivery:
|
|
4
|
+
container_name: nestjs-archi-cli
|
|
5
|
+
build:
|
|
6
|
+
context: .
|
|
7
|
+
dockerfile: dockerfile.dev
|
|
8
|
+
ports:
|
|
9
|
+
- "3500:3500"
|
|
10
|
+
volumes: []
|
|
11
|
+
command: pnpm run start:dev -- --poll=1000
|
|
12
|
+
env_file:
|
|
13
|
+
- .env
|
|
14
|
+
environment:
|
|
15
|
+
# Pointe sur le broker Kafka exposΓ© par Server A
|
|
16
|
+
- KAFKA_BOOTSTRAP_SERVERS=kafka:9092
|
|
17
|
+
networks:
|
|
18
|
+
- kafka-network
|
|
19
|
+
networks:
|
|
20
|
+
kafka-network:
|
|
21
|
+
external: true
|
|
22
|
+
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
services:
|
|
2
|
+
|
|
3
|
+
delivery:
|
|
4
|
+
container_name: nestjs-archi-cli
|
|
5
|
+
image: konandev/nestjs-archi-cli :latest
|
|
6
|
+
build:
|
|
7
|
+
context: .
|
|
8
|
+
dockerfile: Dockerfile
|
|
9
|
+
target: production
|
|
10
|
+
ports:
|
|
11
|
+
- "3500:3500"
|
|
12
|
+
# command: pnpm run start:dev -- --poll=1000
|
|
13
|
+
env_file:
|
|
14
|
+
- .env.production
|
|
15
|
+
networks:
|
|
16
|
+
- prod
|
|
17
|
+
networks:
|
|
18
|
+
prod:
|
|
19
|
+
external: true
|
|
20
|
+
|