Challenge Overview
Project Overview
TopCoder and the TopCoder community have worked hard to get the platform to its currently level of maturity, but we're far from done. It's time to take the platform to the next level. TopCoder is going to start taking some steps to open up the platform API to the outside and community developers so they could incorporate it in their websites, applications or build their own applications (web, mobile or desktop).
The ultimate goal is to open up and build an "API" that is targeting all different type of audiences - Software and Studio Competitors, SRM/MM competitors, Copilots, Admins and TopCoder partners - each audience will have different interests and usages of the API, so it will be a huge project and we need to make sure that we are in the right direction from the beginning.
Competition Task Overview
The current implementation use hibernate to query the data from database and this contest should move the query to query tool and remove hibernate and dependency components.
Scope:
Get all contest catalogs - /contestCatalogs- Get all contest types - /contestTypes
Get contest types for a contest catalog - /contestCatalogs/{catalogName}/contestTypes
Move queries from the component to the query tool, it means stop using tc_refactoring components (drop both components tc_refactoring_stage_1_review_and_search_services and tc_refactoring_stage_1_contest_services), move validation to the rest services and queries to query tool.
(Search Contest API will be moved in other contest so you can still keep the components in this contest but don't use that for the three listed APIs of this contest)
This also means queries needs to be rewritten, because filtering, pagination will be part of query, and all of them are optional. so queries need to be rewritten to include the optional fields in WHERE clause. In current components they are appended to query only if they are present, that is cannot be done when using query tool because the query in query tool cannot be changed from code level, so the filter parameters used by the API should be part of the query and should have default values or excluded from query if field not passed.
Note: the performance is very important for this contest. Please try to optimize the query.
You can play the current API here:
https://dev.topcoder.com/docs (you can find your key in "My Dashboard")
We find some issues in current API implementation, but make sure the rewritten queries in query tool doesn't have such issue, you should also test the API with other parameters to make sure it work as expected.
No Result search catalogs: https://apps.topcoder.com/bugs/browse/TCAPI-9Server Error when searchs by catalog: https://apps.topcoder.com/bugs/browse/TCAPI-43
You also need to verify this API with other parameters to make sure it work as expected.
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
Testing
You need to provide manual steps to verify your submission.
Existing Code
(Please send your request to subversion@topcoder.com if you don't have access)
tc_refactoring_stage_1_contest_services: https://coder.topcoder.com/tcs/clients/cronos/components/tc_refactoring_stage_1_contest_services/trunk
tc_refactoring_stage_1_review_and_search_services: https://coder.topcoder.com/tcs/clients/cronos/components/tc_refactoring_stage_1_review_and_search_services/trunk
web_module: https://coder.topcoder.com/internal/web_module/trunk
platform api: https://coder.topcoder.com/tcs/clients/cronos/applications/tc_platform_api/trunk
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!
Set up and Deploy API
The contestants are also required to update active docs and integrate the new APIs to 3scale. This set of APIs should be deployed in its own war.
Refer to this document to deploy the API locally or on VM
https://coder.topcoder.com/tcs/clients/cronos/applications/tc_platform_api/trunk/doc/APIDG.docx
Refer to this document to setup 3scale integration
https://coder.topcoder.com/tcs/clients/cronos/applications/tc_platform_api/trunk/doc/3scale_DeploymentGuide.doc
Refer to this document for details about Active Docs deployment
https://coder.topcoder.com/tcs/clients/cronos/applications/tc_platform_api/trunk/doc/ActiveDocs_DG.doc
Final Submission Guidelines
N/A