Key Information

Register
Submit
The challenge is finished.

Challenge Overview

Welcome to the IBM Castle Contacts in CouchDB contest. As part of this contest, you will need to create CRUD endpoints for the Contacts resource in CouchDB.

 

In case your submission gets a score greater than 93, we will aware you an additional $200 - up to three submissions.

 

Project Overview

This project is the foundation for a complex, enterprise email, calendaring, and messaging system.  We will be building a full fledged email application and an API server to allow multiple clients to interface with it.

 

Contest Details

We have a Nodejs application named “Castle” that has been built using Strongloop’s loopback framework. We wish to enhance this application by creating a new model named “Contacts” in CouchDB and creating CRUD endpoints to work with this model. Only the backend needs to be updated with these endpoints. There is no front end change in scope for this contest.

 

The schema for this model is:

 

{

   "imgSrc": String,

   "firstName" String,

   "lastName": String,

   "email": String,

   "phone": String

}

 

You need to provide the following endpoints:

 

  1. GET /contacts - This will return all contacts details

  2. GET /contacts/{contactId} - This will return the contact details of the requested contactId.

  3. POST /contacts - You will use this endpoint to create a new contact

  4. PUT /contacts/{contactId} - This endpoint allows the user to update an existing contact

  5. DELETE /contacts/{contactId} - Deletes the contact associated with contactId.

 

For all endpoints:

  1. Return appropriate HTTP status codes depending on the success or failure of the request.

  2. In case of creating a new contact, return the newly created contact’s id.

  3. When returning the contact details, return all the attributes of the contact. The _rev field can be omitted.

 

For each of the above endpoints, you are required to:

  1. Allow CouchDB to generate the id for the contacts.

  2. Update the Unit Tests accordingly. Add new tests as required.

  3. Update the test data generator to create dummy contacts in CouchDB. For the image attribute, you can use the existing set of contact pictures found in the client/i/contact-pics folder.

  4. Ensure that the AirBnb linter does not throw errors. Do not add exceptions to the linter

  5. Update the Swagger Specification present in the application for the above endpoints. Do not make updates to any other endpoints.

  6. Ensure that you don’t break any other endpoints. Just work on the endpoints mentioned above.

  7. Ensure that the endpoints show up correctly in the API Explorer view of Loopback

 

Additionally, kindly note the following:

  1. You need to use AirBnb’s ESLinter for both javascript code style and checks. This already exists in the existing code base. Make sure that you verify that your submission is free from any warnings and errors. This is only for the javascript aspects of the code. DO NOT add any exceptions to the linter.

  2. You can use loopback-connector-couch and follow the official documentation on the topic. You can also check out how some of the existing endpoints are interacting with CouchDB.



Final Submission Guidelines

Kindly make sure that before uploading your submission, it:

  1. Meets the requirements mentioned above.

  2. Passes all the lint checks using the ESLint rules that we mentioned

  3. Implements all the endpoints requested

  4. Has all tests running successfully. Update any tests based on the new endpoints added.

 

Once you are ready, create a .zip file of the submission and upload this through the Submit and Review tool for this contest.

 

ELIGIBLE EVENTS:

2016 TopCoder(R) Open

REVIEW STYLE:

Final Review:

Community Review Board

Approval:

User Sign-Off

SHARE:

ID: 30053689