- First you must have Yeoman installed globally
npm install -g yo
- To link the generators locally use command
npm link
- To check the available generators use command
yo --generators
- This command will generate all the basic files needed for the boilerplate code
- To generate new micro-service use command
yo softobiz-ms app
- Enter the necessary information when prompted
-
This command will generate all the files you need to create Rest-API
-
To generate Rest-API use command
yo softobiz-ms:rest <name> [options]
yo softobiz-ms:rest Product
- domain
- model
- mapper
- irepository
- sql-repositories
- dto
- error
- command
- query
- controller
- use-cases-module
- Domain layer includes Aggregate-root, Entity and Value Objects.
- Follow the same naming convention for all cli-commands.
-
To generate aggregate use command
yo softobiz-ms:aggregate <name> [options]
Alias Option Description Default -h --help # Print the generator's options and usage --skip-cache # Do not remember prompt answers false --skip-install # Do not automatically install dependencies false --force-install # Fail on install dependencies error false -p --parent # The optional sub folder inside domain folder in which the template needs to be generated Arg Name Description Type Required name The name of the object that needs to be created String true yo softobiz-ms:aggregate Product
-
To generate entity use command
yo softobiz-ms:entity <name> [options]
Alias Option Description Default -h --help # Print the generator's options and usage --skip-cache # Do not remember prompt answers false --skip-install # Do not automatically install dependencies false --force-install # Fail on install dependencies error false -p --parent # The optional sub folder inside domain folder in which the template needs to be generated Arg Name Description Type Required name The name of the object that needs to be created String true yo softobiz-ms:entity Product
yo softobiz-ms:entity images -p Product
-
To generate value-object use command
yo softobiz-ms:valueObject <name> [options]
Alias Option Description Default -h --help # Print the generator's options and usage --skip-cache # Do not remember prompt answers false --skip-install # Do not automatically install dependencies false --force-install # Fail on install dependencies error false -p --parent # The optional sub folder inside domain folder in which the template needs to be generated Arg Name Description Type Required name The name of the object that needs to be created String true yo softobiz-ms:valueObject Product
yo softobiz-ms:valueObject dimension -p Product
- This layer includes models, mappers, irepositories, sql-repositories.
- Follow the above order to create infrastructure layer commands.
- Follow the same naming convention for all cli-commands.
-
To generate a new model use command
yo softobiz-ms:model <name> [options]
Alias Option Description Default -h --help # Print the generator's options and usage --skip-cache # Do not remember prompt answers false --skip-install # Do not automatically install dependencies false --force-install # Fail on install dependencies error false Arg Name Description Type Required name The name of the object that needs to be created String true yo softobiz-ms:model Product
-
To generate a new mapper use command
yo softobiz-ms:mapper <name> [options]
Alias Option Description Default -h --help # Print the generator's options and usage --skip-cache # Do not remember prompt answers false --skip-install # Do not automatically install dependencies false --force-install # Fail on install dependencies error false Arg Name Description Type Required name The name of the object that needs to be created String true yo softobiz-ms:mapper Product
-
To generate a new irepository use command
yo softobiz-ms:irepository <name> [options]
Alias Option Description Default -h --help # Print the generator's options and usage --skip-cache # Do not remember prompt answers false --skip-install # Do not automatically install dependencies false --force-install # Fail on install dependencies error false Arg Name Description Type Required name The name of the object that needs to be created String true yo softobiz-ms:irepository Product
-
To generate a new sql-repositories use command
yo softobiz-ms:sql-repositories <name> [options]
Alias Option Description Default -h --help # Print the generator's options and usage --skip-cache # Do not remember prompt answers false --skip-install # Do not automatically install dependencies false --force-install # Fail on install dependencies error false Arg Name Description Type Required name The name of the object that needs to be created String true yo softobiz-ms:sql-repositories Product
- This layer includes dto, error, commands, query, controller, use-cases-module.
- Follow the same naming convention for all cli-commands.
-
To generate a new dto use command
yo softobiz-ms:dto <name> [options]
Alias Option Description Default -h --help # Print the generator's options and usage --skip-cache # Do not remember prompt answers false --skip-install # Do not automatically install dependencies false --force-install # Fail on install dependencies error false Arg Name Description Type Required name The name of the object that needs to be created String true yo softobiz-ms:dto Product
-
To generate a new error-file use command
yo softobiz-ms:error <name> [options]
Alias Option Description Default -h --help # Print the generator's options and usage --skip-cache # Do not remember prompt answers false --skip-install # Do not automatically install dependencies false --force-install # Fail on install dependencies error false Arg Name Description Type Required name The name of the object that needs to be created String true yo softobiz-ms:error Product
-
To generate a new command use-
yo softobiz-ms:command <name> [options]
Alias Option Description Default -h --help # Print the generator's options and usage --skip-cache # Do not remember prompt answers false --skip-install # Do not automatically install dependencies false --force-install # Fail on install dependencies error false -c --command # The optional sub command inside commands folder in which the template needs to be generated Arg Name Description Type Required name The name of the object that needs to be created String true yo softobiz-ms:command Product
yo softobiz-ms:command update -c Product
-
To generate a new query use command-
yo softobiz-ms:query <name> [options]
Alias Option Description Default -h --help # Print the generator's options and usage --skip-cache # Do not remember prompt answers false --skip-install # Do not automatically install dependencies false --force-install # Fail on install dependencies error false -q --query # The optional sub query inside queries folder in which the template needs to be generated Arg Name Description Type Required name The name of the object that needs to be created String true yo softobiz-ms:query Product
yo softobiz-ms:query getAll --q Product
-
To generate a new controller use command
yo softobiz-ms:controller <name> [options]
Alias Option Description Default -h --help # Print the generator's options and usage --skip-cache # Do not remember prompt answers false --skip-install # Do not automatically install dependencies false --force-install # Fail on install dependencies error false Arg Name Description Type Required name The name of the object that needs to be created String true yo softobiz-ms:controller Product
-
To generate a new use-cases-module use command
yo softobiz-ms:use-cases-module <name> [options]
Alias Option Description Default -h --help # Print the generator's options and usage --skip-cache # Do not remember prompt answers false --skip-install # Do not automatically install dependencies false --force-install # Fail on install dependencies error false Arg Name Description Type Required name The name of the object that needs to be created String true yo softobiz-ms:use-cases-module Product