Git Product home page Git Product logo

matthewaubert / shopping-cart Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 2.75 MB

An e-commerce site built to practice TypeScript, testing, client-side routing, and fetching data from APIs in React. It pulls product info from fakestoreapi.com. There is currently no back end, so users cannot actually check out.

Home Page: https://shopping-cart-ma.pages.dev/

JavaScript 0.83% HTML 0.99% CSS 15.48% TypeScript 82.30% Shell 0.40%
client-side-routing ecommerce javascript react shopping single-page-app webapp fetch-api typescript

shopping-cart's Introduction

Shopping Cart

An e-commerce site for a fake store โ€“ browse items and add them to your cart.

Click here to view the live site

screenshot of home page screenshot of shop page

How to Use

  1. Head to the live site on any device (mobile, tablet or desktop โ€“ it doesn't matter)
  2. Click on the SHOP NOW button on the left-hand side or click on any of the category links up top
  3. If you like a product, click on the Add to Cart button, enter the quantity you'd like to "purchase", and then click Submit. The item will be added to your cart and you'll see a quantity appear on the shopping cart icon in the upper-right corner of the screen. Add and remove as many items as you like to your cart!
  4. To view your cart, click on the icon in the upper-right corner of the screen. A pop-up will show you all of the products, amounts, and prices of every item; as well as a grand total price.
  5. There's no back end (and these aren't real products anyway!), so you cannot actually checkout. But click on the Checkout button anyway for a special surprise ๐Ÿ˜‰
app-use.mp4

Project Objectives

This project was built in order to implement what I've learned about testing, type checking, client-side routing, and fetching data in React.

I later came back to this project and refactored it to TypeScript as a way to learn the language. It seemed like a natural progression from the type checking I had initially done.

Technologies Used

Languages

  • TypeScript / JavaScript
  • CSS
  • HTML
  • Bash โ€“ for writing a script that generates a .tsconfig-lint.json file that lints/type-checks individual or smaller groups of TypeScript files at a time in the CLI. (By default TypeScript does not support linting/type-checking individual files in the CLI, and seeing type errors for all files at once was overwhelming.)

Libraries and Tools

  • React
  • Vite โ€“ for project scaffolding and development
  • Git (obviously)
  • Vitest โ€“ for testing components
  • React Testing Library, jest-dom โ€“ for testing components
  • React Router โ€“ for client-side routing
  • React PropTypes โ€“ for type checking before the TypeScript refactor

Credits

shopping-cart's People

Contributors

matthewaubert avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.