Homework 4: Using React

Assigned: 10/11/2022; Due: deadline extended until Friday, 10/28/22 at 3:05pm ET (formerly: 10/25/2022)

Overview

In this assignment, you will be redoing most of homework 1 in React, which we hope you find to be a lot easier than it was to use pure html/CSS/JavaScript, and adding a shopping cart page, also using React. The objective of this assignment is to learn React and JSX (React's extension to JavaScript for generating html), how to use React for handling state, like the selected shirt and the selected color (for the details page), and the number of items to be purchased (for the shopping cart), etc. You will also be learning and using the ReactRouter package, which helps with having a multi-page web application.

Although we are now using a variety of libraries as part of React, we only want you to use the ones that come with Create-React-App and ReactRouter. You may also use ReactStrap which makes it easy to make your implementation responsive and provides patterns like buttons and cards which you had to do by scratch for homework 1.

Note that there are React libraries available already for almost everything, including a number that provide a shopping cart, but you are not allowed to use those -- you must stick to the 3 allowed React packages. If you have another package you think should be allowed, then ask on Piazza.

As with the previous homeworks, you should try to mimic the look and behavior of the examples we provide as closely as possible.

Resources

Michael Liu created an example of a React and ReactRouter app showing Star Wars characters which has a home page, list of characters page, and a details page, so it can be a good model for how you can create something very similar to Homework 1. Here are the links:

This tutorial:  https://github.com/gitname/react-gh-pages explains how to do the github pages deployment..

You will download a new project for Homework 4 from Github, like for homeworks 1 - 3 -- the exact location is on Canvas in the instructions for Assignment 4. The download will contain the following starter files:

In addition, we have supplied the following for your reference:

home page Products page Details page
Not Implemented Page Shopping Cart Page

Detailed Requirements

We have supplied screen shots and a movie to define the required behaviors. As with homework 1 and 3, you don't have to be "pixel perfect", but you should have the all operations pretty much looking and behaving in the same way as this specification. If something is unclear about how it should work, or you want to deviate from the defined behavior, you might want to first ask on Piazza. If your homework 1 did not match our specification, you should make your homework 4 match our specification (and not match your incorrect homework 1).

Extra Credit

Grading

Since this homework has lots of parts, some students may want to know what each part is worth. Here is a summary breakdown: total = 100 points:

Turn In

Please have a README file in your subfolder (as in hw3), which can be in plain text, Microsoft Word, or pdf format, which should contain: