Challenge Overview

 

Project Overview

This project will build NodeJS REST APIs for TopCoder Platform.

Competition Task Overview

We have completed the REST API POC contests and this contest will refactor the framework and we plan to use it as base code to build more APIs.

Here is the existing POC code: https://github.com/cloudspokes/tc-api

This contest must complete following tasks:

  1. Change the overall architecture to use the actionhero.js framework
  2. The POC code use 4 configuration files (.profile, db_conf.json, config.js and strategy.js). Please switch to environment variables as described here: http://12factor.net/config
    • Remove all configuration files and only use environment variables.
    • Please provide initial support/documentation for dev (local), staging (heroku), and production environments.
    • Please provide two bash scripts to set the dev / heroku configuration values to environment variables.
  3. Use actionHero preprocessing for oauth.
  4. Move existing contest types api implementation into actionhero action and setup correct action hero routes.
  5. Create another actionhero action for contest types api and require oauth authentication in the route.
  6. Use the winston logger of actionhero. Add loggers at API group level instead of different loggers at controller level.
  7. Make all code pass jslint with nomen=true and use simple commeting instead of java style comments.
  8. Move the oauth demos into it's own completely separate /examples directory. The main app won't be hosting this any longer. (see passport-twitter example for reference - it provides a working example, but it does not rely on or work directly with the main repository)
  9. Remove crud.html and stored procedures. We don't want to use stored procedures in this project.
  10. Use json files to store the SQL instead of hard code it in source file. Note that node require can load JSON files with no problem (don't use fs.readFile or fs.readFileSync)
  11. Create a test directory. Add tests for the get contest types api. Use supertest (https://github.com/visionmedia/supertest) with mocha (http://visionmedia.github.io/mocha/). Don't install mocha globally.
  12. Remove the custom heroku buildpack. It's not needed after you complete #2.

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

Remote Database

Remote Informix Server: The existing APIs only need to retrieve the data from database so we provide a remote informix instance and you don't need to require VM in this contest.

Here is the VM connection information:

  • host: 50.17.156.219
  • user: informix
  • password: 1nf0rm1x
  • port: 2021
  • database: tcs_catalog

Testing

The refactored 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 verification steps of deployment guide must include the test steps and screenshots.

Technology Overview

  • JavaScript
  • Node.js
  • Action Hero


Final Submission Guidelines

Submission Deliverables

  • Updated Source Code and Tests
  • Deployment Guide

ELIGIBLE EVENTS:

2014 TopCoder(R) Open

Review style

Final Review

Community Review Board

Approval

User Sign-Off

ID: 30036043