Challenge Overview
In this project, we want to add the ability to create new direct project to the projects endpoint of Direct REST API.
Challenge Requirements Details
1) Update tech-core
The Direct API bases on tech-core library , but ApiController.java does not have method to handle POST request to create a resource, please update the class to add the method. It should call RESTPersistentService.java do create the resource. The updates will be used in Requirement (2) Add Create New Project API
2) Add Create New Project API
- The create new project API should be added to the endpoint /direct/v2/projects
- The existing Project model in Direct API shall be reused.
- The API accepts the following project data as input
- ���project name
- project description
- When create new project, the user should be grant full permission to the project. The project status should be active.
3) Security
The security utility should be used to authenticate the user.
API Standard
This standard needs to be followed for all direct APIs.
Http Response Codes and Error Handling
200 - Success
401 - Unauthorized (anonymous user can't access projects API)
405 - Method Not Allowed (Projects API only support GET/POST methods)
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
Integration Test
Integration test should be provided. You can find the example in https://github.com/cloudspokes/tech-core/tree/master/tech.core/tech.core.sample.basic/src/test
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.
Source Repo
tech-core: https://github.com/cloudspokes/tech-core/tree/temp_RestPersistenceService (SHA 80087f3431d725c34426d570baabdb94e98786ef)
Direct API: https://github.com/cloudspokes/direct-api/tree/create_new_project (SHA 3bfa87355de5db735a4d03896f4818274e4cdaf3)
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 Codes
- Test Data