Challenge Overview

  • Upgrade a set of endpoints in Topcoder Project API to V5 standards

Project background

  • Topcoder is streamlining its APIs and in this project we will be upgrading the existing Project API to V5 standards
  • Project API powers Topcoder connect, Topcoder Challenge V5 API and supplies data for Direct as well

Technology Stack

  • Node.js 8.11.x

  • PostgreSQL

  • Kafka

  • Docker & Docker-compose

Challenge Assets

  • Existing Topcoder Project API code can be found here. Please make sure to use the latest commit from `v5-upgrade` branch.

  • Topcoder API V5 standards document and Topcoder Kafka Event bus standards document is provided in the challenge forum which will be accessible after registration.

  • Swagger rewritten in V5 standards can be found here

Individual Requirements

Updating API response and Tests

  • Update the response structure of below group of API endpoints according to the updated swagger

    • All end points beginning with prefix `/projects/metadata`

    • End points listed under the Swagger group `project`

  • Update the tests based on the changes in the response structure for above end points

  • Project API uses tc-core-library-js for JWT Authentication. The library has an issue that whenever the token is not passed or invalid, it returns 403 instead of 401. Hence you may ignore the 401 status code in Swagger for now, it will be fixed later.

Fixing Security Vulnerability

  • Project API uses very old version of libraries like sequelize, mocha, elasticsearch, etc..

  • Few libraries need Major version upgrade to fix the vulnerability issues. Run the command `npm audit` to figure out which version should be used to fix the vulnerability issue.

  • When you upgrade any library, it may or may not require minor code changes. Please ensure that API runs fine after upgrading the dependencies to fix security vulnerability.

  • You may ignore the security vulnerabilities shown as dependency of tc-core-library-js. The library needs to be updated by the Topcoder internal Devops team to fix this issue.

Updates to Kafka Events Publishing

  • As of now, the Kafka topics used in the API to publish events are not standardized according to the Topcoder Event Bus Standards

  • Please refer to this thread to learn more about the structure of Kafka message to be used

  • Every Create / Update / Delete endpoint (including metadata endpoints) should post the event to Kafka using Bus API. Please follow the existing techniques used in the codebase. The fields to be passed in the Kafka message payload follows

    • For Create messages, every field stored in the database should be passed in the payload

    • For Update messages, it is sufficient to pass only the fields which are updated and the id of the resource which is updated

    • For Delete message, it is sufficient to pass only the id of the resource which is deleted

New end point for Swagger

  • Create a new end point with route `/docs` to serve the Swagger stored in `docs` directory. Please refer here to know about how it is handled in Submission API

Deployment Document

  • No changes are expected in the deployment steps but please add some notes regarding the V5 upgrade at the beginning of the Readme.

Validation document

  • Please create a brief validation document about how to apply your git patch file (with exact commit information) and how to validate your changes

Important Notes:

  • Ensure that there are no lint errors and every test pass.

  • If you have any doubts, Please feel free to post it in the forum. We will be happy to resolve your queries as soon as possible.



Final Submission Guidelines

  • Create a git patch file against the latest commit in `v5-upgrade` branch. Please prepare git patch file using git CLI only. Please make sure to test your patch file before submitting.

  • Create a Validation document using any format like Word, Markdown, txt file

  • Zip the patch file and Validation document and submit the zip file using the submit link in the challenge.

  • After submitting, please ensure that you are able to download your submission from Online Review

ELIGIBLE EVENTS:

Topcoder Open 2019

Review style

Final Review

Community Review Board

Approval

User Sign-Off

ID: 30092642