Challenge Overview

Project Overview

In this project, we want to build the RESTful API to be used by TopCoder Direct and other TopCoder applications. The API will mainly focus on management of challenge like creating draft challenge, updating challenge, getting a list of active challenges etc. and management of direct project like creating new project, updating a project, getting project challenges.

The project will based on Java 6 and use Spring 3.2 framework.

Challenge Overview

This challenge will be the first setup of Direct API, you are required to set up the code base structure and implement a simple API for getting the challenges created by the request user.

Requirement Details

(1)Set up Direct API code base structure

The technology requirements

  • JDK version 6
  • Spring version 3.2.9 – Spring MVC with Rest support will be used to implement the REST API.
  • Spring Security 3.2.4 - http://projects.spring.io/spring-security/
  • Latest Jackson version compatible with Java 6 and Spring 3.2 (https://github.com/FasterXML/jackson) – for Json processing
  • Log4J 1.2.5 – for logging in the API
  • JUnit 4.7 – for unit testing
  • Maven – for managing project dependences, build, and deploy
  • Informix 11.5 – database which stores all the topcoder data
  • Tomcat sever - use as the app server to host the direct API

Code base structure

  • Source code folder (e.g. src) to put the main codes and test codes into
  • Maven build file in the top level

 

(2)Implement API for getting my created challenges

The API should be /direct/v1/challenges

It returns all the challenges created by request user. For each challenge, it should contain the common data in the following:

  • Challenge name
  • Challenge ID
  • Challenge Type / Category
  • Client Name / ID - optional
  • Billing Name / ID - optional
  • Direct Project Name / ID - optional, the draft challenge can have no direct project associated
  • Member Cost Data
    • Prizes (all the placements – from the prize table)
    • DR points
  • Challenge Technologies (multiple)
  • Challenge Platforms (multiple)
  • Challenge Start Date / time – use the registration phase start time
  • Challenge End Date / time – use the end date of last phase of the challenge

The API only allow logged on user to access.

Please configure / develop Spring Security Filter Chain by Spring Security OAuth 2.0.1 (http://projects.spring.io/spring-security-oauth) for this API.

The filter chain should take the authorization header from http request, use jwt (supported by Spring Security OAuth - check spring-security-oauth / spring-security-jwt) to verify the token and get the user handle / id from return value of jwt component.

The API implementation should develop a utility to read the query from plain text file to string. Follow the query naming conventions here: https://github.com/cloudspokes/tc-api/tree/master/queries

The utility class should have a helper method to take the query name and find the matched file in a folder, the folder path should be configured in a property file and injected into spring configuration file.

Please use Spring JDBC Query Template to run the query, develop Data Model and Result Mapper for this API.

For this API, we want the filtering feature – the following filters are required:

  • Type – active/past/draft
  • Challenge type
  • Technology (multiple)
  • Platform (multiple)
  • Direct Project ID
  • Direct Project Name
  • Challenge Status

For this API, we want pagination feature – the following pagination parameters are needed:

  • Page Size
  • Page Number

For ordering, we want to sort by challenge end date descending.

Http Response Code and Error Handling

200 - Success

401 - Unauthorized (anonymous user can't access my challenges api)

405 - Method Not Allowed (my challenges api only support GET method)

500 - Internal Server Error (any other errors)

Success Response Format

{

id: <backend_created_id>,

result: {

success: true|false,

status: 200,

content: {id:}

}

}

status--> http status code

id --> some id that is created in backend to use in future for frontend app and logging

Error Response Format

{

id: <backend_created_id>,

result: {

success: false,

status: 400,

content: {<error_message>}

debug: {

detail: <detailed_message>

stackTrace: <stack_trace>

}

}

}

status-->http status code
id-->some id that is created in backend to use in future for frontend app and logging
debug-->debug information

Environment Setup

The tomcat should be setup in your local environment for development, for the informix database, you can either setup the informix 11.5 database at your local environment or request a VM to use the informix database on VM remotely.

VM Environment:

If You need a TopCoder VM which has informix database setup to work on this challenge, please request the VM in the challenge forum.

Information about VM can be found below:

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 new TopCoder image. To request your image, please use the 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.



Final Submission Guidelines

  • Deployment Guide with the details on setup the local development environment
  • Source Code
  • Test Data

REVIEW STYLE:

Final Review:

Community Review Board

Approval:

User Sign-Off

SHARE:

ID: 30043889