Using generators
To make the process of adding new components we have prepared several generators using Turborepo code generation features.
You can launch these generators by running
npm run generate
at the root level of the project, after which you will be asked which generator you want to use.
API Harmonization
You can create a new module within the api-harmonization
app by using api-component
generator. It will:
- Create a new folder in the
apps/api-harmonization/src/components
directory. - Inside this new folder, it will create all the necessary files that compose a module:
- module,
- controller,
- service,
- mapper,
- model and request.
- It will also add this new component to the
app.module.ts
file inside theimports
section so that Nest.js could include it.
Frontend
To create a new container within the frontend
app, you can choose the frontend-component
generator. It will:
- Create a new folder in the
apps/frontend/src/containers
directory. - Inside this new folder, it will create all the necessary files that compose a container:
- server component,
- client component,
- renderer,
- typings.
UI
To create a new container within the ui
package, you can choose the ui-component
generator. It will:
- Create a new file in the
packages/ui/src/components
directory.
Integrations
You can also create a whole new integration by using the integration
generator, which will:
- Ask you which modules you want included in the integration.
- Create a new folder in the
packages/integrations
directory. - Initialize a new project for this new integration, with all the necessary files (like
package.json
, linter and prettier configs, and so on). - For each module you chose, it will create appropriate folder within the
packages/api/integrations/src/module
directory. - Inside those folders it will create the necessary files that compose a module:
- controller,
- service,
- mapper.