Hack-a-thon #2: Building a Bookstore
Building a Bookstore Part 1
Today is the day we finally MONETIZE! Our billion-dollar idea: we're going head-to-head with Amazon's book store. This will be a group project using the same GitHub workflow that we used for the Student Showcase website.
Step 1: Set up a GitHub repo
Fork and clone your integration manager/instructor's boilerplate for this project, and make sure that your remotes are set up correctly for the GitHub workflow!
If you or your team needs to review, take a look at the student showcase.
Step 2: Self-Reflection
The following lists the core web development skills that you should feel comfortable using in your project thus far:
Using Markdown to create a README.md file introducing your project.
Pushing to GitHub and seeing it rendered on your repository's main page.
Creating an HTML document using the following HTML tags:
<html>,<head>,<title>,<body>header and paragraph tags
bold and italic tags
<div>and<span>ordered and unordered lists
images and links
Using a style attribute on an HTML element, then a
<style>tag in the head, then a<link>tag to a separate.cssdocument to include CSS styles in your page.Refactoring your code to use classes and ids.
Using complex CSS selectors
Using
positionsfixed,absolute, andstickyto position elementsCreating an HTML form incorporating various inputs (
text, password, email, textarea, radio, checkbox, submit, etc)Making your form live using Formspree
Using
display: flexto build dynamic containers in 2 dimensionsUsing the CSS grid system to lay out your page
Using built-in global functions like
console.logSetting and retrieving values from JavaScript variables and complex data types like Arrays and Objects
Using
document.querySelector()in conjunction with.textContentand.innerHTMLto retrieve and place content on the pageUsing
if,else ifandelseto implement branching logicUsing logical and (
&&), logical or (||), and boolean negation (!)Composing functions with
returnvaluesUsing basic
events to help users interact with your page
Step 3: Coding!
Let's go through the following steps, dividing up tasks as a team, to get this new mega-store launched. Good luck:
To start, make sure you've properly forked and set up your project repo.
Create
Navigation,Header,Content, andFootercomponents to inject into adivwith anidofroot. Useparceland the module system to organize these components! You should be able to create the entire application with a singlerenderfunction.Now add some content to the header and footer components.
Add layout CSS using
positions and/orgrid.Add some css styles to make each component stand out.
Create a
<form>element that will allow a user to input a new book (eventually). Make sure that each field has anameattribute that's exactly the same as the corresponding property listed above (you'll see why in a minute).Now take all the information about our books and make them into JavaScript Objects. Create variables
book1,book2, etc. Set each equal to an object with keysname,author, andpictureUrl, which hold string values,priceandid, which holds a number value, andsellingPoints, which is an Array of Strings. EXAMPLE:Create a
Bookstateless functional component that takes in a book Object (like the one above) and outputs that book's information in card-like markup.Make sure that the
Bookcomponent has corresponding styles!importtheBookcomponent into yourContentcomponent, using it to transform eachbookObject into useable markup. What are the limitations of this approach?Instead of
import-ingBookintoContent, let's feed all of the book Objects intoContentinindex.js. How could you organize those book Objects into a single complex data type to give toContent? And how could we handle that complex data type inContentNow let's make this form work! We'll do that by hooking into the
submitevent:
In whatever time remains, make sure that this bookstore looks as good as we can make it!
Last updated