Challenge Overview

Welcome to topcoder new community site - proxied API calls Update challenge.  The main goal of this challenge is to refactor topcoder API calls from PHP based (proxied by wordpress) to call API endpoint directly.

Challenge Description :

Currently a lot of the API calls on www.topcoder.com to topcoder API (http://api.topcoder.com/v2) are proxied through the worpdress environment by calling /wp-admin/admin-ajax.php on the wordpress instance. The code behind each of those calls is in /wp/wp-content/plugins/TcApi-hookup/includes/ajax_func.php, so the underlying API that should be called instead will be available from there.

  1. Replace proxied API calls (calls in ajax_func.php to TC_API_URL) with a direct calls to the topcoder API from the front end
    For an acceptable example on how to implement this, see getHandle in src/js/scripts.js. The preferred method of including the Authorization header is to use restangular within the angular service objects (see src/js/app/challenge-details/js/services/challenge-details-service.js).
    The preferred method in the front end for accessing the API url config value is by using tcconfig.apiURL to prefer\ the namespaced configuration as the global tcApiRUL variable will be removed when possible. You may need to install a PHP extension to debug this.

  2. Replace all references on front end
    Please scan and replace all references to ajaxUrl, ajaxurl, admin-ajax.php in the front end code with direct calls to the topcoder API that is configured by tcconfig.apiURL. Please debug them on your browser console. example : http://screencast.com/t/mc05U85UWDz

  3. Remove Any calls to TC_LC_URL
    Any calls which call TC_LC_URL can be removed completely as this is no longer in use, so cases in the front end code that call these can be remove entirely, including conditionals that check to see if the page is an lc challenge.

  4. Remove twitter, blog, and about section from the footer
    Update all footer to simple version, which does not have twitter, blog, and about section. See how it should work on  https://www.topcoder.com/challenge-details/30049662/?type=develop&lc=. You may reuse the code from footer.html in src/ folder.

Scope :
The following scope need to be scanned, and most of them have been refactored from proxied calls (PHP) to direct calls (Restangular)
- Challenge Listing Pages ( http://www.topcoder.com/challenges/ )
- Challenge Detail Page ( example : https://www.topcoder.com/challenge-details/30049720/?type=develop&lc= )
- Registration to Challenge Page( click Register Button on challenge detail page )
- Submission Page ( click Register Button on challenge detail page )
- Header and Footer section on All pages
- Blog Page (most recent challenges listing on sidebar and comes from widget )

Scanning the Bugs :
The first step you need to do is listing/finding these issues. We've tried to played with wp_remote_get to debug to log file and then we get few  proxied calls. The goal is finding all/most then fixed these issues. Log file as example is attached in forum.
There are a variety of ways to discover the endpoints that need to be replaced, from something like this to searching for TC_API_URL in ajax_func.php then finding the use of each of those functions within the code.

Browsers Requirements :

- IE10
- IE11
- Latest Safari
- Latest Firefox
- Latest Chrome

Deployment Guide :

  1. We’ve completely moved repo to gitHub https://github.com/appirio-tech/tc-site/
  2. The development environment is here, and should be configured for that repo: https://github.com/appirio-tech/tc1-mf-vagrant
  3. If you have an existing local environment based on the project readme, that will work, but please reference the readme on tha above environment for instructions on how to configure your environment for each of our environments (config.json is obsolete and controlled by a Gruntfile build script).


Final Submission Guidelines

  1. Please submit only PATCH files instead of updated files,
  2. Please also submit Deployment Guide file
  3. If additional / updates page on wp-admin is required, please provide them in TEXT file and explain how to insert it in your Deployment Guide
  4. Any new js or css file must be included in the registry. learn about this on script-register.json file, and be sure it will be processed the Gruntfile.js as part of the build process. All tests must pass after the included files are minified.
  5. We will have winner to submit pull request once winner declared

ELIGIBLE EVENTS:

2015 topcoder Open

REVIEW STYLE:

Final Review:

Community Review Board

Approval:

User Sign-Off

SHARE:

ID: 30049672