Challenge Overview
In this challenge, we want to add a new feature called "My Challenges" in topcoder Direct. This new feature will use the REST API called "Direct API" we are implementing. See the following section for requirements details.
Requirements Details
Add the new dropdown in Top Nav
- Add a new item named "My" to the right of existing items in the Top Nav bar. See the screenshot my_created_challenges.png in the documents download section.
- The item should trigger a dropdown which has two entries
- My Created Challenges
- My Challenges
UI requirements
For "My Created Challenges" and "My Challenges" UI, it will reuse the datatables jquery plugin to render the table like a lot of existing direct projects (for example: https://www.topcoder.com/direct/projectDetails.action?formData.projectId=<direct project id>) . But the pagination will be done by the API in the server side, that means, the changing of pagination size, Use prev / next to browse table, or use page index to hit a certain page will all trigger new request to the API.
The page will only contain a single table with the title "My Created Challenges". We have provided a mock screenshot my_created_challenges_UI.png for your reference (See documents download section). Because the API does not supporting sorting now, so the sorting will be disabled for now.
The same requirements for "My Challenges", just the title name below the top nav bar is "My Challenges"
Direct API
We have deployed the dev version on the topcoder VM. You need to configure your hosts following:
54.196.182.9 direct.dev.topcoder.com
Then access it via the My Created Challenges end point: http://direct.dev.topcoder.com/direct/v1/challenges/
The authentication should be done by putting the following data in the HTTP header:
Header Name: Authorization
Header Content: Bearer <JWT token>
<JWT Token> is set in the cookie by auth0 login of the Direct. You need to read from the http request and use it to call the Direct API
The calling of Direct API should be done in action NOT front end. Please use Spring's RestTemplate to do the calling. The Json processing can be done with Jackson.
Note, you can find the source codes of Direct API attached in the documents section.
We have not deployed the end point for "My Challenges", please use "My Created Challenges" end point for "My Challenges" page too, we will switch the end point afterwards.
Table Contents
In the my created challenges and my challenges tables, the following columns are needed
- Challenge Type - the type of the challenge
- Challege Name - links to the challenge details page
- Direct Project Name - links to the direct project overview page
- Billing Account Name
- Client Name
- Challenge Start Date
- Challenge End Date
- Total Prize
VM Environment
You need a TopCoder VM with 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://apps.topcoder.com/wiki/display/projects/Direct+VM and 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 Cockpit/Direct 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.
Setting up auth0 and JWT on VM
Add the following to /home/direct/direct token.properties
@DOMAIN_AUTH0@=sma.auth0.com
@CLIENT_ID_AUTH0@=CMaBuwSnY0Vu68PLrWatvvu3iIiGPh7t
@REG_SERVER_NAME@=tc.cloud.topcoder.com
@LDAP_AUTH0_CONNECTION_NAME@=vm-ldap-connection
Update
@ApplicationServer.SERVER_NAME@=cockpit.cloud.topcoder.com
Rebuild and restart the topcoder Direct
Add the following to /home/tc/jboss-4.0.4.GA/server/all/conf/ApplicationServer.properties
JWT_COOKIE_KEY = tcjwt
Rebuild and restart the /tc
SVN Repo
https://coder.topcoder.com/tcs/clients/cronos/applications/direct/trunk Revision: 247245
Final Submission Guidelines
- All the newly added and updated files.
- A detailed deployment guide with verification steps.