Key Information

Register
Submit
The challenge is finished.

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.

In this contest, we are going to create the Stub APIs which is defined in the blueprint doc and add general caching support for API calls.

Competition Task Overview

Please raise questions as quick as you can, I am familiar with related database and code base, I can provide as much support as I can.

The updated code must still deploy and work on heroku - any submission which can't be deployed on heroku successfully will be failed in screening phase - primary reviewer must check this.

The implementation will base on the node.js version of TC platform API - https://github.com/cloudspokes/tc-api. Please follow the existing actionhero pattern for your development.

Create Stub APIs

This is going to create the Stub APIs which is already defined in  blueprint doc .  The real implementation will come after.

You should follow the same implementation patterns that is currently code base. 

API Cache Support

We'd like to add caching support for API calls to reduce the traffic to backend database.

This should be a general solution for all APIs, basically it's just add a config value for default cache expiration, and then for every call look at the request url as the cache key, and retrieve the result in teh cache. if it's not there, run the query and save it to the cache.

We'd better use the preprocessor and postprocessor middleware logic to implement the API calls, same API calls with different parameters will be considered as different cache key, so you'd better formalize the data.

We also need a specific configuration that controls each API to use cache or not, and controls the cache expiration for each API call. like some API, like member registration API, we don't what it be cached, it should always hit the backend system.

for caching, actionhero has redis already built in, it exposes api.cache.save, api.cache.load, and api.cache.destroy. Please reference actionhero documentation for details.

Configurations

In the previous changes for API framework, we are removing configuration files. and use environment variables as described here: http://12factor.net/config

  • Please update initial support/documentation for dev (local), staging (heroku), and production environments.
  • Please update two bash scripts to set the dev / heroku configuration values to environment variables (see deploy directory)

API Docs

Blueprint is a simple way of documenting APIs using Markdown. See:

http://apiblueprint.org/
https://github.com/apiaryio/api-blueprint
https://github.com/apiaryio/api-blueprint/blob/master/Tutorial.md

We want to start using it for the TC API:

http://docs.tcapi.apiary.io/
https://github.com/cloudspokes/tc-api/blob/master/apiary.apib

Testing

Please provide testing to make sure the Caching logic is working as expected.

The API Framework supports tests. Use supertest with mocha. Don't install mocha globally.

Code Format

All code must pass jslint. You may use "nomen: true".

Winner Only

Winner will create pull request against the main github repo in final fix phase and merge the code.

Virutal Machines (VMs)

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.

Review Board Requirements

Reviewers need to write Supertest tests for the 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

Documentation Provided

Please check the deployment guide in codebase for reference.



Final Submission Guidelines

Submission Deliverables

A complete list of deliverables can be viewed in the TopCoder Assembly competition Tutorial at: http://apps.topcoder.com/wiki/display/tc/Assembly+Competition+Tutorials

Below is an overview of the deliverables:

  • Source Code.
  • Deployment guide to configure and verify the application.

Final Submission

For each member, the final submission should be uploaded to the Online Review Tool.

ELIGIBLE EVENTS:

2014 TopCoder(R) Open

REVIEW STYLE:

Final Review:

Community Review Board

Approval:

User Sign-Off

SHARE:

ID: 30036294