I have a question about the structure and architecture of the NestJs project.
Can I move all the services into a separate module like a shared module and use him in all project?
src
├── apps
│ ├── admin // Modules admin CRUD,auth,services,config,payments
│ ├── student // Modules student API,auth,services
│ └── teacher // Modules teacher API,auth,services
├── common
│ ├── constants
│ ├── decorators
│ ├── exceptions
│ ├── guards
│ ├── helpers
│ ├── interfaces
│ ├── middlewares
│ └── validations
├── shared
│ ├── student
| │ ├── student.service.ts // Only data query service
| │ ├── student.module.ts
| │ ├── student.interface.ts
| │ ├── student.*.ts
| | └── index.ts
│ ├── teacher
| │ ├── teacher.service.ts // Only data query service
| │ ├── teacher.module.ts
| │ ├── teacher.interface.ts
| │ ├── teacher.*.ts
| | └── index.ts
│ └── [******]
├── app.controller.ts
├── app.module.ts
|── app.service.ts
└── main.ts
For exemple Student and Teacher,[****] has separated Prisma model
And i have sepeated modules for admin,student,techer and all api implement diferent controllers and service, all this separated modules use Prisma Model services
New contributor
Жамшид Нуманжанов is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.