Register
Submit a solution
The challenge is finished.

Challenge Overview

 

Project Overview

This project will build NodeJS REST APIs for TopCoder Platform.

Competition Task Overview

The existing contest retrieval api is writtin by Java with query tool and we are going to move it to NodeJS.

We have developed a NodeJS framework with actionHero and provide two examples API. They are same API but one for public access and another one require OAuth.

Code Base: https://github.com/cloudspokes/tc-api

This contest should implement two public contest retrieval APIs:

API Specification: http://docs.tcapi.apiary.io/

  • Search Contests
  • Get Contest Detail

Parameterized queries

This contest must update the existing framework to support the parameterized queries.

It needs to support sorting, paging and input parameters to the query. It should report error when required parameter is missing.

You need to modify dataAccess to pass in the parameters, change the queries to use the ? format, make sure it works and protect against sql injection.

This is an important feature and will be reused by many other APIs so please provide Unit Tests (use mocha - already setup in github codebase) in this contest.  

Exception Handling

When some server error occurs, it will throw exception to end user directly.

It should follow the error codes responses here and return json error message

https://dev.twitter.com/docs/error-codes-responses

config.apiCodes = {
OK : {name : 'OK', value : 200, description : 'Success' },
notModified : {name : 'Not Modified', value: 304, description : 'There was no new data to return.' },
badRequest : {name : 'Bad Request', value: 400, description : 'The request was invalid. An accompanying message will explain why.' },
unauthorized : {name : 'Unauthorized', value: 401, description : 'Authentication credentials were missing or incorrect.' },
forbidden : {name : 'Forbidden', value: 403, description : 'The request is understood, but it has been refused or access is not allowed.' },
notFound : {name : 'Not Found', value: 404, description : 'The URI requested is invalid or the requested resource does not exist.' },
serverError : {name : 'Internal Server Error', value: 500, description : 'Something is broken. Please contact support.' }
};
with an optional "message" parameter for more details

Existing Java Code (Just for Reference)

platform api: https://coder.topcoder.com/tcs/clients/cronos/applications/tc_platform_api/trunk

queries: https://coder.topcoder.com/internal/database/scripts/trunk/tcs_catalog/query_tool/ query_restapi_*.txt

Heroku Deployment

The submission must be deployed on Heroku, any submission which can't be deployed on heroku successfully will be failed in screening phase - primary reviewer must check this

You can request a VM with informix installed.

Virtual Machine (VM)

VM specific information is found here: http://www.topcoder.com/wiki/display/docs/VM+Image+2.5

Upon registration as a submitter or reviewer you will need to request a VM based on the TopCoder systems image. The VM will be active through aggregation review, after which it will be terminated except for the winner's and the reviewers'. To request your image, please post in contest forum.

Before requesting your VM, you need to ensure that you have an SSH key created and in your member profile. Instructions to do so are here: http://www.topcoder.com/wiki/display/projects/Generate+SSH+Key, and instructions to connect afterwards are here: http://www.topcoder.com/wiki/display/projects/Connect+Using+SSH+Key.

Please realize that VMs are currently issued manually. We make every attempt to issue the VM as soon as it is requested, however, there may be delays of up to 12 hours depending on time of day when you request. We encourage everyone to request a VM as soon as possible to minimize any such delays.

VMs will be granted only during registration phase!

Review Board Requirement:

Reviewers need to write Supertest tests for the two APIs.

There are three roles:

  • Accuracy - Tests the implementation on the accuracy of the results when using the component.
  • Failure - Tests the implementation's ability to handle bad data and incorrect usage.
  • Security - Tests the oauth, sql inject and other security related requirements.

Reviewer could send preferred role by Contact Manager after system selected the reviwer.

Copilot will assign the role to reviewers if reviewer didn't send the preferred role information.

Reviewer must create pull request from GitHub for the tests.

Technology Overview

  • JavaScript
  • Node.js
  • Action Hero


Final Submission Guidelines

  • Source File
  • Deployment Guide
  • Test File
  • Unit Tests for Paramatirization Features
  • Winner must create pull request against the main github repo in final fix phase.

ELIGIBLE EVENTS:

2014 TopCoder(R) Open

Review style

Final Review

Community Review Board

Approval

User Sign-Off

ID: 30036150