Challenge Overview
Challenge Objectives
-
Write tests for an existing API
-
Publish events to kafka based on incoming api requests
-
Create a docker based deployment for the app
Project Background
-
Topcoder has been upgrading its backend services
-
One of the services is the newsletter preferences api
-
We are upgrading it to version 5
Technology Stack
-
Swagger (version 2) - This is only needed to understand the API definitions and not needed for this contest
-
Nodejs (version 10)
-
Mailchimp (API version 3)
-
Dynamodb
Code access
We will share the code in the contest forum.
Individual requirements
Write tests (Major Requirement)
-
Write tests for the existing API.
-
Write both unit tests and e2e tests
-
Use mocha and chai.
-
Your code coverage should be more than 80%
-
Write tests for the event publishing feature too, which is introduced as part of this contest
Publish events to Kafka (Major Requirement)
-
When a request comes in, to get preferences or update preferences, once the necessary action has been carried out, publish a corresponding event to the Bus API. This API has a wrapper module that you can find here.
-
The Bus API publishes events to Topcoder’s internal Kafka based streaming system.
-
You can find an example call using the wrapper here.
-
More details, about the event data to be published will be shared in the contest forum.
-
HEAD requests do not need to be published.
-
Publish events just before the API responds to the request.
Provide docker based deployment (Minor Requirement)
-
Right now, we can deploy the app locally.
-
We would instead like to deploy the app through docker.
-
Note that we currently have a docker compose file for deploying dynamodb locally. You are NOT expected to include this as part of your deployment. You can assume that we will be connecting with Dynamodb hosted on AWS. Connecting to the docker based dynamodb instance is purely optional.
-
The docker based deployment is expected to allow us to deploy the app through docker and connect to the API including interaction with MailChimp and publishing to Kafka. POSTMAN based verification should continue to work (with updates to the host url perhaps, which is assumed to have been carried out by the user).
Deployment guide and validation document
Update the deployment guide with instructions on running tests as well as deployment using docker.
Important Notes
-
Ensure that there are no lint errors
-
For reference, you can use the submission api code base which was also used as reference when we wrote the swagger specification for the app as well the api implementation.
-
Follow existing conventions used in the app.
Final Submission Guidelines
Zip your code base and upload it to Topcoder.