Yike [Yi-kee], a Nike clone, is a online Kobe shoe store that allows users to browse, purchase, and rate shoes.
- Ruby
- Rails
- React.js
- Redux.js
- PostgresSQL
- Webpack
- Amazon AWS S3
To run locally on computer:
In terminal:
bundle install
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
- 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
-
Product Index Page
- Shows all inventory of shoes
- Navigate through categories of shoes on main nav bar
-
Product Show Page
- Picture on index page links to the shoe show page
- Able to choose a size to add to the cart
- 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')
}
}