Challenge Overview

Welcome to Topcoder Submissions API - Set It Up. As part of this contest, you will proceed to set up Topcoder’s submission related api.

 

Contest Details

Topcoder is starting to streamline its APIs and we are in the process of upgrading our existing APIs to version 5. One of the APIs is called Submission API. Kindly don’t confuse this with one of the resources in the Submission API, which is itself called Submission. The Submission API consists of 4 resources namely Submission, ReviewSummation, Review and ReviewType.

 

We first created the Swagger specification for these resources and then used Swagger Code Generator for Nodejs to build the code stub. We are now looking at creating the actual api - with database integration to allow users to make useful api calls and not just mock ones.

 

For this contest, we are only focussing on the Submission and ReviewType resources. Only these two resources are in scope. Go through the swagger specification for the project (that you can find in the project itself) and for each endpoint, update the existing stub to integrate with the database and actually implement all the endpoints for the two resources (as in, create should actually create data in the database, update should actually update data, etc).

 

Additionally, you will also fix / provide the following:

  • The endpoints need to return the id of the resource. Kindly update the swagger specification to reflect this too.

  • The id field will be a uuid. This is applicable to the memberId and challengeId fields as well. Id field in ReviewType table will be an integer. See below.

  • Note that there is a difference between the PUT and PATCH requests. Implement them accordingly.

  • For Review Types, you are required to insert values into the table (through a data insert script that will run only once for the database). Following are the names that you will insert (isActive will be true for all) and make sure that you follow the order mentioned below (id should begin with 1):

    • Screening

    • Checkpoint Review

    • Review

    • Appeals Response

    • Iterative Review

  • Authentication. Use jwt tokens to authorize the user. You can make use of Topcoder’s own module for this. You can find an example here.

 

Points To Note

  • We generated the code using Swagger Code Generator. We enhanced the POST /submissions api to conditionally upload submissions to Amazon S3. For this contest, you will NOT be using the generated code. You will instead create an app from scratch and work with Express and Swagger Node. Use standard as your linter. You have to copy the POST /submissions logic that exists over to the new app. For this scenario, you need to first do the upload, if the submission does not already have a url, and then proceed to create the entry into the database during submission creation.

  • While you are not expected to return all the http status codes for an endpoint, you are expected to use the status codes correctly.

  • The database to use would be AWS Dynamodb.

  • Use Nodejs version 8

  • Follow the swagger specification for implementation details of the endpoints. The existing code base has the specification defined in two places. Use the one in the ROOT folder.

  • You will be implementing authorization using json web tokens. You can use topcoder’s own module for this. Use the jwtAuthenticator middleware exported in this module.

Use Swagger UI to host the specification and to test the endpoints.

Final Submission Guidelines

Before submitting, please ensure that you have updated the Swagger specification. Zip and upload the code to Topcoder.

ELIGIBLE EVENTS:

2018 Topcoder(R) Open

Review style

Final Review

Community Review Board

Approval

User Sign-Off

ID: 30066990