Skip to content

albert-d-chen/yike

Repository files navigation

Yike

Yike [Yi-kee], a Nike clone, is a online Kobe shoe store that allows users to browse, purchase, and rate shoes.

Live Demo

Framework:

  • Ruby
  • Rails
  • React.js
  • Redux.js
  • PostgresSQL
  • Webpack
  • Amazon AWS S3

Setup:

To run locally on computer:

In terminal:

  1. bundle install
  2. npm install

In computer: 3. Start PostgreSQL to start database

In terminal: 4. rails db:setup to setup database 5. rails s to start Rails Server 6. npm start to start Webpack module bundler

In browser: 7. http://localhost:3000

Features:

  • Demo User Sign In
    • Features a demo user log in for access to other functionality of the site without having to create a new user

demo

  • Product Index Page

    • Shows all inventory of shoes
    • Navigate through categories of shoes on main nav bar

    index

  • Product Show Page

    • Picture on index page links to the shoe show page
    • Able to choose a size to add to the cart

    show

    • Code to add a new item if it does not already exist in the cart
   addItem(newItem) {
       this.props.createCartItem({
           user_id: this.props.currentUserId,
           product_id: newItem.id ,
           quantity: 1
       })
       this.props.history.push('/shoppingcart');
       window.location.reload(false);
   }

   addToCart(e) {
       e.preventDefault();
     
       if (this.props.currentUserId) {
           let productIdArray = this.props.userCartItems.map(item => (
               item.product_id
           ))
           if (!productIdArray.includes(this.props.product.id) ) {    
               this.addItem(this.props.product);
           } else{
               return (
                   alert('Product already in cart!')
               )
           }
               
  
           } else {
               this.props.history.push('/login')
           }


  }
  
  • Shopping Cart Page

    • Shows all user's cart items
    • Can adjust the quantity of each cart item and update the total price

    cart

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published