Challenge Overview
Challenge Objectives
-
Create a wrapper for an api in nodejs
Project Background
-
The overall project is about creating an Amazon Alexa Skill for allowing users to know more about cinemas located near them and the movies playing in the cinemas
-
The skill allows users to also book movie tickets
Technology Stack
-
Nodejs version 10
Code access
This is the first contest in the series and thus there is no code base to share
Individual requirements
Create a wrapper for an api in nodejs (Major Requirement)
-
We will share a PDF file in the contest forum along with a POSTMAN collection.
-
The PDF file contains different endpoints, for which you will need to create a wrapper
-
The “Wrapper” will be a nodejs module that will be used instead of directly making HTTP calls to the api. The wrapper will expose methods that will be used in place of the direct http calls
Provide documentation for the wrapper (Major Requirement)
-
After creating the wrapper for the endpoints in scope, you need to provide a documentation for it
-
The expectation from the documentation is any developer that installs this wrapper as a nodejs module in their application is able to follow the documentation and determine how to use the wrapper to make requests to the api
Provide tests for the wrapper (Minor Requirement)
-
Provide tests for the endpoints added to the wrapper
-
You will use mocha and chai for testing
-
Use nock to mock the api requests. Do not make actual api calls.
-
This point alone is a major requirement - your tests will NOT test the api itself. Your tests will only test if the wrapper works correctly or not. You are not expected to test if the api itself works correctly.
-
You need to provide unit tests with a code coverage of 80% or more.
Deployment guide and validation document
There is no “deployment guide” needed for this wrapper. Instead, we are looking for a good documentation on how to install the wrapper as well as how to use it. Please refer to the submission api wrapper that we would like you to use as a reference.
Important Notes
-
Use async await pattern
-
Use standard as your linter. Ensure there are no lint errors in your submission.
-
Typescript is not allowed. No build or compilation of code is expected
-
Check out the documentation of the submission api wrapper in particular - we are expecting the documentation to be on the same lines.
-
Some endpoints of the api expect authorization. These will be passed to the wrapper either during instantiation or during method call - support both variations.
-
You need to use the PDF file as reference. If there is a discrepancy between the behaviour of the postman collection v/s what is defined in PDF file, kindly use the PDF file as the source of truth (and let us know in the contest forum).
-
The wrapper is not expected to validate that all the fields / attributes that a request needs are provided. It’s task is to only expose helper methods.
Final Submission Guidelines
You can submit a zip file for the wrapper and upload your submission to Topcoder