Register
Submit a solution
The challenge is finished.

Challenge Overview

Welcome to the Kraken Enhancement Nodejs Challenge. This challenge is to enhance our existing middleware application codenamed The Kraken.

 

Project Overview

We have a middleware application codename The Kraken. This middleware application is responsible to call multiple services depending on the nature of a JSON payload passed to it.

 

Challenge Details

Firstly, our Kraken application needs some L.O.V.E. It currently suffers from if-else-ititis and callback hell. We would like you to improve the code. Cure our application of multiple if else statements and callback hell issues. A possible approach would be to use the async library or the bluebird library.

 

Secondly, our Kraken application will need to parse the JSON payload that is passed to it - remember that Kraken is a middleware application after all - and call a service depending on the value of a single property - responses.action (See the sample JSON payload provided in the challenge forums).

 

Depending on the value of this property, you will proceed to call any service. The list of services to call as part of this challenge is restricted to just one - The Einstein service.

 

The Einstein service has been developed. We will share this service with you in the challenge forums. This service has multiple publicly available methods.

 

Depending on the value present in the response.action property of the payload, you need to call the relevant methods.


We will also share the mapping between the values of the response.action property and the relevant method of the Einstein service to call.

 

Finally, we want you to enhance the Kraken application with unit tests. It does not contain any currently and we would like you to develop them.

 

Note that, once the Kraken gets the information from the services, it passes them on to a channel named MQTT. This should continue to happen. Kindly do not remove this. See the existing code for more information.

 

Dynamically calling the service

For the second requirement about calling the relevant method of the Einstein service, we would like to remind you that the Kraken application is expected to work with many other services in the future.

Thus, we would like your solution to be as modular as possible. Do not repeat your code when calling the relevant service’s methods. Provide a solution that makes it easy to integrate new services. Dynamically decide which service to call based on the value of the response.action property

Think of it this way - if tomorrow, the client wishes to add a new mapping between a new action value and a service, they should be able to easily insert the new action value to look for and the relevant service and method to call.



Final Submission Guidelines

  1. Our code is hosted in Gitlab. You can self add yourself using the link provided in the forum.

  2. Create a fork and work on your fork.

  3. Submit the application in a zip file. You can also submit the git patch. Upload it to the Submit and Review tool for this challenge

  4. The winning submission will be asked to create a pull request.

  5. No video required for this challenge

ELIGIBLE EVENTS:

2016 TopCoder(R) Open

Review style

Final Review

Community Review Board

Approval

User Sign-Off

ID: 30052047