Giter Site home page Giter Site logo

fruits-search-add-to-cart's Introduction

Type Ahead / Auto suggestion Cart Product Search

Minimum requirements:

  • Fetch the list of fruits from the API url provided below
  • Cart items list is initially empty, unless a fruit is added.
  • The input should be a typeahead that renders fruit names. When typing into the typeahead, the search results are filtered b
  • Upon clicking on an fruit from the search result dropdown, the fruit should be added to the cart automatically
  • When add button is clicked an item is added to the cart
  • Fruit quantity should increment and decrement on button clicks
  • When quantity decrements to 0, fruit in shopping cart should be removed

Additional requirements:

  1. Make intuitive UI considerations, add comments if necessary to explain your decision thought process.
  2. Make sure to implement performant code. In a real world scenario, consider how your implementation could be optimized.
  3. Accessibility
  4. General best practices around component structuring

For a performant and production-grade implementation:

  • TypeScript and SCSS modules to ensure type safety and better organization of styles.
  • Well-structured API utility file
  • Use the Context API for state management to avoid prop drilling
  • best practices for security, including input validation
  • Implement Test Driven Development (TDD) using Jest to cover use cases for each component (to follow)

API Url

https://fruityvice.com/api/fruit/all

Mockups:

Project Image Project Image

live preview:

fruits-search-add-to-cart's People

Contributors

xell12686 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.