- apps/ // Where all apps are located, you MUST NOT create new apps by yourself, it is a decision for the whole team to make
- libs/ // Where all the code of the apps is located
- *.controller // The controllers are the place where routes are exposed. Controllers MUST NEVER import other controllers
- *.service // The services contains all the effective code of the app, they are imported by controllers and can be imported in other services IF it is required and doesn't create a circular dependency
- prisma/
- client/ // The prisma clients allows communications with the databases
- schema/ // The prisma schemas define how the databases are shaped
- secrets/ // The folder used for secrets that cannot be contained in the .env file (such as cert files)
- .env // All secrets that can be contained in the environment variabled of the production machine
It is highly discouraged to edit any other file since this repository is managed by NX and editing any of these files might break our NX Cloud configurations
npx nx g @nx/nest:library
demo.service
)Root: libs/demo.service
)demo.service
folder inside libs/
src/lib/
demo.service.ts
demo.service.spec.ts
demo.service.module.ts
that have been generated by the previous command, export your newly created service. Note: on this file you can also import other services, but you need to be careful of not creating circular dependenciesnpx nx g @nx/nest:library
demo.controller
)Root: libs/demo.controller
)demo.controller
folder inside libs/
src/lib/
demo.controller.ts
and demo.controller.spec.ts
demo.controller.module.ts
that have been generated by the previous command, add to the controllers your newly created controller and import the services you need. Note: Controllers MUST NEVER import other controllersapps/api
)src/app
app.module.ts
, import your new controller’s module (ex: DemoModule
for the demo controller)