Register
Submit a solution
The challenge is finished.

Challenge Overview

Welcome to the HP Open Print Ruby on Rails Setup - Multi-part Watermarking App!  HP’s Link Technology API allows for the hyperlinking of printed content through watermarks.  They have developed a scanning technology which can detect these watermarks on printed materials like catalogs, postcards, or business cards, and provide the functionality to navigate to associated digital content on a mobile device. For more information about HP Link Technology you should familiarize yourself with the features, API and the mobile LinkReader scanning app at https://www.linkcreationstudio.com and you can watch a video here.

We’re in the process of designing the user interfaces for this Multipart Watermarking App -- the initial wireframes will be provided for context here -- but in this challenge, the primary goal is to create back-end code that will save data, query and provide updates to the Link Studio REST API, and process images for the Multi-part Watermarking web application.

The requirements for this challenge are the following:

  1. Create a Ruby on Rails project, and deploy to web.   

  2. The indicated model (Diagram:  hp_open_print_multiple_watermarking_entities_v1.jpg.) is shown here. It includes key attributes and relationships.

  3. Create scaffolds for User, Project, Image, Region and Payoff models, including Rspec specs (tests)

    1. MySQL preferred, but SQLite is OK

    2. Use RSpec for testing framework

    3. Ruby version 2 or higher, Rails version 4 or higher

  4. Your web app should:

    1. have basic auth on all pages

    2. have two users seeded in the DB (db/seeds.rb)

    3. A user, that  has logged in, can

      1. create a project

      2. create an image within that project (provided a jpg for upload)

      3. create a region within the image

        1. region requires the information to create a payoff for the region

      4. create a second region that reuses the payoff created above

      5. download a final multi-watermarked jpg

  5. You should implement the following models and actions listed here:

 

 Model

Action

Description

User

login

Authenticates a User

User

index

list Users

 

show

show User by id

 

new

show form for User creation

 

create

create new User

 

edit

show form for User update

 

update

update User

 

delete

delete User by id

Project

index

returns a list of projects related to current User

 

show

returns a single project related to current User based on Project id

 

new

show form to enable Project creation

 

create

creates a new Project

 

edit

show form to update Project

 

update

updates a Project

 

delete

deletes a Project based on id

Image

index

list Images belonging to current Project

 

show

Image based on Image id.

 

download

builds final multiple-watermarked image with all regions replaced with the watermarked versions, and streams back the final  jpg. (additional action to scaffold)

 

new

show form to enable Image creation (upload image capability)

 

create

creates a new image

 

edit

show form to edit existing Image

 

update

updates a image

 

delete

deletes an project based on project id

Region

index

returns a list of regions related to current image

 

show

returns a single region based on region id

 

new

show form to new region creation

 

create

creates a new region

 

edit

show form to edit existing region

 

update

updates a region

 

delete

deletes an a region based on region id

Payoff

index

returns a list of payoffs related to current project

 

show

returns a single payoff based on payoff id

 

new

show form to new payoff creation

 

create

creates a new payoff

 

edit

show form to edit existing payoff

 

update

updates a payoff

 

delete

deletes an a payoff based on payoff id

Models should support the fields and relationships outlined in the Entity diagram.  Note the entity diagram is a suggestion for the desired implementation, not a blueprint.  We will need to support the functions outlined above (and eventually we’ll create a json-based REST API for this functionality), but you have creative license to propose or suggest alternative function signatures, designs and approaches.  You are strongly encouraged to discuss design proposals via the forums for this challenge so that pros and cons of various approaches can be considered.

Integration with Link API

The following actions will require that certain models interact with the HP Link Studio API’s and you will be expected to implement those interactions here and perform REST API calls using the Link Studio API in addition to persisting local data: (note, the rubygem live_paper may be helpful)

  1. region#create: Region model will need to create the remote resources on the Link API service - Trigger, Payoff and Link.

  2. region#update:  When a user updates a Region in the application that may include updating the payoff (the hyperlink) for their Region, the Region will potentially need to update the appropriate remote Trigger, Payoff and Link resources.

  3. region#delete: delete associated Trigger and Link remote resources.

  4. payoff#create:  Payoff model will create a Link API Payoff remote resource.

  5. payoff#update:  Payoff model will update the remote payoff resource.

  6. payoff#delete: if valid to delete, then delete remote Payoff resource.

  7. image#build: may need to list Regions

You’ll need to obtain a Link Creation Studio account from HP to explore and develop this functionality. Once you have an account and are logged in you will be able to see your Basic Auth token (here) or your client id & client secret (here)

Write tests using RSpec to demonstrate that your code is functional.

Make sure adequate test coverage is achieved (the rubygem simplecov is useful for this)

Some Guidance

Storage of Image sources can be one of:

  • AWS S3

  • Google Drive

  • Dropbox

  • LPP Storage Service

  • local folder in rails project

Image manipulation ruby gems:

  • ImageMagick (RMagick) - railscast

  • other rubygems you know of, or find...

 



Final Submission Guidelines

  • - Your complete Ruby on Rails project including your source code and gems upon which your code depends.
  • - Provide instructions on how to build and deploy your code.
  • - Documentation of your solution 
  • - The URL of your web application if it is public (optional)

ELIGIBLE EVENTS:

2015 topcoder Open

Review style

Final Review

Community Review Board

Approval

User Sign-Off

ID: 30050465