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 member statistics APIs:
API Specification: http://docs.tcapi.apiary.io/
- Software Member Statistics - /v2/develop/statistics/{handle}
- Studio Member Statstics - /v2/design/statistics/{handle}
We will provide the API queries with sql test cases.
Your task is build the rest services for the two APIs with the query provided and test them.
It's important for following the approach in existing code and reuse the common part. e.g. dataAccess Helper.
You must convert the sql test cases to mocha unit tests for the two APIs.
Tests must follow this standard: https://www.topcoder.com/tc?module=ProjectDetail&pj=30036437
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
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.
Note: Tests must follow this standard: https://www.topcoder.com/tc?module=ProjectDetail&pj=30036437
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
- Winner must create pull request against the main github repo in final fix phase.