An example of structuring app business logic using Oja actions.
This demo application demonstrates how application business logic can be structured into independent, shareable actions that can be tested independently and later used to compose more complex actions/pages/responses.
The application uses code generation to automate action and component creation and that includes unit tests generation as well.
cd examples
yarn
yarn test
node .
To speed up the process of creating new actions and controllers and required unit tests, the application uses (https://github.com/eBay/oja/blob/master/packages/hygen-oja-generators#readme), a hygen code generation plugin.
Once you install the templates, you can start extending them with your own templates.
npm install hygen -g
npm install hygen-add -g
cd <your app dir>
hygen-add oja-generators
hygen oja init
hygen action new <action namespace> [--target <target dir>]
# example
# hygen action new consumer/buy