Register
Submit a solution
The challenge is finished.

Challenge Overview

Overview

We are building an image processing (micro) service and in this iteration we want to focus flipping images, adding a percentage based scale parameter to the resize API and updating used npm-packages.

The micro service provides a REST API where we can send the multipart/form-data of file and several input parameters. As a response we want to receive the transformed image.

Existing Project Structure

This project is based on lerna, the package relevant can be found in /packages/server . The following commands are at your disposal to build, test and lint the project. Inside /packages/server/:

  • make build - build the package
  • make test - run the tests
  • make lint - run the eslint

For further information, please see the README

Updating used packages

Please update Jimp to the latest version and ensure functionality of all dependent functions. (Currently 6.4.0)

API Endpoints

Flipping

/api/images/flip

Available parameters

vertical: boolean

horizontal: boolean

Parameter description

vertical: true or false - defines if the input image shall be flipped vertically, default is false

horizontal: true or false - defines if the input image shall be flipped horizontally, default is false

Both parameters can be applied at the same time. The result would be an image that is flipped vertically as well as horizontally.

Resizing

/api/images/resize

This endpoint needs to be enhanced with the following parameters:

New parameters

scale: number (1 - 200, default 100)

New parameter description

scale: If this parameter is set, the other parameters (height, width, keepaspectratio and scaleup) are ignored. The endpoint will scale up or scale down the input image, keeping the aspect ratio. The number represents the percentage of the original image. So scale can go from 1 to 200%.

Tech Requirements

  • Programming language used must be node.js written in typescript.
  • The provided project skeleton must be used for implementation
  • Code must be properly documented
  • The provided linting configuration must be used
  • Every implemented functionality must be tested by unit-tests
  • All packages used for this implementation must be MIT, BSD or Apache 2.0
  • Every defined port, host etc. should be put in central variables / configurations for easy re-configuration (if applicable).
  • The express based components of this implementation must be based on https://tsed.io/
  • Eslint must show no errors inside IDE (VSCode) and on on Command Line
  • Please see the attached list of preferred node_modules and stick to it. Exceptions from this list must be provided with a reason.
  • Do not use unmaintained or deprecated node_modules
  • The existing API documentation needs to be expanded with the new features.

Preferred Node-Modules

  • HTTP Requests: Axios
  • Logging: @enchanted/logger
  • Linting: @enchanted/eslint

Expected Results

  • The service needs to provides API endpoints which accept multipart/form-data as input
  • The service accepts a file and the parameters described above
  • The service respond sto a correct request with the transformed image
  • The service provide proper HTTP status codes on error


Final Submission Guidelines

  • Full code that covers all the requirements.
  • A detailed README file including information on how to setup and run your application.

ELIGIBLE EVENTS:

2020 Topcoder(R) Open

Review style

Final Review

Community Review Board

Approval

User Sign-Off

ID: 30107572