Skip to content

The challenge is a basic shopping cart, it allows you to search, add, update and remove products.

Notifications You must be signed in to change notification settings

infantito/shopping-cart

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Full-Stack Developer

The challenge is a basic shopping cart, it allows you to search, add, update and remove products.

Once you have all you need in your shopping cart you can complete the order and visit the thank you page.

You can see the prototype and the design inspector

You will have to signup in Figma in order to use the inspector.

Requirements

Empty cart

At the beginning the cart is empty, the pricing panel is set to zero, the delivery date is calculated (see the rules section to know how to calculate it) and the complete order button is disabled.

The search box lets you find products.

Empty Cart

Cart with search results

When you type the name of a product, the matched results will appear in the cart panel.

The cart panel shows the results when the search box is not empty, otherwise, it shows the products already added to the cart.

From this view you can add the product using the counter component (see rules section).

Cart with Search Results

Cart with products

Here you can see the products added to our cart, the pricing panel updated and the complete order button enabled (see rules section to know when to enable the button).

Remember that you can only access the cart products if the searchbox is empty.

Cart with Products

Thank you

Once you complete the order you visit this page, it displays the order code and gives you a link to continue shopping.

Thank you

Tools

Frontend

  1. Use create-react-app to setup the project.
  2. Use styled-components to style the components.
  3. Use apollo-client to communicate with the backend and state management.
  4. Use reach-router as the router.

Backend

  1. Use graphql-js to build the api
  2. Use MySQL as database and sequelize as ORM to handle operations.
  3. Use express as server.

Deploy

  1. Use Heroku as plataform to deploy.
  2. Use JawsDB as the addon to deploy your MySQL database.

Resources

  1. How to GraphQL
  2. Beginner GraphQL Series
  3. Learn Sequelize

Rules

Delivery date

The company delivers in 24 hours from Monday to Friday. Take this rule into account while calculating the delivery date.

For example:

A person buying on Friday, Saturday or Sunday will see Monday as the delivery date instead of Saturday. A person buying on Monday will see Tuesday as the delivery date.

image

Pricing

The shipping cost is always 10% of the products cost. Taxes are 18% of the products cost. Product prices have taxes included.

Example:

if all products cost $100 the shipping cost will be $10 while taxes is $18 and the final price $110.

The shipping cost line must highlighted.

image

Complete order button

The complete order button is only enabled and has an orange color if the total price is equal or greather than $50, otherwise, the button is disabled and the order cannot be completed.

image

Shopping cart products

A shopping cart product can be removed by clicking on the delete button.

image

The Product and Counter components

Check the behaviour in here

The counter component will dull the product component if opened and show two knowbs to decrease and increase the product quantity while the number in the middle gets updated as well as the pricing panel.

image

Empty cart

If the cart has no products and the search box is empty, an empty cart state is shown.

image

The Order code

The order code should be incremental, and must have 5 characters including the P.

example: for the first order the code will be P0001 for the order 20 the code should beP0020.

image

About

The challenge is a basic shopping cart, it allows you to search, add, update and remove products.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published