Skip to content

Instantly share code, notes, and snippets.

@netmask
Last active December 13, 2019 07:02
Show Gist options
  • Save netmask/2bedc9f3253d19eef072e86f1cf9cfca to your computer and use it in GitHub Desktop.
Save netmask/2bedc9f3253d19eef072e86f1cf9cfca to your computer and use it in GitHub Desktop.

Product Management Tool (Rails/JS)

Your task is to create a simple product management tool that lets you create products and search products in a listing page. You are required to use Ruby on Rails (>=5) and React for development.

Requirements

Your app will implement 3 models.

  • Product which contains the following attributes/validations:
    • name (string (0-1024 chars), unique)
    • upc (string (10,12 or 13 chars), unique, only numeric characters (0-9) allowed)
    • available_on (datetime, must be in the future)
  • Property which contains the following attributes/validations:
    • name (string (0-255 chars), unique)
  • ProductProperty which contains the following attributes/validations:
    • value (string (0-255))

Property will represent additional fields that can be associated with a product. Ex: brand, description, color etc. ProductProperty will contain the values associated with a Property object and a Product object. Ex: "Chanel", "Red" etc. In other words, a ProductProperty object should contain references to a Product object and a Property object.

Your app will provide 2 pages:

  • The Product Create page. This should contain a form with the required Product fields. The form should have a button that lets a user add more properties (name and value pairs) to the product. In the end there should be a save button which lets the user know if validations passed and a record was saved or not. Ex:

Product Form

  • The Listing page. This page lists the products created (in no particular order) and their details (including property name/value pairs). The Listing page also should contain a search field which dynamically searches product names and updates the listing page with the filtered results using React. Ex:

Product Listing

Guidelines

  • Your app must be developed using Ruby on Rails (>= 5.2).
  • You may use a database of your choice.
  • You may provide some test suite, Rspec, minitest, cucumber, your choise.
  • The search functionality on the listing page can be implemented using React.
  • The Product Create page can be developed using rails templating engine or React.
  • The forms do not need to be styled as shown in the example images but some styles.
  • There is no need to implement any sort of authentication on the app.
  • You may use any gem or library in your app to complete your project. Open-source and stackoverflow is your friend.
  • Your solution app must be uploaded to github.com and should include a README file containing instructions on setting up the database and running the app.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment