Challenge Overview

Welcome to the IBM Castle - Improve AngularJS Code Style. As part of this contest, we would like you to improve the AngularJS code style for the IBM Castle project.

 

If your submission gets a score of more than 95, we will pay you an additional $400 when the contest ends. Up to three submissions are eligible for this bonus and the first submission (if you resubmit your timestamp resets) to pass this score will receive an additional $200.  

This challenge is part of the *IBM Castle* Challenge Series.  Competitors who win challenges in this series will compete in a leaderboard of points for additional prizes. We have lots of contests coming in this series so it is best that you participate early and frequently.

Project Overview

This project is the foundation for a complex, enterprise email, calendaring, and messaging system.  We will be building a robust REST API to allow multiple frontend clients to connect to many different services, including multiple mail server backends.

Contest Details

Our application contains a front end built using AngularJS. We would like to refactor the code to use John Papa’s AngularJS Style guide. In addition to this, we would like you to replace the existing front end eslint rules with the one used in the eslint-plugin-angular.

We also need to add logging 

  • introduce client-side logging
    • currently there is 0 logging and we need to change this
    • angular offers $log and this can be switched on and of based on request params, cookies etc
    • we should extensively log but disable logging when we ship the product
    • If you have a better suggestion for client side logging please ask in the forums

 

  • introduce server-side logging
    • winston should be use as logging framework on the node js
    • info statements serve as a red line through the app in the log
    • warning/errors for problems
    • debug for additional information that is only relevant if problems occur
    • silly logging prints big variable payloads
  • get rid of async on the backend side

Kindly note the following:

  1. In case there is a mismatch in the rules specified in the eslint-plugin-angular and the style proposed by John Papa, then you are requested to follow the style proposed in John Papa and configure the eslint to follow the same. Please also mention this in the contest forum.

  2. As part of the papa style guide, no directive should contain any logic and all directives should contain a controller that executes its logic. Logic that is beyond transforming objects so that they can be rendered properly, needs to be externalised into a factory
  3. We are currently using Angularjs’s standard router. We would like you to use the Angular UI Router instead.  

  4. Make use of bower when working with libraries. Lock the version of the library used and make sure to persist resolving conflicts in the bower.json file

  5. Twitter Bootstrap and Calendar are currently not being used via bower. We will be refactoring the code to make this used via bower. You don’t have to carry this out. You CANNOT make changes in this file though.

  6. Kindly make sure that you do not break any existing functionality. We will share a feature list with you in the contest forums.

  7. DO NOT make indentation changes. Please focus on only carrying out the changes needed for this contest.


Final Submission Guidelines

Framework selection:

Frontend: angular, bootstrap, ui-router, fontawesome, q, lodash

Backend: Loopback, Q, lodash, winston

Submit a git patch of your changes. Please make sure that it can be easily applied across all types of systems (Mac, Linux and Windows).  You can get access to the Gitlab repo group using our self registration tool linked in the forum. This is the branch you will be using https://gitlab.com/ibm-castle/api/tree/angular-refactor

ELIGIBLE EVENTS:

2016 TopCoder(R) Open

Review style

Final Review

Community Review Board

Approval

User Sign-Off

ID: 30053792