GithubHelp home page GithubHelp logo

shopping-react's Introduction

shopping react app

https://media.giphy.com/media/3ov9jSVZW5EkTUnzeE/giphy.gif

wiref.png

Create a shopping app for products.

There should be 3 main components:

  1. A search component
  • search for a product and display the results
  • clicking on a product causes the product window to display/be filled
  1. Product display component
  • displays information about the product
  • has a button to add to cart
  1. Cart component
  • displays everything that was added to the cart
  • calculates subtotal, GST and shipping (flat $7)

Add bootstrap to your app if you like.

How to Start: Rails

A product has a name, a price and a description and an image url. Look in the seeds.rb file for a reference.

Create a migration, model, route and controller for products. For now you only need one route, which shows a list of all products. Product.all

There is a (non-working) seed file that will fill your products table after you have a model.

How to Start: React

You should begin your app with one single working component- begin with the search component on the left. Use AJAX to make a query to this route and then use react to display the results.

When you have a working component that displays the search results, you can begin on the second component. Refactor your code to store the list of results in the parent of the search component. Then use the search result the user selected to populate the second component.

You can then move on to the 3rd component to display the items the user has added to their cart from the 2nd component.

further

Add a carousel component to your app to display all the product images. Perhaps slick carousel npm library: https://github.com/akiran/react-slick

further

Add a sorting function to the search page. (just sort the results you currently have)

further

When the add to cart button is clicked again, add another item to the cart.

further

Let the user take things back out of the cart

further

Make each item in the cart a link. When the user clicks an item it opens in the product display tab.

further

Change the layout of the app to have only 2 columns. Add CSS to make the cart position:absolute. When something is added to the cart, make the cart display. Add a button inside the cart to hide it.

further

Paginate your search results.

further

Add more of the search result attributes into the product page.

further

Adjust the shipping cost according to the item added to the cart.

shopping-react's People

Contributors

awongh avatar laustinspayce 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.